### Model Fitting
> lm.out <- lm(y~x, data= )
> summary(lm.out)
> names(lm.out)
> coef(lm.out)
> resid(lm.out)
> predict(lm.out)
> model.matrix(lm.out)
> y ~ x + fac + fac:x
> y ~ x | fac1 + fac2
> y ~ x + I(x^2) # polynomial term
> anova(lm(y~x), lm(y~x+I(x^2))) # anova table testing x^2
### Add a trend line
> plot(dist~speed, data=cars)
> abline(lm(dist~speed,data=cars))
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment