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
-margins- and -marginsplot- for heterogeneity analysisHi all, Please consider the following example data Code: * Example generated by -dataex-. For mor…
Impulse Response FunctionHi everyone, I am currently doing a time-series analysis, using the VECM model. For a post-estimat…
Is there a way to permanently store eststo?I posted this question also to StackOverflow. My code is complicated that it has many "clear all" c…
Mean exposure throughout pregnancyHello, i would like to calculate a mean of the variable exposure for each woman during a whole pregn…
Plotting GraphHi all, I have data from a survey on prices individuals are willing to pay for a product. In partic…
Subscribe to:
Post Comments (Atom)
0 Response to Employment binary variable into employment rate and continuous variable
Post a Comment