We are interested in studying the impact of fertility on employment outcomes of adult men and women. We will start by constructing the main outcome variables of interest. Construct the following variables: (a) A dummy variable indicating if the observation ever worked. (b) A dummy variable indicating if the observation is employed, and another one indicating if they are in the labor force. (c) A variable measuring the number of years they have been working for their current employer.
i tried using an egen code but requests were not as expected
Nick is correctly noting that you will get better answers if you provide more information about your situation. Lacking that, we have to guess about your data structure.
if we assume a variable
working_nowequal to 1 if the individual is working now and 0 otherwise, a time period variableyearand an individual identifieridall arranged in an id-year panel, then we can simply:You'll need to provide more information about your dataset (even sharing a little data with
ssc dataex) for this one.this depends on your definition of 'in the labor force'. In New Hampshire for example it means the following:
This might not be relevant to your case, but it's enough for this example.
Then let's assume an
agevariable with integer ages, aninstitutionalizedvariable and aseeking_workvariable each equal to 1 if true and 0 otherwise. Then we can do the following:for this we will also need an employer id
eid:Nick has written several nice articles on how to do this, none of which I'm doing justice to here. For example: Speaking Stata: Identifying spells.