Hi all, quite new to Stata.
I am doing research on Excess CEO Compensation and I want to regress the natural log of CEO's total compensation on the control variables of CEO compensation. However, I want to perform a separate regression for each company for each year, and use each result as variable for that particular observation.
I've tried the following commands, however it doesn't provide me with the desired results:
sort CIK YEAR
gen expected_comp=.
egen id=group(CIK)
forvalues i=1(1)5696 {
I id CIK if id=='i'
reg logTDC1 logSALES logFS if id=='i '
predict p if id=='i'
replace expected_comp=p if id=='i'
drop p
}
Can anyone help me with this?
Related Posts with create variable based on regressed results per observation
Italic fonts for Stata's meta forestplotDear Statalisters, Does anyone have an idea how to make this red underlined texts 'italic' (see att…
Constrained optimization in StataDear Stata uses, I am having a constant optimization problem to solve in Stata I am having three var…
Effective Reproductive NumberHello! Is there a way to calculate Effective Reproductive Number (Rt) in STATA? Thank you very muc…
Tobit with vce(robust) or notHi, When I run tobit model specifying vce(robust), it does F test to test the hypothesis that the co…
Ordered Logit, Multinomial Logit- InterpretationsI am trying to run ordered logit for a dependent variable that takes values -1,0,1. Suppose educatio…
Subscribe to:
Post Comments (Atom)
0 Response to create variable based on regressed results per observation
Post a Comment