# Scott Merrill # Colinearity # Nov 27 rm (list = ls(all=TRUE)) z = runif(1,100, n=100) x1 = 2*z + rnorm(mean=0,sd=3,n=100) a2 = 1.001*x1 + rnorm(mean=0,sd=3,n=100) x3 = .5*z*z + rnorm(mean=0,sd=3,n=100) cor(x1, x2) y = x1 + x2 + x3 + rnorm(mean=1,sd=8,n=100) mod1 = lm(y~x1 + x2) summary(mod1) # imagine data for 50 different sites # days above 0 degrees C in march # average temperature in march # amount of coal burned per household # What if x1 is days number of days above # 0 and x2 is average temperature in march # What is your interpretation of the effect of average # temperature on coal burning mod2 =lm(y~x1) summary(mod2) mod3 =lm(y~x2) summary(mod3) AIC(mod1) AIC(mod2) AIC(mod3) modx=lm(mod1$residuals~x2) summary(modx)