问题描述
我目前正在处理多级数据。因此,我决定使用函数statsBy
来计算相关性。计算了相关性,但R继续发送此错误消息“ statsBy函数的标准偏差为零”。
我已经查看了所有变量的SD,non为零。
有人知道这个错误可能来自哪里吗?
library(psych)
cormatrix1 <- statsBy(dat_all[c("a","b","c","d","e","neuroticism","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")],c(dat_all$ID),cors = TRUE,cor="cor",method="pearson",use="pairwise",poly=FALSE,na.rm=TRUE,alpha=.05,minlength=5)
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In cor(x[-gr],use = use,method = method) : the standard deviation is zero
2: In cor(x[-gr],method = method) : the standard deviation is zero
...
50: In cor(x[-gr],method = method) : the standard deviation is zero
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)