如果(nchar(text.matrix[r,c])> max.length[real. c]){:missing value where TRUE/numbered needed',我应该如何修复'错误'

yvgpqqbh  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(47)

我尝试使用Stargazer在Rstudio中打印一个组合lm的表,我一直收到这样的消息:
if(nchar(text.matrix[r,c])> max.length[real. c]){:在需要TRUE/NULL的地方缺少值时出错
这是我使用的代码:

stargazer(model1.1, model1.2, model1.3, model1.4, model1.5, model1.6,
          title = "The association between talent development and further education",
          dep.var.labels = "Whether to participate in talent development",
          covariate.labels = c("B4.1", "C2_score", "C1_score"),
          type = "html",
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "學才藝與升學.html")``` 

It appears 'Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE/FALSE needed' .

How should I correct it?

字符串

wmomyfyw

wmomyfyw1#

当模型对象“model1.1”中使用的因变量太长时,就会发生这种情况。
如果您禁止显示因变量标签,则将创建stargazer表。
这可以通过添加

dep.var.labels.include = FALSE,

字符串
到观星者的选择
由于可能需要某种标签,我的临时解决方案是添加一个因变量“caption”而不是“label”,如下所示:

dep.var.caption="Dep. Vars: (1) (2) Turnout 02-10, (3) (4) Vote Margins 12, (5) (6) Close Elections 12",

相关问题