Lecture 10 Feb
Added-variable Added variable plots give you a visual sense of whether x2 is a useful addition to the model: E(y|x1) = a + b x1
Steps to making one Regress y on x1 Compute residuals of y on x1: y "-"x1 (remove x1 from y) Regress x2 on x1 Compute residuals of x1 on x2: x2 "-"x1 (remove x1 from x2) Plot y"-"x1 vs. x2 "-"x1
Interpret If there is a "significant" slope, then x2 is useful. Slope of the added variable plot is the same as the coefficient if you fit E(y|x1, x2) = B 0 + B 1 x1 + B 2 x2
Significance Tests Find the slope of an added variable plot, and do a t-test to see if the slope is significant. The value of the t-stat is almost the same as the value of the t-stat for the "full" model. The p-values will differ because the degrees of freedom are different: n-2 for added- variable slope, n-3 for full model
Mussel Beds
Is density related to food levels?
Is density related to human use?
If we know the human use level, do we need to know food leve?
Added-Variable
Summary of added variable plot slope = additional amount of food worth mm of thickness, on avg., controlling for human use t = 4.742, p=1.45e-05
Summary of lm(thickness~food+human.use) E(thickness|food, human) = *food * human.use t_food , p = 1.84e-05
Testing one variable: Plan #1 H0: Beta1 = 0, Beta0, Beta2, Beta3, etc. "arbitrary" Ha: Beta1 <> 0, others arbitrary Fit full model: y = B0+B1*x1+B2*x2+B3*x3 etc. Fit reduced model y = B0 + B2*x2+B3*x3 Compare RSS
partial F-test Compare RSS (full) with RSS (reduced) Note: RSS(reduced) will be ???? than RSS(full) F = ( ( RSS(red) - RSS(full) ) /1 ) /RSS(full)/(n-p) Note: The denominator is just = ????
Formula for partial F (Reduction in RSS)/DF num divided by RSS/DF den DF of a model is n - # of parameters estimated. DF num is DF(full)-DF(reduced) DF den is n - p
In R (long) full <- lm(y ~ x1 + x2 + x3 + x4) red <- lm(y~x2 + x3 + x4) anova(full); anova(red) compute by hand from output
R(short) full <- lm(y ~ x1+x2+x3) anova(full) Read output
Plan #2 t^2 = F full <- lm(y~x1+x2+x3) summary(full) look at t-statistic