pitakakariki / simr

Power Analysis of Generalised Linear Mixed Models by Simulation
70 stars 19 forks source link

simulated dataset #281

Closed JJ-Zhang-DS closed 5 months ago

JJ-Zhang-DS commented 5 months ago

Hi there,

I am wondering if I can output the simulated datasets after simulation. After simulation, is it possible to store the data somewhere or output them? I am asking because the power is always close to 100%, so we want to check the simulation dataset to figure out.

Thank you for supporting.

pitakakariki commented 5 months ago

powerSim and powerCurve don't store them, but you can use doSim to access a single simulation.

JJ-Zhang-Bayer commented 5 months ago

Thank you. Looks like doSim only outputs the values for response variable. Is there a way to get the predictor values simultaneously? The whole data frame. I appreciate your supporting.

pitakakariki commented 5 months ago

No, but the predictor values don't change so you can just use e.g. df$y <- doSim(model).

JJ-Zhang-Bayer commented 5 months ago

Yes, just realized that the predictors are fixed during simulation. thank you.