openpharma / mmrm

Mixed Models for Repeated Measures (MMRM) in R.
https://openpharma.github.io/mmrm/
Other
127 stars 22 forks source link

potentially improve warning/error messages #393

Open clarkliming opened 9 months ago

clarkliming commented 9 months ago

related to #387 but still a little different

in some scenarios the variance estimate is 0 if the values match so well to the fixed effect, leading to a incorrect hessian/gradient

see the following example

fit <- mmrm(FEV1 ~ RACE + SEX + ar1(AVISIT | USUBJID), data = fev_data)

fev_data$FEV1[!is.na(fev_data$FEV1)] <- fitted(fit)

mmrm(FEV1 ~ RACE + SEX + ar1(AVISIT | USUBJID), data = fev_data)

we might improve this error messages to be clearer