简体   繁体   English

R rmcorr 不正确的自由度数

[英]R rmcorr incorrect degrees of freedom number

When I analyse raz2005 data from mrcorr package for repeated measures correlation with the following code:当我分析来自mrcorr包的raz2005数据以与以下代码相关联时:

brainvolage.rmc <- rmcorr (participant = Participant, measure1 = Age, measure2 = Volume, dataset = raz2005)

as given in the paper https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5383908/pdf/fpsyg-08-00456.pdf , I get df=71, which is correct since the number of participants is 72 in this data.正如论文https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5383908/pdf/fpsyg-08-00456.pdf 中给出的,我得到 df=71,这是正确的,因为参与者的数量是该数据为 72。

However, when I use the same code for my data, which is structured exactly like raz2005 , I get df=more than 400, although my participant number is 25. I use:然而,当我对我的数据使用相同的代码时,它的结构与raz2005完全一样,我得到 df=more than 400,虽然我的参与者人数是 25。我使用:

mydata.rmc <- rmcorr (participant = participant, measure1 = measure1, measure2 = measure2, dataset = mydata)

From the paper (page 7), the degrees of freedom should be calculated like this:从论文(第 7 页)中,自由度应该这样计算:

N = n_distinct(raz2005$participant)
k = nrow(raz2005)/N
df = N*(k-1)-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM