levelsof year, local(years)
egen flag = tag(id_job year)
gen stateratio = .
foreach y of local years {
summ occ if year == `y' & flag, meanonly
local odds = `r(mean)'*100
replace stateratio = `odds' if year == `y'
}
Related Posts with How to writing a code similar as the following code but by region?
Creating a simple line chartHello, I hope to ask if anyone can help me create simple line charts for my panel data. The panel d…
Make margins postestimation run faster? Manual calculation for margins and 95% CI?I am running mixed effects/multilevel analyses on a very complex, very large dataset and I've notice…
CMP + eregressDear Statalists, I am using Stata 15, the eregress package and the cmp package. The following is th…
Need suggestion to improve coefficient valuesI run fixed effect regression my dependent variable in index value 0 to 1 while independent variable…
Extracting two dates. HELP !I have observations where the data was saved as csv files and now loaded into stata. There is the 1)…
Subscribe to:
Post Comments (Atom)
0 Response to How to writing a code similar as the following code but by region?
Post a Comment