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
Different combinations in each householdI have individual data set. With my dataset I want to create a living arrangement among elderly for …
Calculating the AIC and BIC of ARDL(p,q) models for different values of p and qDear all! I hope you are well. I am trying to calculate the AIC and BIC of ARDL(p,q) models for dif…
Fitting NL model with strictly positive dependent variable!I have estimated a model of the following form using NL: y=exp(xB)*(P^{gamma}) * (I^{theta}) + epsi…
How to label variables taking last part of variable namesI have numerous variables. For example, I have variables var1, var3, var6, var30. And I want to labe…
Loading in blocks of dataHello I have the following data. It is a .txt file with 7 variables listed vertically with a line s…
Subscribe to:
Post Comments (Atom)
0 Response to create variable based on regressed results per observation
Post a Comment