0
$\begingroup$

I'm currently struggling to find a appropriate method to analyze my experiment.

Currently, I have 4 groups of subjects, and each subjects made a choice between 3 options(A or B or No choice). Below table shows a portion of my data.

Group Choice
1 A
2 A
2 B
4 A
3 No choice
1 A
2 A

My hypothesis is that, being in group 4 makes subjects shift choice from B to A. But I'm confused because there's 4 groups on a single category of independent variable and they're not ordinal.

Will it be right to shift my data as below..

Group1 Group2 Group3 Group4 Choice
O X X X A
X O X X A
X O X X B
X X X O A
X X O X No choice
O X X X A
X X X X A

..and use (multinomial) logistic regression to predict choice (A or B or Nochoice) from group number? I am thinking of seeing the effect of "being on group4" on increase of number of A choices in baseline of reference to choice B.

$\endgroup$
9
  • $\begingroup$ Do you need all 4 binary variables to encode 1 of 4 groups? Can it lead to any problems? $\endgroup$ Commented May 10, 2022 at 6:38
  • $\begingroup$ I have the same question. I'm not sure if such approach would be correct. It would be great if there's a way to use single variable to encode all 4 groups. $\endgroup$
    – Roas Clack
    Commented May 10, 2022 at 8:44
  • $\begingroup$ And I also wanted to show that group 1,2,3 all does not show such effect observed from group 4. $\endgroup$
    – Roas Clack
    Commented May 10, 2022 at 8:54
  • 2
    $\begingroup$ I suggest you search for and read about one-hot encoding. The issue you are concerned about is commonly discussed, and there is nothing special in your problem. "It would be great if there's a way to use single variable to encode all 4 groups" - why would it be great? On the contrary, you wrote that group number is not ordinal, so encoding it with a single scalar is inappropriate. If you want, you can always regard several scalars (binary or continuous) as a single vector variable, which takes values within a certain range. $\endgroup$ Commented May 10, 2022 at 14:46
  • 1
    $\begingroup$ @RoasClack Multinomial logistic regression had a categorical, not continuous, $y$ variable, but it seems like dropping a category solved your problem. Perhaps you could post a self-answer to “close out” this question. $\endgroup$
    – Dave
    Commented May 11, 2022 at 0:52

1 Answer 1

0
$\begingroup$

Thanks to comments, I found out that making "Group" variable to 4 dummy variables (as in the question) was called "one-hot encoding", and I could make a multinomial logistic model using these dummy variables to predict choice.

  • Group 1 + Group 2 + Group 3 + Group 4 ---(predict)---> Choice

However, I noticed that using "one-hot encoding" method as above could cause Dummy Variable Trap leading to multicollinearity problem . And it could be handled by dropping one of the dummy variables. For example, I can drop Group 1.

  • Group 2 + Group 3 + Group 4 ---(predict)---> Choice

Please correct me if I got this wrong.

$\endgroup$
2
  • 2
    $\begingroup$ I'd call software good statistical software if it handles redundancy of dummy (indicator) predictors for you. You shouldn't need to do it for yourself. That view is consistent with the idea that you should also be able to choose which indicator to omit. $\endgroup$
    – Nick Cox
    Commented May 11, 2022 at 10:29
  • $\begingroup$ Thanks for the comment. I manged to use R for one-hot encoding. $\endgroup$
    – Roas Clack
    Commented May 12, 2022 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.