Dear all,
I am new to Stata and could use some help. I have a Panel-Data set where I try to analyze the impact of Locus of Control (LOC) on Wage. After the usual steps I came to the point where I did regressions appropiate for my data seperately for men and women:
xtreg lnwage LOC age tenure (..other control variables..) if gender==0, re vce(cluster id)
Im happy with the results so far, but now I would like to loop this regression for age= 20/30 and save the regression coefficients from LOC. So far I searched through the internet and tried different commands. Among others I tried for example:
g b_loc=.
quietly forval age=20/30 {
xtreg lnwage LOC age tenure (other control variables) if gender==0, re vce(cluster id)
replace b_loc=_b[loc]
or statsby commands. However I could not produce logical results.
In a next step I am interested in visualizing the impact of LOC over the age (-> x-axis) on logwage (-> y-axis) in a line chart with 2 graphs for men and women, to see if the impact of LOC on lnwage changes throughout the life. Because the loops did not work out for me I don't have a exemplary approach on how to do that graphic yet.
I could use any kind of help thank you very much in advance.
Related Posts with Loop Panel Regression to save one coefficient and visualize
Removing duplicate permutationsHi, I am trying to remove "duplicate permutations". For instance: ID source target 1 A B 2 A C 3 B…
Robust Quantile Regression (with robust standard errors)Dear Statalists I run two robustness regression models (rreg & mmregress) with similar (good) r…
How to move State ApplicationI have Stata 13 MP on my current laptop (Macbook Air)). I have just bought a new laptop (MacBook Air…
Subhazard estimates from stcrreg with multiple (>2) competing hazards.Hi All, I am trying to estimate a competing hazard model ala Fine & Grey (1999). I have three …
foreach loop and localDear all‘ The code below is too long for me.I know it could be replaced by a foreach loop,but I don'…
Subscribe to:
Post Comments (Atom)
0 Response to Loop Panel Regression to save one coefficient and visualize
Post a Comment