Hello,
I created an interaction term of two binary variables and added it to the model, using two different ways.
1. logit freq_move i.ace1_2 NbhdSupp_2021_d ace1_2#NbhdSupp_2021_d, nolog
I used "#" to create the interaction term.
The results are below:
It seems the values "1" are omitted. So, I tried to create the interaction term manually like this: gen interaction2 = ace1_2 * NbhdSupp_2021_d
2. logit freq_move i.ace1_2 NbhdSupp_2021_d interaction2, nolog
Here are the results:
The sign of the interaction term is changed from negative to positive.
I think it is because the number of value "1" is small. (3.49%)
In this case, how I interpret this result? Should I use a positive coefficient?
Thanks!
I created an interaction term of two binary variables and added it to the model, using two different ways.
1. logit freq_move i.ace1_2 NbhdSupp_2021_d ace1_2#NbhdSupp_2021_d, nolog
I used "#" to create the interaction term.
The results are below:
freq_move | Coefficient | Std. err. | z | P>z | [95% conf. | interval] |
1.ace1_2 | 1.037921 | .0342157 | 30.33 | 0.000 | .970859 | 1.104982 |
NbhdSupp_2021_d | -.2266996 | .051156 | -4.43 | 0.000 | -.3269636 | -.1264357 |
ace1_2#NbhdSupp_2021_d | ||||||
0 1 | -.0978577 | .056232 | -1.74 | 0.082 | -.2080703 | .0123549 |
1 1 | 0 | (omitted) | ||||
_cons | -1.941679 | .01769 | -109.76 | 0.000 | -1.976351 | -1.907007 |
It seems the values "1" are omitted. So, I tried to create the interaction term manually like this: gen interaction2 = ace1_2 * NbhdSupp_2021_d
2. logit freq_move i.ace1_2 NbhdSupp_2021_d interaction2, nolog
Here are the results:
freq_move | Coefficient | Std. err. | z | P>z | [95% conf. | interval] |
1.ace1_2 | 1.037921 | .0342157 | 30.33 | 0.000 | .970859 | 1.104982 |
NbhdSupp_2021_d | -.3245573 | .0233473 | -13.90 | 0.000 | -.3703172 | -.2787974 |
interaction2 | .0978577 | .056232 | 1.74 | 0.082 | -.0123549 | .2080703 |
_cons | -1.941679 | .01769 | -109.76 | 0.000 | -1.976351 | -1.907007 |
I think it is because the number of value "1" is small. (3.49%)
interaction | |||
2 | Freq. | Percent | Cum. |
0 | 86,978 | 96.51 | 96.51 |
1 | 3,147 | 3.49 | 100.00 |
Total | 90,125 | 100.00 |
In this case, how I interpret this result? Should I use a positive coefficient?
Thanks!
Comment