[拟合lme4
模型后,我想知道如何从terms(fit)[[3]]
中获得预测变量的类?
这是一个简单的示例,但我赞赏lme4
中任何其他模型的功能性回答。
library(lme4)
h <- read.csv('https://raw.githubusercontent.com/hkil/m/master/h.csv')
h$year <- as.factor(h$year)
m <- lmer(scale~ year*group + (1|stid), data = h)
terms(m)[[3]] ## What are the `class`es of the variables in here (e.g., `integer`, `factor` etc.)