tmatta / lsasim

Simulate large scale assessment data
6 stars 5 forks source link

`cluster_gen()` fails if both `cat_prop` and `rho` are set #51

Open wleoncio opened 1 week ago

wleoncio commented 1 week ago

MRE

cluster_gen(n = c(5, 2), n_X = 2, n_W = 2, cat_prop = list(c(0.5, 1), c(0.5, 1))) # OK
cluster_gen(n = c(5, 2), n_X = 2, n_W = 2, cat_prop = list(c(0.5, 1), c(0.5, 1)), rho = 0.5) # Fails 

Fixing this might be as simple as adding an else statement here, but the issue should be investigated further for side effects.

wleoncio commented 1 week ago

Hi @mollyolaf,

Please try the current development version of lsasim for a fix to this issue and let me know if the solution looks adequate:

remotes::install_github("tmatta/lsasim@develop")

As a minor improvement, version 9.1.5.9001 also improved the output of cluster_gen() so that something like "Total respondents: 10 + 10 + 10 + 10" is replaced with "10 * 4" (useful for large group numbers). :)