简体   繁体   中英

R rmcorr incorrect degrees of freedom number

When I analyse raz2005 data from mrcorr package for repeated measures correlation with the following code:

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.

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:

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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