Hello,
I have an interaction term that I would like to graph. I would like to replicate the graph below (attached). In my case instead of women/men it is son/no son and the x axis would be the different wealth quintiles.
I have tried to replicate it using:
Code:
xtreg M1  dbirthstat2 i.qwealth 0.sondum2#1.qwealth 0.sondum2#2.qwealth 0.sondum2#3.qwealth 0.sondum2#4.qwealth 0.sondum2#5.qwealth , re theta
margins qwealth#sondum2
marginsplot, recast(scatter)
But that doesn’t produce the graph I’m looking for. This is my data
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double Findid float sondum2 byte qwealth
601004802 0 3
601004802 0 3
601005902 1 1
601005902 1 1
601025702 1 2
601025702 1 3
601037702 1 1
601037702 1 1
601038302 1 1
601038302 1 1
601054402 1 2
601054402 0 2
601056302 0 4
601056302 0 4
601058302 1 1
601058302 0 1
601058602 1 2
601058602 1 2
601059402 0 3
601059402 0 2
601060202 1 2
601060202 0 2
601060302 1 2
601060302 1 1
601061202 0 2
601061202 0 2
601061302 0 1
601061302 0 1
601061602 1 1
601061602 1 1
601061802 1 1
601061802 0 1
601062002 1 3
601062002 1 2
601062302 1 2
601062302 0 1
601062802 1 3
601062802 0 2
601063102 0 4
601063102 0 4
601065402 0 1
601065402 0 1
601067002 0 1
601067002 0 1
601069302 1 1
601069302 0 1
601070202 1 3
601070202 0 3
601070802 0 3
601070802 0 1
601071402 1 2
601071402 1 1
601071502 0 2
601071502 0 1
601071602 0 2
601071602 0 1
601071702 0 4
601071702 0 2
601072002 1 2
601072002 0 1
601072702 1 3
601072702 1 4
601072902 1 3
601072902 0 2
601073102 0 2
601073102 0 1
601074202 0 2
601074202 0 3
601074502 1 3
601074502 1 2
601075502 0 2
601075502 0 2
601075902 0 1
601075902 0 3
601077402 1 1
601077402 0 2
601078802 0 2
601078802 0 1
601079402 0 2
601079402 0 1
601079502 1 2
601079502 0 2
601080302 1 3
601080302 0 4
601081102 1 3
601081102 1 1
601082202 0 2
601082202 0 2
601082402 0 1
601082402 0 1
601083402 0 2
601083402 0 2
601084002 0 1
601084002 0 3
601084502 0 1
601084502 0 1
601084902 1 2
601084902 1 1
601085202 1 2
601085202 0 2
end
label values sondum2 sondum
label def sondum 0 "Has sons", modify
label def sondum 1 "No son", modify
label values qwealth qwealth
label def qwealth 1 "Richest", modify
label def qwealth 2 "Rich", modify
label def qwealth 3 "Middle", modify
label def qwealth 4 "Poor", modify