hengshiyu / cvcrand

An R package for covariate-constrained randomization and clustered permutation test for cluster randomized trials
https://cran.r-project.org/web/packages/cvcrand/index.html
MIT License
0 stars 1 forks source link

Option to turn off random number seed setting? #1

Open bdwilliamson opened 1 year ago

bdwilliamson commented 1 year ago

Thanks for writing such a great package! I've used it to perform constrained randomization for several trials and it works very well.

I'm now using your package in some simulations, and was thrown off by the package hard-setting a seed (using set.seed) within cvrall (the same is true in cvrcov). When I'm doing computations with further random number generation downstream of randomization, I'd like to not have a seed set. Is it possible to add an argument to cvrall and cvrcov that turns off seed-setting? Or to remove seed-setting from the functions entirely? (which would rely on the user setting their own seed outside the function)

Thanks!

hengshiyu commented 1 year ago

Thanks for writing such a great package! I've used it to perform constrained randomization for several trials and it works very well.

I'm now using your package in some simulations, and was thrown off by the package hard-setting a seed (using set.seed) within cvrall (the same is true in cvrcov). When I'm doing computations with further random number generation downstream of randomization, I'd like to not have a seed set. Is it possible to add an argument to cvrall and cvrcov that turns off seed-setting? Or to remove seed-setting from the functions entirely? (which would rely on the user setting their own seed outside the function)

Thanks!

Hi, thanks for using the package and we are glad that the package is useful for your trials. The current functions for cvrall and cvrcov both only use seed as an optional input. That is to say, you do not need to specify a seed for the two functions to run and can ignore the seed option. You can either:

  1. choose a seed number ({number}) outside the function and use the seed number as an input by specifying seed = {number}
  2. choose to not set a seed for the functions and do not specify the functional option of seed = {number}

Hope this helps your usage.