simglm icon indicating copy to clipboard operation
simglm copied to clipboard

Power simulations don't take specified correlations among predictors into account

Open DInfanger opened this issue 3 years ago • 1 comments

It would be great if replicate_simulation would take specified correlations among predictors (i.e. if the element correlate is present in sim_args) into account (maybe with an option?). I think this would only require a few new lines in simglm:

  if (!is.null(sim_args[["correlate"]])) {
    data <- correlate_variables(data, sim_args = sim_args)
  }

In any case, thanks a lot for the package!

DInfanger avatar Sep 13 '21 20:09 DInfanger

Thanks for submitting this. I had forgotten to add this to the simglm() master function for the replication. This functionality should be there, but I haven't tested yet.

I'm going to keep open until I add a unit test for this to verify its working properly.

lebebr01 avatar Sep 14 '21 15:09 lebebr01