Hi all,
Based on the below equation, I would like to obtain the gender difference (sex_main, 1 is female) in the relationship between dfruit_simp and mh_likert during the pandemic (treat_covid1, 1 captures the pandemic).
global controls_simp i.agecat_sec i.educ_simp i.race_main i.gor_main i.imonth_final
xtreg mh_likert i.dfruit_simp i.dfruit_simp##i.treat_covid1##i.sex_main $controls_simp if wsample, fe vce(cluster pidp)
Could I get some advice on how to do this? I've tried various iterations of the below and the coefficients do not match the coefficients obtained when I have run this equation separately for men and women with the i.dfruit_simp##i.treat_covid1 interaction only.
lincom _b[1.dfruit_simp] + _b[1.dfruit_simp#1.treat_covid1] + _b[1.dfruit_simp#1.sex_main] + ///
_b[1.dfruit_simp#1.treat_covid1#1.sex_main] + _b[1.dfruit_simp] + _b[1.dfruit_simp#1.treat_covid1]
Thank you in advance for your help with this.
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(mh_likert dfruit_simp treat_covid1 sex_main agecat_sec educ_simp race_main gor_main imonth_final)
11 1 0 1 0 0 1 7 10
19 1 0 1 0 0 1 7 6
9 0 0 1 1 1 1 7 8
16 0 0 1 1 1 1 7 8
10 1 0 1 0 0 1 5 3
8 1 0 1 0 0 1 5 4
7 1 0 1 1 0 1 8 1
17 1 0 1 1 0 1 8 1
7 1 0 1 0 1 1 5 6
6 1 0 1 0 1 1 5 9
6 1 0 1 0 0 1 10 7
13 0 0 1 0 0 1 4 7
6 1 0 1 0 1 1 5 1
35 0 0 0 0 0 1 2 9
12 1 0 1 2 1 0 1 9
12 1 0 1 2 1 0 1 10
10 0 0 0 1 1 1 4 4
12 1 0 0 2 0 1 8 11
7 1 0 0 2 0 1 8 10
11 0 0 0 0 1 1 10 5
23 0 0 1 0 0 1 3 3
10 0 0 1 0 0 1 3 1
11 0 0 1 0 1 1 7 12
11 1 0 1 0 0 1 11 3
7 1 0 1 0 0 0 12 5
18 1 0 1 0 0 0 12 7
9 1 0 1 2 1 0 12 7
9 1 0 1 2 1 0 12 2
4 1 0 0 1 1 1 10 8
12 1 0 0 3 1 1 3 8
10 1 0 0 3 1 1 3 9
22 0 0 0 0 1 1 11 4
29 0 0 0 0 1 1 11 5
8 0 0 0 1 0 1 11 12
7 0 0 0 1 0 1 11 2
11 1 0 1 1 1 1 7 1
7 0 0 1 2 0 0 7 3
8 1 0 1 2 0 0 7 1
7 1 0 0 3 1 0 1 4
10 1 0 0 3 1 0 1 3
11 1 0 1 1 0 1 1 3
26 0 0 1 1 0 1 1 3
18 0 0 1 0 0 1 1 3
27 0 0 1 3 0 1 1 3
12 1 0 1 2 0 1 1 4
12 1 0 1 2 0 1 1 3
14 1 0 0 1 1 1 1 4
10 1 0 0 1 1 1 1 3
16 1 0 1 2 1 1 1 3
13 1 0 1 2 1 1 1 3
end
[/CODE]
Based on the below equation, I would like to obtain the gender difference (sex_main, 1 is female) in the relationship between dfruit_simp and mh_likert during the pandemic (treat_covid1, 1 captures the pandemic).
global controls_simp i.agecat_sec i.educ_simp i.race_main i.gor_main i.imonth_final
xtreg mh_likert i.dfruit_simp i.dfruit_simp##i.treat_covid1##i.sex_main $controls_simp if wsample, fe vce(cluster pidp)
Could I get some advice on how to do this? I've tried various iterations of the below and the coefficients do not match the coefficients obtained when I have run this equation separately for men and women with the i.dfruit_simp##i.treat_covid1 interaction only.
lincom _b[1.dfruit_simp] + _b[1.dfruit_simp#1.treat_covid1] + _b[1.dfruit_simp#1.sex_main] + ///
_b[1.dfruit_simp#1.treat_covid1#1.sex_main] + _b[1.dfruit_simp] + _b[1.dfruit_simp#1.treat_covid1]
Thank you in advance for your help with this.
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(mh_likert dfruit_simp treat_covid1 sex_main agecat_sec educ_simp race_main gor_main imonth_final)
11 1 0 1 0 0 1 7 10
19 1 0 1 0 0 1 7 6
9 0 0 1 1 1 1 7 8
16 0 0 1 1 1 1 7 8
10 1 0 1 0 0 1 5 3
8 1 0 1 0 0 1 5 4
7 1 0 1 1 0 1 8 1
17 1 0 1 1 0 1 8 1
7 1 0 1 0 1 1 5 6
6 1 0 1 0 1 1 5 9
6 1 0 1 0 0 1 10 7
13 0 0 1 0 0 1 4 7
6 1 0 1 0 1 1 5 1
35 0 0 0 0 0 1 2 9
12 1 0 1 2 1 0 1 9
12 1 0 1 2 1 0 1 10
10 0 0 0 1 1 1 4 4
12 1 0 0 2 0 1 8 11
7 1 0 0 2 0 1 8 10
11 0 0 0 0 1 1 10 5
23 0 0 1 0 0 1 3 3
10 0 0 1 0 0 1 3 1
11 0 0 1 0 1 1 7 12
11 1 0 1 0 0 1 11 3
7 1 0 1 0 0 0 12 5
18 1 0 1 0 0 0 12 7
9 1 0 1 2 1 0 12 7
9 1 0 1 2 1 0 12 2
4 1 0 0 1 1 1 10 8
12 1 0 0 3 1 1 3 8
10 1 0 0 3 1 1 3 9
22 0 0 0 0 1 1 11 4
29 0 0 0 0 1 1 11 5
8 0 0 0 1 0 1 11 12
7 0 0 0 1 0 1 11 2
11 1 0 1 1 1 1 7 1
7 0 0 1 2 0 0 7 3
8 1 0 1 2 0 0 7 1
7 1 0 0 3 1 0 1 4
10 1 0 0 3 1 0 1 3
11 1 0 1 1 0 1 1 3
26 0 0 1 1 0 1 1 3
18 0 0 1 0 0 1 1 3
27 0 0 1 3 0 1 1 3
12 1 0 1 2 0 1 1 4
12 1 0 1 2 0 1 1 3
14 1 0 0 1 1 1 1 4
10 1 0 0 1 1 1 1 3
16 1 0 1 2 1 1 1 3
13 1 0 1 2 1 1 1 3
end
[/CODE]
Comment