Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSame factor levels in different attributes #13
Comments
leeper
added
the
bug
label
Feb 5, 2019
This comment has been minimized.
This comment has been minimized.
Thanks - this has been on the back of mind for a while, so glad you brought it up. The hacky solution is to change the factor levels to something like "Feature: Level" rather than "Level" but this should be fixed so you don't have to do that! |
This comment has been minimized.
This comment has been minimized.
m-jankowski
commented
Feb 14, 2019
This is also a problem when using mm_diffs(). In my case, I wanted to conduct a subgroup analysis conditional on the gender of the respondents (labeled as "Male" or "Female"). The conjoint experiment, however, also contained levels with these labels ("Male" and "Female"). Particularly problematic is that mm_diffs() did not throw an error message, but returned wrong estimates without any warnings. Here is an artificial example using the immigration data: Datadata("immigration") Create subgroupsimmigration$ethnosplit <- cut(immigration$ethnocentrism, 2) Rename subgroup levelsimmigration$subgroup <- as.factor(ifelse(as.numeric(immigration$ethnosplit) == 1, Estimate correct MMs by subgroupmm_correct <- cj(na.omit(immigration), plot(mm_correct, Differences between subgroupsmmdiff_correct <- mm_diffs(na.omit(immigration), plot(mmdiff_correct) Using subgroups with identical level names returns wrong estimatesmmdiff_problem <- mm_diffs(na.omit(immigration), plot(mmdiff_problem) |
leeper
added
the
help wanted
label
Feb 16, 2019
leeper
referenced this issue
Mar 15, 2019
Open
Subgroup analysis on a factor with levels identical to feature levels produces wrong estimates #22
This comment has been minimized.
This comment has been minimized.
Okay, that's definitely bad but actually a separate issue. @m-jankowski I'm going to move your comment to a new issue to keep track of things: #22 The issue here remains simply that things get wonky when multiple features have the same factor levels. |
chriswratil commentedFeb 5, 2019
Hi Thomas,
I encountered a small problem with cj(): in case you have two levels across any attributes that have the same name, cj() will not work. While there are tweaks around this (of course), it is not very convenient. In my example, we simply have a candidate experiment in which the attributes are priorities and the attribute levels are whether the candidates have or not have these priorities. Hence, the attribute levels are "Is a priority" vs. "Is not a priority" and this is repeated for several attributes.
Could potentially be fixed.
Thanks so much for providing this great package!
Chris