我有以下长数据集(R数据帧称为“dat”)。它有大约10,000个1200名儿童的观察结果,每个儿童最多观察10次。这些观察结果是在儿童早期的不同时间点收集的儿童的体重,从出生到5岁。数据集中的年龄以天(变量= agedays)给出,重量以千克为单位,变量wtkg。
i
我想使用SITAR包来研究孩子的速度,节奏和大小,根据妊娠期3中过多的妊娠期体重增加(与妊娠期3中的体重增加不相比)(变量= GWG_T3_cat2)在肥胖母亲中= BMI_group)。
我尝试运行此链接中显示的模型:https://www.rdocumentation.org/packages/sitar/versions/1.0.9
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")
但是我收到了一个错误:
m1 <- sitar(x=agedays, y=wtkg, id=subjid, data=dat, df=2)
如果有人能帮助解决这个问题我真的很感激。