Can I simulate different scenarios for different covariates? #966
-
|
As the title shown, I want to simulate different covariates in different scenarios. I remember there is a code to simulate covariates and I also need to do weight-based simulation. I would like to know if I can add nSud=10,20,30 in different covariates in below code or only to add nSud in "sim" function? Look forward to your reply. set.seed(42) Simulate Weight based on age and genderAGE<-round(runif(nsub,min=18,max=70)) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
|
I think what you would need to do is create a different set of parameters/covariates for each scenario. There are subtilties in how you would do this depending on whether you're using post hoc estimates or subjects generated from IIV terms. What I've done in the past is say generate 1000 subjects using IIV and then append the covariates to those generated subjects using, for example the random values you have above (do this for each scenario). I think you can then send these 1000 subjects into rxSolve and specify nSub =100 and nStud=10. I believe it will then do 10 studies where it samples 100 subjects from the original 1000 each time (again for each scenario). @mattfidler please correct me if I'm wrong here. |
Beta Was this translation helpful? Give feedback.
I think what you would need to do is create a different set of parameters/covariates for each scenario. There are subtilties in how you would do this depending on whether you're using post hoc estimates or subjects generated from IIV terms. What I've done in the past is say generate 1000 subjects using IIV and then append the covariates to those generated subjects using, for example the random values you have above (do this for each scenario). I think you can then send these 1000 subjects into rxSolve and specify nSub =100 and nStud=10. I believe it will then do 10 studies where it samples 100 subjects from the original 1000 each time (again for each scenario).
@mattfidler please correct …