I use panel data of couples, each observation (is one household defined by the variable idhous) has variables for the man and woman on income and so on. I want to now compare how the birth of the firstborn child affects the previously (2 years before birth, variable called incomediff2) measured within couple wage gap. For this, I generated the variable eventtime, which measures the years relative to the birth of the child. To make my analysis more interesting, i divided the couples into two groups: couples that are politically left or right (dummy variable left=1 if left and =0 if right). I am running the xtreg command and want to find out wether the difference in the regression coefficients for the group left or right is statistically significant. I am aware that i cant use suest. So I’ve tried to use an interaction term but i dont receive the same coefficients when i use the interaction term and when i dont. Can someone please tell me where I am going wrong?
Commands im using
eststo DL: xtreg incomediff incomediff2 i.eventtime i.year edgap agegap edyearf childcare, vce(cluster idhous)
eststo DL: xtreg incomediff incomediff2 i.eventtime i.year edgap agegap edyearf childcare (c.incomediff2 c.eventtime c.year c.edgap c.agegap c.edyearf c.childcare)#left, vce(cluster idhous)
I hope i explained my problem well enough.
PS: beginner stata user
Thanks!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long idhous float(incomediff incomediff2 edgap agegap left) 4291 .8025513 . 5 -3 1 4291 . . 5 -3 1 4291 . . 5 -3 1 4291 1.2001867 . 5 -3 1 4291 . . 5 -3 1 13374 -.0902532 -.02123192 -4 4 1 13374 .04665501 -.02123192 -4 4 1 13374 1.216366 -.02123192 -4 4 1 13374 1.7034093 -.02123192 -4 4 1 13374 1.288267 -.02123192 -4 4 1 13374 1.4012942 -.02123192 -4 4 1 13374 1.411276 -.02123192 -4 4 1 13381 .5420939 . 0 -9 1 13381 .6947426 . 0 -9 1 13381 . . 0 -9 1 13381 . . 0 -9 1 14241 2.187799 . 2 2 1 14241 . . 2 2 1 14241 .55151635 . 2 2 1 14241 .45938775 . 2 2 1 14241 .8455062 . 2 2 1 14241 .52631915 . 2 2 1 14241 .600426 . 2 2 1 15222 .05180164 .05784675 -6 0 0 15222 .53180295 .05784675 -6 0 0 15222 .3193598 .05784675 -6 0 0 15222 .9885963 .05784675 -6 0 0 15222 .6885488 .05784675 -6 1 0 16731 -.1670527 -.08474053 3 4 1 16731 .04729639 -.08474053 3 4 1 16731 .3838619 -.08474053 3 4 1 16731 .09983494 -.08474053 3 4 1 16731 .23967063 -.08474053 3 4 1 16731 .3762996 -.08474053 3 4 1 16731 .4074799 -.08474053 3 4 1 21442 .7139507 . 0 -2 1 21442 .6127079 . 0 -2 1 21442 2.1356988 . 0 -2 1 21442 . . 0 -2 1 21442 . . 0 -2 1 21442 3.1716845 . 0 -2 1 21442 3.5162594 . 0 -2 1 21442 . . 0 -2 1 21442 . . 0 -2 1 26031 -.26516086 -.20032717 0 0 1 26031 -.3323401 -.20032717 0 0 1 26031 -.17684834 -.20032717 0 0 1 26031 .2048285 -.20032717 0 0 1 26031 .5872296 -.20032717 0 0 1 26031 .8075491 -.20032717 0 0 1 26031 .1531501 -.20032717 0 0 1 26031 .2273172 -.20032717 0 0 1 29061 . . 8 4 0 29061 . . 8 4 0 29061 4.4611197 . 8 4 0 29061 2.6433666 . 8 4 0 29061 2.965289 . 8 4 0 29061 2.7983994 . 8 4 0 29061 2.873498 . 8 4 0 29061 2.839221 . 8 4 0 29061 2.1390777 . 8 4 0 35404 .1898665 .08865514 0 3 1 35404 .13464524 .08865514 0 3 1 35404 . .08865514 0 2 1 36602 . . 6 0 0 36602 . . 6 0 0 36602 . . 6 0 0 37591 .2025216 .02059248 2 2 0 37591 1.7441094 .02059248 2 2 0 37591 1.4136633 .02059248 2 2 0 37591 1.1085622 .02059248 2 2 0 37591 1.0557346 .02059248 2 2 0 37591 1.038873 .02059248 2 2 0 37592 -.01922184 -.2221554 -6 3 1 37592 .7027051 -.2221554 -6 3 1 37592 1.2039472 -.2221554 -2 3 1 37592 1.1006347 -.2221554 -2 3 1 37592 1.1006347 -.2221554 -2 3 1 37592 1.2709785 -.2221554 -2 3 1 37592 1.3131486 -.2221554 -2 3 1 37592 1.1685479 -.2221554 -2 3 1 37812 -.11154032 .3174509 0 2 1 37812 -.008959652 .3174509 0 2 1 37812 -.002995479 .3174509 0 1 1 41365 . . 0 -5 1 48152 .6261821 .5037338 -11 3 1 48152 .5625459 .5037338 -11 3 1 48152 -.04564056 .5037338 -11 3 1 48152 .05061904 .5037338 -9 3 1 48951 . . -6 15 0 48951 1.5004704 . -6 15 0 48951 . . -6 15 0 48951 . . -6 15 0 48951 . . -6 15 0 48951 . . -6 15 0 48951 2.3277872 . -6 15 0 48951 2.3141751 . -6 15 0 48951 2.1364963 . -6 15 0 48951 2.3141751 . -6 16 0 50092 -.04645612 .08142643 0 2 0 end label values idhous IDHOUS99
0 Response to Testing difference between regression coefficients in panel data
Post a Comment