[R] Partial R-square in multiple linear regression

peter dalgaard pdalgd at gmail.com
Sun Jun 3 18:08:56 CEST 2012


On Jun 3, 2012, at 17:00 , Uwe Ligges wrote:

> 
> 
> On 01.06.2012 21:05, Jin Choi wrote:
>> Hello,
>> 
>> I am trying to obtain the partial r-square values (r^2 or R2) for
>> individual predictors of an outcome variable in multiple linear
>> regression. I am using the 'lm' function to calculate the beta
>> coefficients, however, I would like to know the individual %
>> contributions of several indepenent variables. I tried searching for
>> this function in many R packages, but it has proven elusive to me. I
>> am an R beginner, and I am hoping that I will find a solution!
> 
> 
> summary(lm(...)) calculates the R^2. See ?summary.lm

The question was about _partial_ R^2. There is such a thing and it would be calculated as

SS_term/(SS_term+SS_error) 

where SS_term is the sum of squares of the kind you'd get from drop1(). For single quantitative terms, as far as I can tell this is the square of the partial correlation obtained by regression of y-residuals on x-residuals, removing effects of all other terms in the model.

However, that is not a "partitioning" of the full R^2. The partial R-squares do not sum or otherwise combine to give that number. Rather, it is just a transformation of the F-statistic for the relevant term. 

> 
> Uwe Ligges
> 
>> Thank you very much.
>> 
>> Sincerely,
>> 
>> Jin Choi
>> MSc Epidemiology student
>> McGill University, Montreal, Quebec, CANADA
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list