我有一个这样的文件:
我正在使用此数据集来预测线性混合模型,并且我想使用该函数emmeans
来计算我的条件的估计均值。我正在使用的代码在这里:
newtab5 <- read.csv(file="sliding_LMM_test.csv", header=T, sep=",")
head(newtab5)
library(lmerTest)
model <- lmer(formula = data1 ~ flabel + (1 | whichFragments), data = newtab5, control=lmerControl(check.nlev.gtr.1 = "ignore"))
sfit <-summary(model)
sfit$coefficients[,2][2]
sfit$coefficients[,5][2]
library(emmeans)
means <- emmeans(model, "flabel")
test<-summary(means)
我有这个错误:
> Error in t(ZZ) %*% EE :Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90
当 which fragment 列具有相同的值时,该emmeans
函数似乎不起作用。
你知道有什么方法可以跳过这个或emmeans
为这种情况工作吗?
先感谢您