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?
Using a secondary dataset to generate new variables to main dataset given conditionsHi all, So as usual, I'm having a hard time describing what I'm trying to do, which I believe is wh…
Eststo/esttab with sum of coefficients (dummies)Hello, Suppose I have Y as my dependent variable, and I have three dummies, d1, d2, d3. Suppose I r…
Strategy for analyzing 90 observations with a dichotomous dependent variableDear statalisters, I am involved in a project analyzing the effect of Environmental Impact Assessme…
lincom after transform_marginsHi I was wondering how to obtain appropriate lincom results after using transform_margins. I am usi…
test1 trying to see what this code looks like Code: * Example generated by -dataex-. To install: ssc i…
Subscribe to:
Post Comments (Atom)
0 Response to How to writing a code similar as the following code but by region?
Post a Comment