我的数据集包括对 70 个人的治疗开始和结束时的数字分数(“参与”)的两次观察。个人之间的时间不是恒定的,但对这些时间的目视检查表明,在此期间大多数人都在上升
sfa <- read.csv("SFAFinalData.csv", header = TRUE)
groupingFormula <- as.formula(paste(columnName,"~ TIME|ID"))
dataSubset <- na.omit(sfa[,seq(1:6)])
inputData <- groupedData(groupingFormula, data=dataSubset, labels = list("Weeks post injury", columnName))
m1 <- lme(inputData)
按预期工作
> m1
Linear mixed-effects model fit by REML
Data: inputData
Log-restricted-likelihood: -631.7963
Fixed: Participation ~ TIME
(Intercept) TIME
18.7616485 0.4220891
Random effects:
Formula: ~TIME | ID
Structure: General positive-definite
StdDev Corr
(Intercept) 15.4985010 (Intr)
TIME 0.2192035 1
Residual 13.2272350
Number of Observations: 140
Number of Groups: 70
我现在正在尝试比较三个子组中每个子组的分析(即参与作为时间的函数)(“类型”:具有三个级别的因子,分别为 10、29 和 31 个人)但是
m2 <- update(m1, fixed = .~.*TYPE)
导致错误
Warning message:
In lme.formula(fixed = Participation ~ TYPE, data = inputData) :
Fewer observations than random effects in all level 1 groups
努力看看我在这里做错了什么:据我所知,我有足够的观察结果?