Dear all
I am wanting to create an employment rate variable (ie. Number employed/ (Labour Force) * 100) from an employment rate binary variable (=1 if employed and 0 otherwise).
What i have done so far:
egen CountT = count(EMPL) if EMPL == 1
* CountT is total employed (strict)
egen countT = count(EMPL) if EMPL == 0
gen LabourForce = CountT + countT
gen EmplRate = 100 * (CountT / LabourForce)
However, stata does not like me adding the CountT and countT together like that - tabbing it doesn't present anything.
Furthermore, how do you create a cumulative variable for number of employed people. I want to create a cumulative variable from the EMPL binary variable when it = 1. This is so that i can use it as my dependent variable for an lpoly graph.
How do you do that?
Regards
Related Posts with Employment binary variable into employment rate and continuous variable
keep observations between the same rangeHi statalists, I have two variables, period and company. Period is the accumulative number of quart…
Is there a way in Stata to drop cases if the percentage of missing is greater than certain value according to key variable?Array Hi all! I want to drop cases if the percentage of missing is greater than certain value accord…
Interactions between two variables with time-varying effects in flexible parametric survival analysis stpm2I am running a flexible parametric survival model using stpm2. In my data, I have two variables tha…
SEM and nonlinear regressionHello everyone. Earlier, I used 'Stata' to build non-linear regressions. Recently, I started using …
Using MatchitHi, I'm trying to merge two datasets based on a string variable; but the string variables don't matc…
Subscribe to:
Post Comments (Atom)
0 Response to Employment binary variable into employment rate and continuous variable
Post a Comment