[R] Std. error of correlation coefficients

Joshua Wiley jwiley.psych at gmail.com
Wed Aug 11 15:53:09 CEST 2010


Hi,

Look at ?cor.test, it does not give you the standard error, but it
does give you a confidence interval around the correlation coefficient
and a significance test (which is my best guess of what you are
probably looking to do with the standard error).  You could also get
it out of a simple regression if the variables were z scored.

summary(lm(scale(y)~scale(x)))

Or since the formula is so simple you could just do:

sqrt((1 - cor(x, y)^2) / (length(x) - 2))

HTH,

Josh

On Tue, Aug 10, 2010 at 5:18 PM, fusun gonul <fusungonul at hotmail.com> wrote:
>
> How do I get the std. errors of correlation coefficients? When I use the cor
> function it only prints the correlation.
> Thanks, Fusun.
> --
> View this message in context: http://r.789695.n4.nabble.com/Std-error-of-correlation-coefficients-tp2320609p2320609.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list