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
OLS Regression with lagsHey! I am writing my bachelor thesis, studying the relationship between monetary policy and housing…
Proportions variableI am working with panel data and am trying to create a new proportional variable defined as the numb…
IRT 2PL not replicable across Stata 16 MP on Linux vs Stata 16.1 IC on a PCHi everyone, Also posted here. The subject says it all: Results from Stata's internal -irt 2PL- com…
Epidemiology analysisplease helm me with this case I dont know the syntax the data is on the attachment Estimate regress…
Help needed: Extracting data from different rowsHi all, I need some help in extracting data from a column. I am trying to find a way to do so witho…
Subscribe to:
Post Comments (Atom)
0 Response to create variable based on regressed results per observation
Post a Comment