我有以下长数据集(称为“dat”的 R 数据框)。它对 1200 名儿童进行了大约 10,000 次观察,每个儿童最多进行 10 次观察。这些观察结果是在儿童早期的不同时间点收集的儿童体重,从出生到 5 岁。数据集中的年龄以天数(变量 = agedays)为单位,体重以公斤为单位,以变量 wtkg 给出。
structure(list(subjid = c(1001L, 1001L, 1001L, 1001L), sex = structure(c(2L, 2L, 2L, 2L), .Label = c("Female", "Male"), class = "factor"),
agedays = c(0L, 2L, 30L, 107L), wtkg = c(3.78, 3.64, 4.71,
6.5), Uobservations = c(10L, 10L, 10L, 10L), BMI_group = structure(c(2L,
2L, 2L, 2L), .Label = c("normal", "obese", "overweight",
"true_NA", "underweight"), class = "factor"), GWG_T3_cat2 = structure(c(2L,
2L, 2L, 2L), .Label = c("T3notexcessive", "T3excessive"), class = "factor")), .Names = c("subjid", "sex", "agedays", "wtkg", "Uobservations", "BMI_group", "GWG_T3_cat2"), row.names = c(NA, 4L), class = "data.frame")
我想使用 SITAR 包根据肥胖母亲(变量 = BMI_group)在妊娠 3 期过度的妊娠期体重增加(而不是在妊娠期 3 期过度增加体重)(变量 = GWG_T3_cat2)来研究孩子的速度、节奏和大小.
我尝试运行此链接中看到的模型:https ://www.rdocumentation.org/packages/sitar/versions/1.0.9
m1 <- sitar(x=agedays, y=wtkg, id=subjid, data=dat, df=2)
但我收到一个错误:
Error in nlme.formula(y ~ fitnlme(x, s1, s2, a, b, c), fixed = s1 + s2 +:
Singularity in backsolve at level 0, block 1
如果有人可以帮助解决这个问题,我将不胜感激。