I am trying to create a variable based on employment data taken from a survey done over several years. Currently, I'm working with data that takes on a value of 0 if a person is unemployed and if they are employed, the data point represents what year of the survey the person is in and what number job they are in that year. To illustrate, if a person is in the 3rd year of the survey and is on their 2nd job that year, that would be represented as a value of 302 in the dataset. I'd like to create the variable such that it indicates what number job the person is in over the entire length of the survey. Ideally, it'd look like this:
Person employment job number
1 0 0
1 101 1
1 101 1
1 102 2
1 102 2
1 0 0
1 103 3
1 201 4
1 201 4
1 202 5
1 203 6
and so on.
I've tried using several forms of cumulative addition but can't seem to figure out how to manipulate the numbers that are bigger than 200 or get them to take on the values I want. Any advice is appreciated!
Related Posts with Cumulative sums with duplicates
Generating a composite variable to reflect the number of answered questionsHello, I want to generate a composite variable “ppe” from 10 variables which have been coded 0 “no” …
Var and Diebold-Yilmaz indexHi everybody, I have some issues in understanding how to calculate Diebold-Yilmaz spillover index (D…
Non convergence in regression with Multiple ImputationI am trying to run my regressions, but it always Shows the error: convergence not achieved convergen…
Reshaping problemI have this dataset: Array Where REER is the real effective exchange rate and AE, AF, etc. ar…
In Stata can I estimate robust standard errors AND cluster?Hi all, A thought, in Stata is it possible to estimate a fixed effects linear probability model wit…
Subscribe to:
Post Comments (Atom)
0 Response to Cumulative sums with duplicates
Post a Comment