jhelvy / cbcTools

An R package with tools for designing choice based conjoint (cbc) survey experiments and conducting power analyses
https://jhelvy.github.io/cbcTools/
Other
5 stars 5 forks source link

Error when using restricted_profiles and method="Modfed" or "dopt" #34

Closed helels closed 6 months ago

helels commented 6 months ago

When I use method="Modfed" or method="dopt" in the example from the vignette with restricted_profiles I get an error:

design <- cbc_design(

  • profiles = restricted_profiles,
  • n_resp = 900, # Number of respondents
  • n_alts = 3, # Number of alternatives per question
  • n_q = 6, # Number of questions per respondent
  • method = "Modfed"
  • ) Error in check_inputs_design(profiles, n_resp, n_alts, n_q, n_blocks, : Restricted profile sets can only be used with the "random", "full" "dopt", or "Modfed" methods

Any hints what is wrong? Thank you

jhelvy commented 6 months ago

Thanks for noting this, this is a small bug in the inputs check. I just updated it, it should now work if you install the development version from Github with:

# install.packages("remotes")
remotes::install_github("jhelvy/cbcTools")

I'll fix a few other things and then will push this to CRAN.

helels commented 6 months ago

Thank you so much for this quick fix. Works perfect with both "dopt" and "Modfed". Best, Helmut