首页 > 解决方案 > R 包“RSA”中的 Probit - 未识别?

问题描述

我在 R 中运行了一些响应面分析。我以前从未运行过这些二元结果;但是,根据“RSA”的包信息:响应变量必须定义为“有序”,并且 lavaan 估计器更改为“WLSMV”。没问题。

sui <- RSA(current ~ x1*x2, data = invar, ordered = "current", center = "pooled", missing = "listwise", control.variables = c("x3", "x4"), center.control.variables = T, estimator = "WLSMV")

但是,无论我做什么,我都会收到模型未识别的错误。我试过在有和没有控制变量的情况下运行它,改变估计器,改变我使用“有序”(例如,“有序=T”)的方式,没有骰子。我试过重新安装lavaan,并切换出结果变量。我什至尝试过运行它,就好像结果变量是连续的一样,而且效果很好——这似乎是关于尝试运行概率的事情。

Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
2: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not invert information matrix needed for robust test statistic

我也收到此错误:

Error in names(R2.p) <- "R2.p" : 
  'names' attribute [1] must be the same length as the vector [0]

如果我使用“ordered = names(current)”或“ordered = names(invar)”来尝试规避这一点,模型实际上会运行,我可以查看测试统计信息。然而,如果我调用summary() 或plot(),我会得到这个可爱的信息:

Error in names(SE) <- c("x", "y", "x2", "xy", "y2") : 
  attempt to set an attribute on NULL

标签: r

解决方案


推荐阅读