openpharma / mmrm

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

transformation in response is not allowed #400

Closed clarkliming closed 6 months ago

clarkliming commented 6 months ago

it is natural and allowed in other linear models that the transformation applied to response can work, e.g.

lm(log(FEV1) ~ ARMCD + FEV1_BL, data = fev_data)

however mmrm has some issues related to it

mmrm(log(FEV1) ~ ARMCD + FEV1_BL + ar1(AVISIT|USUBJID), data = fev_data)

works

however in the vignette of #396

mmrm(log(FEV1) ~ ARMCD + FEV1_BL + ar1(AVISIT|USUBJID), data = fev_data, start = emp_start)

do not work and gives error like

Error in fit_single_optimizer(tmb_data = tmb_data, formula_parts = formula_parts, : Assertion on 'all.vars(model_formula)' failed: Must be a subset of {'log(fev1)','trt','time','pts','(weights)'}, but has additional elements {'fev1'}.

in #396 we may break something and we should fix them

danielinteractive commented 6 months ago

Thanks @clarkliming , and just to be sure, this is really just within the PR #396 right? so technically not a bug on main?

clarkliming commented 6 months ago

yes this is not a issue on main, but a recent issue from emp_start

danielinteractive commented 6 months ago

cool. So generally I would say, in such cases no need to open a new issue on the repo - just comment on the PR conversation page and resolve there (because the PR is not merged yet, still ongoing work anyway)