[R] calculation of r (corelation coefficient) from models

S Nakagawa S.Nakagawa at sheffield.ac.uk
Mon Apr 10 00:02:40 CEST 2006


Dear R users

This is a stats question rather than R question. For continuous predictors, we
get estimates of slopes and their se and t values (slope/se) in R ouptput. If
we have a model with more than one continuous variable (i.e., multiple
regression), we get slope, se and t value for each continuous predictor. Here
is my question - is there any way I can calculate r value or correlation
(partial correlation?) between each continuous predicator and response, using
these parameters in R output? If I just have one response and one predictor, I
would use cor.test(x, y) or cor(x, y) function but I was wondering whether I
could calculate correlation coefficient for each predictor from a statistical
model. 

Cohen’s d (dimensionless effect size) is very easy to calculate from t values
and sample size when I have categorical (dichotomous) predictors, but I could
not get r (correlation coefficient; another dimensionless effect size) when I
have continuous predictors using t values or related statistics from models. 

Thank you very much

Shinichi




More information about the R-help mailing list