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
changing numbers that surround decimalsI have 18,000 observations in a variable, which I have cleaned down to 60 left to address. They are …
Contingent valuation methodI am using CVM to estimate mean WTP for a conservation program. WTP is elicited in both cash value a…
How toextract the results of various stata commands into matrices or mata universally and selectivelyFor stata commands(such as npresent, fsum, etc.) without a matrix in the return values(the result of…
Computing Average/Mean ROC Curve and AUC among different observersDear all, I was wondering if it would be possible to compute a mean ROC curve, with corresponding m…
Separating epiweeks with corresponding yearsGood day all I was wondering if you could please help. I have a data set with years 2020 and 2021. …
Subscribe to:
Post Comments (Atom)
0 Response to Employment binary variable into employment rate and continuous variable
Post a Comment