Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Missing value problem with new variable


From   Wameq Raza <[email protected]>
To   [email protected]
Subject   st: Missing value problem with new variable
Date   Tue, 11 Sep 2012 11:20:18 +0200

Hi everyone,
For my data set that deals with health seeking behavior for a acute
illnesses, I've been trying to include the occupational details of the
household head for each of the patients who seek care. More
specifically, I want to create a variable where the occupation of the
household head is stored for every individual in the household.

To do this I've followed these steps:
1. gen emp_hhh=occupation if relationshiptohhh==1           /where
Q1_1_7 is the occupation variable (categorical variable) and
relationshiptohhh equals to 1 if it's the head of the household
2. bysort SRLNO site: egen emp_hh = max(emp_hhh)        /where "SRLNO
site" are the ID variables for each household.

My understanding is that the new var "emp_hh" should have what I want,
but there seems to be a number of missing values. I've checked the
original occupation var for missing values from which the new var was
constructed, but there were none. Might there be something wrong with
my syntax?

I'm having a similar problem with the education variable as well.

Does anyone have any suggestions?

Best
Wameq
-- 
W A M E Q   R A Z A
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index