I come from an SPSS background and am attempting to move to R
for it's superior flexibility and data manipulation abilities. I have some concerns however as to whether the lm()
is really using partial correlations.
I'm basically trying to run a linear regression, using something similar to the "enter" setting in SPSS, which essentially builds the model one variable at a time, reporting the change in $R^2$ with each additional variable. This allows you to determine how much predictive power each variable adds to the model.
When I run the same analysis in R
however, I don't get any information on the $R^2$ contributed by individual variables, and I'm not even sure that it's using partial corrrelations to calculate the p-values it's reporting!
My code follows:
summary(m1 <- lm(totalprop ~ cos(Angle) + Alignment + colour +
Angle*Alignment, dataset))
My questions:
- Does R use partial correlations to determine reported p-values from
lm()
? - How can I make
R
report change in $R^2$ with each additional variable. - How can I make
R
act like SPSS in calulating the model piece by piece? Is this possible without running multiple iterations of the lm() function? If not, how does one control for the effects of covariates in R?