Linear regression with a continuous and categorical predictor
Compare models using AIC, t-tests, adusted \(R^2\)
Diagnostics (again!)
Bonus:
Exposure to ggplot
Exposure to stepwise model selection, model averaging
Mole rats: energy expenditure vs. body mass
lm(ln.energy ~ ln.mass + caste, data=MoleRats)lm(ln.energy ~ ln.mass + caste + ln.mass:caste, data=MoleRats)The latter expression is equivalent to:
lm(ln.energy ~ ln.mass*caste, data=MoleRats)
Abundance of longnose dace (Rhinichthys cataractae) in 75-meter sections of a stream.
Explore factors related to abundance…
fullmod<-lm(longnosedace ~ acreage+do2+maxdepth+no3+so4+temp, data=dace)
Loop:
Determine how much complexity you can afford (how many variables you can afford to include given your sample size)
\(p = n/10-n/20\)
Fit a single model (with no model selection)