How to compute P-value and standard error from correlation analysis of R's cor()

后端 未结 2 2130
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 11:04

I have data that contain 54 samples for each condition (x and y). I have computed the correlation the following way:

> dat <- read.table(\"http://dpaste.co         


        
2条回答
  •  旧时难觅i
    2021-02-13 12:06

    Can't you simply take the test statistic from the return value? Of course the test statistic is the estimate/se so you can calc se from just dividing the estimate by the tstat:

    Using mydf in the answer above:

    r = cor.test(mydf$X, mydf$Y)
    tstat = r$statistic
    estimate = r$estimate
    estimate; tstat
    
           cor 
    -0.8492663 
            t 
    -5.086732 
    

提交回复
热议问题