? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101012/bde30916/attachment.pl>
Dear Vittorio, Notice that anova(regress) gives a warning: ANOVA F-tests on an essentially perfect fit are unreliable Maybe summary(regress) should give a similar warning in case of a perfect fit. Allthough you should notice that the residual standard error displayed by summary() is extremly small. Which indicates that something might be wrong. HTH, Thierry ------------------------------------------------------------------------ ---- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and Forest team Biometrics & Quality Assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey> -----Oorspronkelijk bericht----- > Van: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] Namens Vittorio Colagrande > Verzonden: dinsdag 12 oktober 2010 15:01 > Aan: r-help at r-project.org > Onderwerp: [R] Linear Regression > > Dear R-group, > > We have begun to use it for teaching Statistics. In this > context we have run into a problem with linear regression > > where we found the results of are confusing. > > Specifically, considering the data: > > > > x=c(4,5,6,3,7,8,10,14,13,15,6,7,8,10,11,4,5,17,12,11) > > y=c(rep(7,20)) > > > > and settings > > > > regress=lm(y~x) > > > > summary(regress) gives the following results: > > > > Estimate Std. Error t value Pr(>|t|) > > (Intercept) 7.000e+00 8.623e-17 8.118e+16 <2e-16 *** > > x -1.116e-17 8.956e-18 -1.247e+00 0.229 > > --- > > Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > > > Residual standard error: 1.565e-16 on 18 degrees of freedom > > Multiple R-squared: 0.6416, Adjusted R-squared: 0.6217 > > > > Other statistical packages respond that the analysis can not > be done. We think that the results of R-squared > > does not seem to express the variability of y explained by x. > We would greatly appreciate any clarification you > > could provide. > > > > Thanks you and best regards. > > Marta di Nicola e Colagrande Vittorio > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
On Oct 12, 2010, at 9:01 AM, Vittorio Colagrande wrote:> Dear R-group, > > We have begun to use it for teaching Statistics. In this context we > have run into a problem with linear regression > > where we found the results of are confusing. > > Specifically, considering the data: > > x=c(4,5,6,3,7,8,10,14,13,15,6,7,8,10,11,4,5,17,12,11) > y=c(rep(7,20)) > #and settings > regress=lm(y~x) > summary(regress) gives the following results: > > Estimate Std. Error t value Pr(>|t|) > (Intercept) 7.000e+00 8.623e-17 8.118e+16 <2e-16 *** > x -1.116e-17 8.956e-18 -1.247e+00 0.229 > --- > Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > Residual standard error: 1.565e-16 on 18 degrees of freedom > Multiple R-squared: 0.6416, Adjusted R-squared: 0.6217 > > > > Other statistical packages respond that the analysis can not be > done. We think that the results of R-squared does not seem to > express the variability of y explained by x. We would greatly > appreciate any clarification you could provide.It is expressing the degree to which the estimate of the intercept "explains" the tendency of the data to be away from the null hypothesis of y=0. Consider what you get from two (equivalent to each other) lm calls: > regress2=lm( I(y-7)~x ) > summary(regress2) Call: lm(formula = I(y - 7) ~ x) Residuals: Min 1Q Median 3Q Max 0 0 0 0 0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0 0 NA NA x 0 0 NA NA Residual standard error: 0 on 18 degrees of freedom Multiple R-squared: NaN, Adjusted R-squared: NaN F-statistic: NaN on 1 and 18 DF, p-value: NA > y2=y-7 > regress2=lm( y2~x ) > summary(regress2) Call: lm(formula = y2 ~ x) Residuals: Min 1Q Median 3Q Max 0 0 0 0 0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0 0 NA NA x 0 0 NA NA Residual standard error: 0 on 18 degrees of freedom Multiple R-squared: NaN, Adjusted R-squared: NaN F-statistic: NaN on 1 and 18 DF, p-value: NA>-- David Winsemius, MD West Hartford, CT