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
2SLS: Interpretation of ResultsHi - I am working with panel data (US industrials, 2000-2019) and am researching the impact of firm …
Trying to open shapefile but Stata looks for .dbf fileHello, I am trying to open a shapefile under the name "pga.shp" that I downloaded from the US Geolo…
What is the ideal way to keep only needed variables in panal dataset?I have around 40 variables in my dataset but I actually only use around 8 of them. I assume that kee…
How to list all unique values based on value of another variable?Hi all, I am conducting a cross-country analysis. I have a variable named developed has the value of…
What is the difference between "stack" and "pca" ?From my understanding, it seems that pca and stack syntaxes are all about suppressing two or more va…
Subscribe to:
Post Comments (Atom)
0 Response to Loop Panel Regression to save one coefficient and visualize
Post a Comment