【问题标题】:robumeta arguments imply differing number of rowsrobumeta 参数暗示不同的行数
【发布时间】:2019-02-13 19:02:27
【问题描述】:

我正在尝试使用 robumeta,但一直遇到错误。 我对 8 个变量使用了 113 个观察结果:

EM <- read.csv(file="SchoolMotivationRisk.csv", header=TRUE,sep=",")

八个变量是:studynum yi var.effect.size sei aget1 aget2 permale sexmix。

执行 str(EM) 会产生 'data.frame': 113 obs。 8 个变量。

问题是我什么时候去适合:

res<-robu(formula = yi ~ 1, var.effect.size = var.effect.size, studynum = studynum, modelweights = "CORR", rho= 0.8, small=TRUE, data=EM)

我收到以下错误:

Error in data.frame(effect.size = mf[, 1], stats::model.matrix(formula,  : arguments imply differing number of rows: 113, 0

有没有办法解决这个问题?

此外,dput(EM) 的输出位于 https://pastebin.com/vmMwy1u4

【问题讨论】:

  • 请展示一个可重现的小例子(带有dput)来显示错误
  • 当然,如果我这样做:dput EM 我会得到这个:pastebin.com/vmMwy1u4
  • 感谢您的意见。问题在于var.eff.size
  • 我收到此错误,但使用的是 var.eff.size。我的样本中的 obs 数量很少,也许这就是问题所在?

标签: r meta


【解决方案1】:

参数是var.eff.size而不是var.effect.size

library(robumeta)
robu(formula = yi ~ 1, var.eff.size = var.effect.size, 
   studynum = studynum, modelweights = "CORR", rho= 0.8, small=TRUE, data=EM)
#RVE: Correlated Effects Model with Small-Sample Corrections 

#Model: yi ~ 1 

#Number of studies = 17 
#Number of outcomes = 113 (min = 2 , mean = 6.65 , median = 7 , max = 12 )
#Rho = 0.8 
#I.sq = 57.54005 
#Tau.sq = 0.004609755 

#               Estimate StdErr t-value dfs   P(|t|>) 95% CI.L 95% CI.U Sig
#1 X.Intercept.    0.113 0.0184    6.12  14 0.0000263   0.0733    0.152 ***
#---
#Signif. codes: < .01 *** < .05 ** < .10 *
#---
#Note: If df < 4, do not trust the results

【讨论】:

  • ...哦。我搞砸了。谢谢!
猜你喜欢
  • 2015-12-08
  • 1970-01-01
  • 2021-01-01
  • 2018-07-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多