Dear Statalist,
I posted a similar question before, but I think I am a bit closer now where I might get some useful help.
I want to have Annual hrs difference: migrants minus natives on the vertical axis, and years since migration on the horizontal axis.
I run the following regression:
reg annualhrs ysm ysm2 spysm spysm2 cohort2-cohort8 spcohort2-spcohort8 plus other controls.
This is a regression of women only, so "sp" is the variable for the male spouse. Outcome is annualhrs being a function of years since migration(2), spouse years since migration(2), and seven cohort decades of arrival for the women and their spouse. I would like to graph the relationship (annual hrs difference over years since migration) using the arrival decade cohort6 and spcohort6.
So this is what I have done:
I run the regression. Then,
gen y = _b[ysm]*ysm + _b[ysm2]*ysm2 + _b[spysm]+ _b[spysm2] + _b[cohort6] + _b[spcohort6]
duplicates drop ysm ysm2 spysm spysm2, force
sort ysm ysm2 spysm spysm2
graph twoway line y ysm
The concave graph intersects the y axis at -400 (which is great because the Net cohort effect estimate = _b[cohort6] + _b[spcohort6] = -1000 + 600 = -400). The y is zero when ysm =10, and then the graph continues to go upwards in a concave manner.
It looks all good, but I am not sure if I have done it right, and I am not sure how to move the x axis upwards where y is equal zero, so that the graph crosses the xaxis when ysm=10.
Let me write a few more words on the following:
gen y = _b[ysm]*ysm + _b[ysm2]*ysm2 + _b[spysm]+ _b[spysm2] + _b[cohort6] + _b[spcohort6]
The rough estimates for the _b's are as follows:
gen y = +48[ysm]*ysm - 0.11[ysm2]*ysm2 -22[spysm] - 0.09 [spysm2] -1000[cohort6] + 600[spcohort6]
I am writing this long equation because I want to have Net years since migration: Net ysm = ysm-spysm= 48-22 and Net ysm2 = ysm2 - spysm2 = -0.11 - 0.09.
So two questions I got:
Is my approach somewhat correct or do I need to use margins and marginsplot?
How do I move a xaxis upwards?
Thank you very much.
Best wishes
Nico
Related Posts with Difference in annual hour worked between migrant and native married women by years since migration: a graphical illustration of assimilation
How to recover stored results from e() class?Hello, I am working on mwitch command of Stata. I work in Stata 15. I ran the following: . mswitch …
IV Regression With Interaction Terms and 2+ InstrumentsDear all, Greetings to all contributors from someone new to the forum and a user of Stata 15.1/SE. …
Histogram with differences in sharesHello, I have the following problem in Stata: I want to construct a histogram showing the differen…
How to create a simple table with my own specifications?Hi, I want to create my own table with column names and observations in stata. I have been searchin…
DataexPlease house, I need a users' guide on dataex, I am using stata 16 SE on window 7. Thanks for your a…
Subscribe to:
Post Comments (Atom)
0 Response to Difference in annual hour worked between migrant and native married women by years since migration: a graphical illustration of assimilation
Post a Comment