I'm currently coding studies for my meta-analysis and I was wondering how I should code the interaction between a categorical variable (1 = private, 2 = public, 3 = misc [both]) and a continuous variable (individualism score from 1-100)

I coded them out of necessity with e.g. 1_91 (private x individualism score of 91 for the United States), but for the analyses I need a different way to code it.

The interaction serves in the end as a moderator and I want to use r Studio for further analyses.

Thank you so much!

  • $\begingroup$ Depending on the package you will use, you can employ different coding approaches. In the case you need to enter the products of X1 (your continuous variable) and X2, X3, and X4 (dummy variables standing, respectively, for private vs public or misc, public vs public or misc, misc vs private or public). Eventually you will have all these variables tested (probably iteratively). $\endgroup$ – Joe_74 Dec 27 '18 at 16:49
  • 1
    $\begingroup$ Thank you very much for responding so fast, you helped me a lot! So in the end I could implement three columns for the interaction. For let's say 91 (X1) and private (X2) I could write 91 in the first column, 0 in the second, 0 in the third? $\endgroup$ – Ali Dec 27 '18 at 17:01
  • $\begingroup$ Yes, but code for the second column 1 vs 2, rather than 0 vs 1... also create additional second columns for the various categorization of the categorical variables. $\endgroup$ – Joe_74 Dec 28 '18 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.