Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些数据,我在 lavaan 中安装了模型
fit <- sem(model, full_data)
摘要 ( summary(fit)) 显示了使用的求解器(优化方法和估计器),但我不知道如何提取该信息并将其存储到变量中;我只能设法将其打印为摘要的一部分。如何访问这两个值并将它们存储在变量中?
summary(fit)
任何帮助表示赞赏。
如果您运行str(fit),您可以看到fit保存在对象中的结构和所有信息。在 lavaan 有很多信息,所以不太容易找到,但在你的情况下,你可以在 中找到你的信息Options,所以
str(fit)
fit
Options
fit@Options$optim.method fit@Options$estimator
应该给你你需要的信息,你可以将它们存储在一个变量中。