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
Sublime Text and Stata 16I am trying to use Sublime Text with Stata 16, similar to what I previously did with earlier version…
Question regarding Wilcoxon signed-rank tests for weighed dataI am using sample weighted data. I want to compare a result before and after an intervention. I woul…
How to check correlation among 2000+ variables in a quick way?Hi, all, I had a data set of 2000+ variables (all binary or categorical), for example, 1000+ are …
Can I use logit without with YES/NO data instead of 0/1?Hi, everyone, All my data are in YES/NO values instead of 0/1. And I want to find the correlation a…
Construct equally weighted decile portfolios by ranking stocks on past 3 years volatilityHey dear Members, I have a data sets of about 303 companies with monthly returns of the last 22 yea…
Subscribe to:
Post Comments (Atom)
0 Response to Employment binary variable into employment rate and continuous variable
Post a Comment