Good day,
I am using a survey sample file and i am trying to create a new variable X=1 for each household (HID) that has two observations of PATNR=1, as one observation of PATNR indicates a single parent household.
I have tried several egen commands but i keep getting the error code.
Can anyone please help with suggestions?
Many thanks.
I am using a survey sample file and i am trying to create a new variable X=1 for each household (HID) that has two observations of PATNR=1, as one observation of PATNR indicates a single parent household.
Code:
Code:* Example generated by -dataex-. To install: ssc install dataex clear input str14 ABSHID float PATNR "CSF11B00000001" . "CSF11B00000001" . "CSF11B00000002" 1 "CSF11B00000002" 1 "CSF11B00000003" . "CSF11B00000003" . "CSF11B00000003" . "CSF11B00000004" . "CSF11B00000005" . "CSF11B00000006" 1 "CSF11B00000006" . end
Code:
unknown egen function 1() r(133);
Can anyone please help with suggestions?
Many thanks.
Comment