Hey there
I am using cross-sectional for South Africa that that includes household(hhid) and individual level(pid) data
I have some employment data ( adult individual level) that I want to use to generate a dummy variable for the entire household if no one in the household is unemployed? So the value would then be 1 for all the household members if someone in the household is employed and 0 if no one in the household is employed.
My individual employment variable is however categorical (0=unemployed; 1=employed; 2=Not economic active) Yet I still just want to get an individual-level variable that equals 1 if you are part of a household with someone in the labour market and 0= if you are part of a household without any household member in the labour market
Below please find an example of my data (Sorted by hhid)
hhid pid labourmarket
500000 636991 1
500000 640576 0
500001 405734 2
500002 305961 1
500002 731651 2
500002 401746 .
500002 630858 .
500003 769557 1
500003 782520 .
500003 763879 .
500003 746176 2
500003 787751 2
500003 303668 2
500003 703450 0
500004 310664 1
500005 319004 1
500006 795652 0
500006 755010 2
500006 630051 .
500006 716968 1
500006 624989 .
500006 734074 2
500006 401698 0
500007 753507 .
500007 747659 .
500007 316119 0
500007 796156 2
500008 408602 2
500008 735370 0
Kind regards
Frederich
Related Posts with Generating a dummy variable for an entire household based on a individual labour market characteristic
creating a variable that takes a value of the difference of the last non-missing value and the first non-missing value in panel datai have panel time series. I want to create a variable that is the difference between the last non-mi…
ivreg, ivprobit and biprobit which one to use? (any theoretical reasoning?)As I do not have any econometric background I find it difficult to understand which one to use when …
renaming using loop Code: * Example generated by -dataex-. To install: ssc install dataex clear input str43 Q2_8a1 dou…
Binscatter2 - faster, enhanced binned scatterplots in StataHi all, I wanted to make note of a program that I've had available on GitHub for a while now to gen…
Question spmapHi, I have a question about spmap. I'm just a beginner with STATA and I want to know how to use spm…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a dummy variable for an entire household based on a individual labour market characteristic
Post a Comment