微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用mixedCor (psych, R) 获取相关矩阵时出错

如何解决使用mixedCor (psych, R) 获取相关矩阵时出错

我正在尝试使用 R 中 psych 包中的 mixCor 来获取一组连续(1:8)和多项式(9:41)变量的相关矩阵。为了做到这一点,我创建了一个 . csv,在第一行中包含我的变量名称,在其余行中包含我们研究中每个参与者(大约 350 个)的这些变量的值。但是,在使用该函数时,出现以下错误

r <- mixedCor(df,c=1:8,p=9:41)


Error in `rownames<-`(`*tmP*`,value = colnames(x)) : 
  attempt to set 'rownames' on an object with no dimensions
Además: Warning messages:
1: In polychoric(data[,p],smooth = smooth,global = global,weight = weight,:
  The items do not have an equal number of response alternatives,global set to FALSE.
2: In mclapply(seq_len(n),do_one,mc.preschedule = mc.preschedule,:
  all scheduled cores encountered errors in user code
3: In matpLower(x,nvar,gminx,gmaxx,gminy,gmaxy) :
  Something is wrong in polycor 
4: In cor.smooth(mat) :
  I am sorry,there is something serIoUsly wrong with the correlation matrix,cor.smooth Failed to  smooth it because some of the eigen values are NA.  
Are you sure you specified the data correctly?

我使用的是 R 版本 3.6.3 (2020-02-29) 并且在使用 mixCor 之前的先前步骤是:

library(psych)
library(psychTools)
mydata <- read.csv ("/myroot/mydata.csv")
df <- data.frame (mydata)

我该如何解决这个问题?

感谢您的时间,

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。