simulate trajectories based on individual-level estimates #608
xiaoyang-mindstrong
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
Try |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
(Disclaimer: I am new to the nlmixr package and have some experience in using nlme and lmer to build multilevel models.)
Goal:
I am trying to simulate trajectories based on individual-level estimates, and I haven't found a ready-to-use function from the package yet. So in order to use the "nlmixrSim" function which takes the sample-level estimates, I was manipulating the model fit object in a way that pretends the individual estimates as the sample-level estimates.
Barrier:
The model fit object does not allow me to change the sample-level estimates. The code is as follows:
model_fit_obj$coefficients$fixed <- individual_coeff
the error I got as follows:
Error:
! Assigned data
<named list>
must be compatible with existing data.x Existing data has 1843 rows.
x Assigned data has 2 rows.
ℹ Only vectors of size 1 are recycled.
Backtrace:
$<-
(*tmp*
, coefficients, value =<named list>
)<fn>
(<vctrs___>
)Question:
Why does the error tell me the existing data (which is the fixed effects of the model object) have 1843 rows (which is the number of all observations for all subjects), while the fixed effects should have only 6 coefficients? Is there a way I can fix this error?
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions