Skip to main content
added 28 characters in body
Source Link
kjetil b halvorsen
  • 85.6k
  • 32
  • 216
  • 694
m1 <- lmer(stigma ~ is_homeless + is_black + condition + (1 | subject), d=data)) 
m1 <- lmer(stigma ~ is_homeless + is_black + condition + (1 | subject), d=data)) 
m1 <- lmer(stigma ~ is_homeless + is_black + condition + (1 | subject), d=data)) 
m1 <- lmer(stigma ~ is_homeless + is_black + condition + (1 | subject), d=data)) 
Source Link
Erik Ruzek
  • 7k
  • 1
  • 14
  • 22

The question of how to model this data is an important one, but before doing so, I want to show how the structure of the data can provide clues about the true design your study implies. Note that I assume you have only two ethnicities (black/non-black). To start, I will reiterate that the two conditions you showed are indeed between-subjects factors. I will encode these as follows:

Cond == 0 -- homeless-black / homed-white

Cond == 1 -- homeless-white / homed-black

You then have indicators for whether the target is homeless (is_homeless), whether the target is black (is_black), an interaction of these two (homeless_by_black), the subject identifier (subject), and the outcome (stigma). This is how I would set up your data:

subject is_homeless is_black homeless_by_black condition stigma
1 1 1 1 0 4.3
1 0 0 0 0 4.8
2 1 0 0 1 3.5
2 1 0 0 1 3.2

Some things that stick out:

  • As you said, each participant only sees targets that correspond to the condition they were assigned to, which means that no subject sees all conditions.

  • The interaction term only "turns on" for those in condition==0.

    • Accordingly, the interaction is confounded with condition. You could include the interaction term in the model, but it is only giving you the contrast of interest for those in condition==0. It will use information from those in condition==1 but they all have a value of 0 and they never saw a homeless-black target. Not very useful, unfortunately.
  • Each subject receives both a black and a non-black target and a homed and homeless target for rating.

    • These can be considered within-subjects (sometimes called "main effects") factors.

To model this, I would lean toward a minimal model. Depending on a lot of factors (sample size, variability of the outcome, true between subjects variation in the association of interest, etc.), a maximal model is often overkill and doesn't necessarily do what its proponents claim. You can explore it, but know that you are likely run into estimation problems due to overfitting and you will have to pare down the random effect structure. I would run the following model:

m1 <- lmer(stigma ~ is_homeless + is_black + condition + (1 | subject), d=data)) 

This gives you mean differences in the within-subjects factors of homed/homeless, black/non-black, and the between-subjects factor of condition. The latter, as shown above, is giving you some (minimal) information about the interaction but you cannot conclude that any mean differences are solely due to this. You and others may choose to model the interaction, but I personally think it is not meaningful because it isn't a test of what you really want. Specifically, in the current design, it is not a true within-person comparison of whether viewing a homeless black target is associated with more or less stigma compared to other groups.