Hello.
I am trying to code one of my variables in a way that would allow me to include an interaction term. I have two variables: race and the proportion of the population for each specific race. For e.g. if I am white in the dataset, the proportion variable would be the % of white population in my area.
The race variable has four categories: white, black, asian, mixed The proportion measure was coded from continuous to categorical (<30% or >30%)
My problem is that for some race-prop combinations there are no observations. For the whites, the prop measure ranges from 33%-97%, for the blacks it ranges from 0%-30%. I am not sure how to recode the variable so that I have some observations in each category, that way when I include the interaction in the model, I actually get an estimate for each group.
I have tried keeping the prop variable as continuous, but the plot produced using margins does not look quite right (I think because some race categories don’t have observations). I realise one way would be to combine race categories, but If I could avoid doing that I would rather keep the three distinct race categories separate.
I am trying to code one of my variables in a way that would allow me to include an interaction term. I have two variables: race and the proportion of the population for each specific race. For e.g. if I am white in the dataset, the proportion variable would be the % of white population in my area.
The race variable has four categories: white, black, asian, mixed The proportion measure was coded from continuous to categorical (<30% or >30%)
My problem is that for some race-prop combinations there are no observations. For the whites, the prop measure ranges from 33%-97%, for the blacks it ranges from 0%-30%. I am not sure how to recode the variable so that I have some observations in each category, that way when I include the interaction in the model, I actually get an estimate for each group.
I have tried keeping the prop variable as continuous, but the plot produced using margins does not look quite right (I think because some race categories don’t have observations). I realise one way would be to combine race categories, but If I could avoid doing that I would rather keep the three distinct race categories separate.
Comment