【发布时间】:2015-06-15 09:01:11
【问题描述】:
我在 R 中使用 glmer() 运行 GLMM:
glmer(survive ~ fyear + site + fyear * site.x + (1|fyear),
family = binomial(link = logexp(shaffer.sub$exposure)),
data = shaffer.sub)
根据巢是否成功,生存是 0 或 1。 Here你可以看到数据是什么样子的:
structure(list(id = structure(1:7, .Label = c("1", "2", "3",
"4", "5", "6", "7"), class = "factor"), year.x = structure(c(1L,
1L, 2L, 3L, 3L, 3L, 3L), .Label = c("1994", "1995", "1999"), class = "factor"),
survive = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 1L), .Label = c("0",
"1"), class = "factor"), fyear = structure(c(1L, 1L, 2L,
3L, 3L, 3L, 3L), .Label = c("1994", "1995", "1999"), class = "factor"),
site.x = structure(c(1L, 2L, 1L, 1L, 1L, 2L, 1L), .Label = c("N",
"S"), class = "factor")), .Names = c("id", "year.x", "survive",
"fyear", "site.x"), row.names = c(NA, -7L), class = "data.frame")
但我收到此警告消息:
*Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.0299425 (tol = 0.001, component 12)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?*
有人告诉我,我不应该在同一模型上使用相同的随机因子作为固定效应。
最后,我想要一个可以看到年份、站点和交互年份的输出:站点效果。就像在 ANOVA 表中一样(这可能吗?我一直在尝试使用 summary(aov(model)) 但这不起作用;anova(model) 也不行。
aov() 命令出现此错误:
*Error in summary`(aov(syearXsite))` :
error in evaluating the argument 'object' in selecting a method for function 'summary': Error in if (fixed.only) { : argument is not interpretable as logical*
如何查看这些变量对生存的影响?
【问题讨论】:
-
感谢 alexforrence!
标签: r anova mixed-models