Hi,
I was wondering if you have information about how to use Stata to combine the observations from multiple categorical variables into a single indicator variable, e.g condition present yes or no.
I am working with NHANES data 2011-2012. http://wwwn.cdc.gov/nchs/nhanes/search/nhanes11_12.aspx
I need to combine the following categorical variables < ohx02se ohx03se..... ohx30se > into a single indicator/binary or even categorical variable, lets call it Sealants_Not_Present. I am trying to create a single variable that includes the sum of all the "0" (means sealant not present) from each of the 30 distinct variables. (see codebook below)
Your help is deeply appreciated,
Victor
describe ohx02se ohx03se ohx04se seqn
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------
ohx02se str10 %10s Dental Sealants: #2
ohx03se str10 %10s Dental Sealants: #3
ohx04se str10 %10s Dental Sealants: #4
seqn double %10.0g Respondent sequence number
Codebook for ohx02se
ohx02se Dental Sealants: #2
-----------------------------------------------------------------------------------------------------------------
type: string (str10), but longest is str2
unique values: 4 missing "": 6732/9756
tabulation: Freq. Value
6732 ""
1008 "0"
153 "1"
15 "13"
1848 "9"
I was wondering if you have information about how to use Stata to combine the observations from multiple categorical variables into a single indicator variable, e.g condition present yes or no.
I am working with NHANES data 2011-2012. http://wwwn.cdc.gov/nchs/nhanes/search/nhanes11_12.aspx
I need to combine the following categorical variables < ohx02se ohx03se..... ohx30se > into a single indicator/binary or even categorical variable, lets call it Sealants_Not_Present. I am trying to create a single variable that includes the sum of all the "0" (means sealant not present) from each of the 30 distinct variables. (see codebook below)
Your help is deeply appreciated,
Victor

describe ohx02se ohx03se ohx04se seqn
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------
ohx02se str10 %10s Dental Sealants: #2
ohx03se str10 %10s Dental Sealants: #3
ohx04se str10 %10s Dental Sealants: #4
seqn double %10.0g Respondent sequence number
Codebook for ohx02se
ohx02se Dental Sealants: #2
-----------------------------------------------------------------------------------------------------------------
type: string (str10), but longest is str2
unique values: 4 missing "": 6732/9756
tabulation: Freq. Value
6732 ""
1008 "0"
153 "1"
15 "13"
1848 "9"
Comment