Hi All,
I am trying to recover the estimates of an interaction term produced by -regress- using -margins- (followed by -lincom-).
In the example below, the estimates for foreign and bin_wt derived by -margins- / -lincom- are the same as those as the coefficients in the regress output.
However, I can't figure out how to replicate the interaction term estimate of -2.742342 for 1.foreign#1.bin_wt in the regression output.
Thanks in advance!
Ariel
I am trying to recover the estimates of an interaction term produced by -regress- using -margins- (followed by -lincom-).
In the example below, the estimates for foreign and bin_wt derived by -margins- / -lincom- are the same as those as the coefficients in the regress output.
However, I can't figure out how to replicate the interaction term estimate of -2.742342 for 1.foreign#1.bin_wt in the regression output.
Thanks in advance!
Ariel
Code:
sysuse auto gen bin_wt = weight > 3020 regress mpg i.foreign##i.bin_wt margins foreign#bin_wt, coefl post lincom _b[1.foreign#0bn.bin_wt]-_b[0bn.foreign#0bn.bin_wt] // reproduces coefficient for foreign lincom _b[0bn.foreign#1.bin_wt]- _b[0bn.foreign#0bn.bin_wt] // reproduces coefficient for bin_wt
Comment