[R] Lack of Fit test
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Thu Feb 24 11:25:35 CET 2000
Bill Venables <William.Venables at cmis.CSIRO.AU> writes:
> Moreover no special software is needed. Suppose you have only
> one predictor with repeated values, say x, and you are testing a
> simple linear regression model. Then you can do the test using
>
> inner.mod <- lm(y ~ x, dat)
> outer.mod <- lm(y ~ factor(x), dat)
> anova(inner.mod, outer.mod)
Or, anova(lm(y~x+factor(x),data)) and the F-test is in the row for
factor(x). Has the advantage of making *d?mn* sure that you are
actually comparing nested models... Or, in the case with few
replications of each x, perhaps consider models like
y~x+cut(x,cutpoints)
(although some might prefer (say) a spline curve alternative instead)
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list