Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate profile combinations within a respondent #7

Closed
nickbombaij opened this issue May 2, 2023 · 3 comments
Closed

Duplicate profile combinations within a respondent #7

nickbombaij opened this issue May 2, 2023 · 3 comments

Comments

@nickbombaij
Copy link

First of all, thanks for the package; it has been very helpful.

In generating designs, I've encounted situations where the same profile combinations are shown within a respondent. This does not seem desirable, as the same respondent will see the exact same question twice (or even more frequently).

See some replicable code below. In this case, obsID 3 and 8 have exactly the same profile combinations. The same with obsID 7 and 10. These are all IDs within the same respondent (respID). Despite generating 12 profile combinations (i.e., questions), only 10 are actually unique.

profiles <- cbc_profiles(
a = c(0, 1),
b = c("Yes", "No"),
c = c("100%", "80%"),
d = c("day", "week")
)

set.seed(64)
design <- cbc_design(
profiles = profiles,
n_resp = 4,
n_alts = 2,
n_q = 12,
)

@jhelvy
Copy link
Owner

jhelvy commented May 2, 2023

Thanks for point out this issue - this looks like a bug for sure.

The remove_dups function only checks for duplicate alternatives by observation to ensure that no two same alternatives are shown in any one choice question. But it does not check for duplicate choice sets by individual, which it should. I'll have to add a correction to fix this.

@jhelvy
Copy link
Owner

jhelvy commented May 3, 2023

I just added some fixes for this issue on this branch. I shipped the fixes to CRAN as v0.3.0. I believe this should fix the issues.

@nickbombaij
Copy link
Author

Thanks a lot for the quick adjustment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants