Does lm() use partial correlation - R Squared Change? 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?

 A: Another function that you might find useful is lm.sumSquares in the lmSupport package.  Basically, if you have the following model:
mod1 <- lm(dv ~ iv1 + iv2 + iv3, data = d)

Executing the following will give you the delta R squared (the semipartial correlation squared) and PRE (the partial correlation squared) for iv1, iv2, and iv3:
lm.sumSquares(mod1)

lmSupport also contains the function lm.deltaR2 that allows you to compare custom models against each other to obtain the change in R squared and the F-statistic associated with the R squared change.  So, going back to the above example, if you also had this second model:
mod2 <- lm(dv ~ iv1 + iv2 + iv3 + iv4 + iv5, data = d)

Then you could do the following to obtain the R squared change for adding iv4 and iv5 and the accompanying F statistic and p-value:
lm.deltaR2(mod1, mod2)

Hope that helps!
A: R doesn't use partial correlations to determine reported p-values from lm.
Indeed, you can examine the code that computes the p-values for yourself; if you type 
> summary.lm

you will see the code of the function includes the following:
    ans$coefficients <- cbind(est, se, tval, 2 * pt(abs(tval), 
    rdf, lower.tail = FALSE))

which shows that for each variable, the p-value is computed from the t value by looking up t tail-areas
It is quite easy to compute changes in R^2 between models if you need to do that, but I expect one of the many packages on CRAN does it already.
A: I'm no R expert but I've looked into this same issue (your 2nd and 3rd questions) and found the following.


*

*You do need first to run the lm command for each model separately.

*If a formal test of the F associated with the change is of interest to you, you can formally compare successive models using anova, e.g., anova(MyModel1, MyModel2). 

*This anova test will only work if each solution is based on the same subset of cases. So you may need to run a command at the outset such as mydata=na.omit(mydata).


EDIT:  the relaimpo package's calc.relimp command ("relative importance") calculates delta rsq for each predictor when entered last (its semipartial rsq) and/or when entered first (its zero-order rsq).
install.packages("relaimpo", dep=c("Depends"))  
library(relaimpo)  
calc.relimp( MyRegressionModel, type = c("last", "first") )

