Hello,
I'm having trouble troubleshooting why a coefficient I see in the -areg- output does not match the difference in the predicted values in the -margins- output.
Specifically, I used -areg- to run an interrupted time-series model to understand the impact of an event on test performance by participants' ethnicity, where post1 is the first year after the event I'm interested in (i.e., "i.post1#ib3.ethnicity" where the third ethnicity group, Hispanic, was the reference group). For reference, time=0 indicates when the event of interest occurred (i.e., post1 = (time=1)).
The results show that the coefficient for "1.post1" is -12.83, which tells me that the event had an average effect of -12.83 point drop for Hispanic participants (i.e., baseline).
When I run -margins- to get the exact predicted test scores for Hispanic participants:
In the -margins- output (format: ethnicity#post1), Stata returns 331.81 points at post1 assuming the event of interest did not happen (i.e., hispanic#0) and 322.64 points at post1 given that the event has happened (i.e., hispanic#1). I would expect that the difference between the two predicted scores would be -12.83 based on -areg- results; however, it is 9.17.
I cannot seem to figure out why the the two values do not match. I'd really appreciate any insight into this. Unfortunately, I can't share the data/parts of data due to confidentiality, but am ready to run diagnostics/different versions of the -margins- command as recommended from you all.
I'm having trouble troubleshooting why a coefficient I see in the -areg- output does not match the difference in the predicted values in the -margins- output.
Specifically, I used -areg- to run an interrupted time-series model to understand the impact of an event on test performance by participants' ethnicity, where post1 is the first year after the event I'm interested in (i.e., "i.post1#ib3.ethnicity" where the third ethnicity group, Hispanic, was the reference group). For reference, time=0 indicates when the event of interest occurred (i.e., post1 = (time=1)).
Code:
areg testscore time female i.post1##ib3.ethnicity i.post2##ib3.ethnicity disabled servicestatus i.post1##ib1.level i.post2##ib1.level p_a p_b p_h p_w p_ai p_nh p_esl if include_fulldata==1 [pweight=ipsw*sweight], vce(cluster participantid) absorb(schoolid)
When I run -margins- to get the exact predicted test scores for Hispanic participants:
Code:
margins post1, over(ethnicity) at((means) time==1 post2=0)
I cannot seem to figure out why the the two values do not match. I'd really appreciate any insight into this. Unfortunately, I can't share the data/parts of data due to confidentiality, but am ready to run diagnostics/different versions of the -margins- command as recommended from you all.
Comment