0

I have the following long dataset (R dataframe called "dat"). It has around 10,000 observations of 1200 children, with a maximum of 10 observations per child. These observations are weight of the child collected at different time points in early childhood, starting from birth until age 5 years. Age in the dataset is given in days (variable = agedays) and weight in kilograms in variable wtkg.

Dataset

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") 

I want to use the SITAR package to study the velocity, tempo and size of the children according to excessive gestational weight gain in trimester 3 (versus not excessive weight gain in trimester 3 ) (variable = GWG_T3_cat2) among obese mothers (variable = BMI_group).

I tried running a model as seen in this link: https://www.rdocumentation.org/packages/sitar/versions/1.0.9

m1 <- sitar(x=agedays, y=wtkg, id=subjid, data=dat, df=2)

But I get an error:

Error in nlme.formula(y ~ fitnlme(x, s1, s2, a, b, c), fixed = s1 + s2 +: 
Singularity in backsolve at level 0, block 1

I would really appreciate if any one could help solve this issue.

0 Answers0