【发布时间】:2021-03-25 08:04:55
【问题描述】:
我有一个公式对象列表,可以用lqmm::lqmm() 拟合线性分位数混合模型。
我不能使用summary() 从生成的模型中返回具有标准误差等的模型系数。
d <- structure(list(DID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), pain = c(4L, 2L, 6L, 3L, 3L,
4L, 3L, 3L, 4L, 5L, 4L, 4L, 5L, 3L, 4L, 3L, 2L, 6L, 5L, 7L, 6L,
3L, 5L, 1L, 5L, 3L, 4L, 4L, 6L, 5L, 5L, 6L, 5L, 6L, 5L, 6L, 6L,
5L, 6L, 7L, 4L, 5L, 6L, 6L, 5L, 6L, 4L, 5L, 6L, 7L), wound = c(4L,
3L, 3L, 3L, 4L, 5L, 4L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 4L, 3L,
4L, 4L, 3L, 3L, 3L, 4L, 3L, 3L, 4L, 5L, 3L, 8L, 7L, 7L, 7L, 7L,
9L, 8L, 8L, 8L, 6L, 7L, 6L, 8L, 7L, 6L, 8L, 7L, 6L, 7L, 8L, 7L,
7L), mobility = c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
3L, 3L, 2L, 1L, 1L, 2L, 2L, 3L, 2L, 3L, 1L, 2L, 2L, 3L, 2L, 3L,
3L, 6L, 5L, 6L, 6L, 5L, 6L, 5L, 5L, 5L, 5L, 6L, 5L, 6L, 5L, 5L,
5L, 6L, 5L, 5L, 3L, 5L, 6L)), row.names = c(NA, 50L), class = "data.frame")
library(lqmm)
x <- as.formula("pain ~ wound + mobility")
m1 <- lqmm(x,
random = ~ 1,
group = DID,
data = d)
summary(m1)
错误:“符号”类型的对象不是子集
我尝试按照here 的建议使用eval(x),但出现递归错误。
m2 <- lqmm(eval(x),
random = ~ 1,
group = DID,
data = d)
summary(m2)
错误:求值嵌套太深:无限递归/选项(表达式=)? 总结期间出错:评估嵌套太深:无限递归/选项(表达式=)? 错误:没有更多可用的错误处理程序(递归错误?);调用“中止”重启
关于如何提取模型参数的任何想法?
完整的样本数据取自here。
【问题讨论】:
标签: r summary mixed-models