Rockchalk软件包中的警告消息

时间:2020-10-09 17:22:58

标签: r

当前,我在我的主计算机上(我仍然是r的初学者),并且遇到了一个我自己无法解决的错误。我运行了一个审核模型(out0),然后将其围绕0、10和20居中,并查看了它们的“简单斜率”。我想在r中使用RockChalk包做同样的事情。

out0 = lm(msq2$TA ~ EA * NegAff + PA, data = msq2)
range(msq2$NegAff) #0:28
plotOut1 <- plotSlopes(out0,
                       plotx      = "EA",
                       modx       = "NegAff",
                       modxVals   = seq(0, 20, 10), #we are centering from 0 to 20 in steps of 10
                       plotPoints = TRUE)

我用另一个数据集做了这个,效果很好。但是,我现在收到此消息警告:

Error in model.frame.default(myfmla, dataOrig, na.action = na.action) : 
  invalid type (list) for variable 'msq2'
In addition: Warning message:
Using formula(x) is deprecated when x is a character vector of length > 1.
  Consider formula(paste(x, collapse = " ")) instead. 

有人可以告诉我我在哪里犯错吗?我认为这是我制定modxVals的方式,但是我使用了不同的值,但这没用

1 个答案:

答案 0 :(得分:0)

感谢r2evans。只需删除msq2$即可回答问题!