***NCHS computations****; filENAME ok PIPE 'zcat /usr/data/public/us/government/stf/2000/PL94-171/wv.dat .Z'; DATA _null_; INFILE ok LRECL=30000 MISSOVER; INPUT @1 fileid $6. @7 state $2. @9 sumlev $CHAR3. geocomp 12-13 chariter 14-16 cifsn 17-18 @19 logrecno $7. @26 var1 $char200. @225 var2 $char175. @401 (p0010001-p0010071) (9.) (p0020001-p0020073) (9.) (p0030001-p0030071) (9.) (p0040001-p0040073) (9.); *------------------------------------------------------------------------------; * This creates main population and Hispanic variables; *------------------------------------------------------------------------------; *pop_0=P0010001; *nh_0=P0020003; *hisp_0=P0020002; *pop18_0=P0030001; *pop17_0=P0010001-P0030001; *nh18_0=P0040003; *hs18_0=P0030001-P0040003; *nh17_0=P0020003-P0040003; *hs17_0=P0020002-(P0030001-P0040003); *------------------------------------------------------------------------------; * This mca1es single-race categories for total population; *------------------------------------------------------------------------------; * Calculate total white population; whi_0=P0010003 + 0.25*P0010011 + 0.8*P0010012 + 0.45*(P0010013+P0010014+P0010034) + 0.5*P0010015 + 0.125*(P0010009-P0010010) ; * Calculate total black population; bla_0= P0010004 + 0.5*P0010011 + 0.8*P0010016 + 0.6*(P0010017+P0010018+P0010040) + 0.5*P0010019 + 0.125*(P0010009-P0010010) ; * Calculate total Native American population; ind_0= P0010005 + 0.15*P0010012 + 0.1*P0010016 + 0.4*(P0010020+P0010021+P0010043) + 0.25*P0010022 + 0.125*(P0010009-P0010010) ; * Calculate total Asian; asi_0= P0010006 + 0.35*P0010013 + 0.175*P0010034 + 0.2*P0010017 + 0.1*P0010040 + 0.4*P0010020 + 0.2*P0010043 + 0.5*P0010024 + 0.25*P0010046 + 0.125*(P0010009-P0010010) ; * Caluculate total Native Hawaiian and Other Pacific Islander; haw_0= P0010007 + 0.35*P0010014 + 0.175*P0010034 + 0.2*P0010018 + 0.1*P0010040 + 0.4*P0010021 + 0.2*P0010043 + 0.5*P0010025 + 0.25*P0010046 + 0.125*(P0010009-P0010010) ; * Calculate total other race population; oth_0= P0010008 + 0.25*P0010011 + 0.05*P0010012 + 0.2*(P0010013+P0010014+P0010034) + 0.5*P0010015 + 0.1*P0010016 + 0.2*(P0010017+P0010018+P0010040) + 0.5*P0010019 + 0.2*(P0010020+P0010021+P0010043) + 0.75*P0010022 + 0.5*(P0010024+P0010025+P0010046) + 0.5*(P0010009-P0010010) ; *------------------------------------------------------------------------------; * Non-Hispanics: This mca1es single-race categories for non-Hispanics; *------------------------------------------------------------------------------; * Calculate non-Hispanic whites; whinh_0= P0020005 + 0.25*P0020013 + 0.8*P0020014 + 0.45*(P0020015+P0020016+P0020036) + 0.5*P0020017 + 0.125*(P0020011-P0020012) ; * Calculate non-Hispanic blacks; blanh_0= P0020006 + 0.5*P0020013 + 0.8*P0020018 + 0.6*(P0020019+P0020020+P0020042) + 0.5*P0020021 + 0.125*(P0020011-P0020012) ; * Calculate non-Hispanic Native Americans; indnh_0= P0020007 + 0.15*P0020014 + 0.1*P0020018 + 0.4*(P0020022+P0020023+P0020045) + 0.25*P0020024 + 0.125*(P0020011-P0020012) ; * Calculate non-Hispanic Asians; asinh_0= P0020008 + 0.35*P0020015 + 0.175*P0020036 + 0.2*P0020019 + 0.1*P0020042 + 0.4*P0020022 + 0.2*P0020045 + 0.5*P0020026 + 0.25*P0020048 + 0.0625*(P0020011-P0020012) ; * Calculate non-Hispanic Native Hawaiians and Other Pacific Islanders; hawnh_0= P0020009 + 0.35*P0020016 + 0.175*P0020036 + 0.2*P0020020 + 0.1*P0020042 + 0.4*P0020023 + 0.2*P0020045 + 0.5*P0020027 + 0.25*P0020048 + 0.0625*(P0020011-P0020012) ; * Calculate non-Hispanic other race persons; othnh_0= P0020010 + 0.25*P0020013 + 0.05*P0020014 + 0.2*(P0020015+P0020016+P0020036) + 0.5*P0020017 + 0.1*P0020018 + 0.2*(P0020019+P0020020+P0020042) + 0.5*P0020021 + 0.2*(P0020022+P0020023+P0020045) + 0.75*P0020024 + 0.5*(P0020026+P0020027+P0020048) + 0.5*(P0020011-P0020012) ; * *------------------------------------------------------------------------------; * Hispanic: This mca1es single-race categories for Hispanics; *------------------------------------------------------------------------------; * Calculate Hispanic whites; whihs_0= P0010003-P0020005 + (0.25*P0010011)-(0.25*P0020013) + (0.8*P0010012)-(0.8*P0020014) + (0.45*(P0010013+P0010014+P0010034))-(0.45*(P0020015+P0020016+P0020036)) + (0.5*P0010015)-(0.5*P0020017) + (0.125*(P0010009-P0010010))-(0.125*(P0020011-P0020012)) ; * Calculate Hispanic blacks; blahs_0= P0010004-P0020006 + (05*P0010011)-(05*P0020013) + (0.8*P0010016)-(0.8*P0020018) + (0.6*(P0010017+P0010018+P0010040))-(0.6*(P0020019+P0020020+P0020042)) + (0.5*P0010019)-(0.5*P0020021) + (0.125*(P0010009-P0010010))-(0.125*(P0020011-P0020012)) ; * Calculate Hispanic Native Americans; indhs_0= P0010005-P0020007 + (0.15*P0010012)-(0.15*P0020014) + (0.1*P0010016)-(0.1*P0020018) + (0.4*(P0010020+P0010021+P0010043))-(0.4*(P0020022+P0020023+P0020045)) + (0.25*P0010022)-(0.25*P0020024) + (0.125*(P0010009-P0010010))-(0.125*(P0020011-P0020012)) ; * Calculate Hispanic Asian; asihs_0= (P0010006-P0020008) + (0.35*P0010013)-(0.35*P0020015) + (0.175*P0010034)-(0.175*P0020036) + (0.2*P0010017)-(0.2*P0020019) + (0.1*P0010040)-(0.1*P0020042) + (0.4*P0010020)-(0.4*P0020022) + (0.2*P0010043)-(0.2*P0020045) + (0.5*P0010024)-(0.5*P0020026) + (0.25*P0010046)-(0.25*P0020048) +(0.125*P0010009)-(0.125*P0020011); * Calculate Hispanic Pacific Islanders hawhs_0= (P0010007-P0010009) + (0.35*P0010014)-(0.35*P0020016) + (0.175*P0010034)-(0.175*P0020036) + (0.2*P0010018)-(0.2*P0020020) + (0.1*P0010040)-(0.1*P0020042) + (0.4*P0010021)-(0.4*P0020023) + (0.2*P0010043)-(0.2*P0020045) + (0.5*P0010025)-(0.5*P0020027) + (0.25*P0010046)-(0.25*P0020048) +(0.125*P0010010)-(0.125*P0020012); * Calculate Hispanic other race persons; othhs_0= P0010008-P0020010 + (0.25*P0010011)-(0.25*P0020013) + (0.05*P0010012)-(0.05*P0020014) + (0.2*(P0010013+P0010014+P0010034))-(0.2*(P0020015+P0020016+P0020036)) + (0.5*P0010015)-(0.5*P0020017) + (0.1*P0010016)-(0.1*P0020018) + (0.2*(P0010017+P0010018+P0010040))-(0.2*(P0020019+P0020020+P0020042)) + (0.5*P0010019)-(0.5*P0020021) + (0.2*(P0010020+P0010021+P0010043))-(0.2*(P0020022+P0020023+P0020045)) + (0.75*P0010022)-(0.75*P0020024) + (0.5*(P0010024+P0010025+P0010046))-(0.5*(P0020026+P0020027+P0020048)) + (0.5*(P0010009-P0010010))-(0.5*(P0020011-P0020012)) ; *------------------------------------------------------------------------------; * Age 18 and over: This mca1es single-race categories for adults; *------------------------------------------------------------------------------; * Calculate whites 18 and over; whi18_0= P0030003 + 0.25*P0030011 + 0.8*P0030012 + 0.45*(P0030013+P0030014+P0030034) + 0.5*P0030015 + 0.125*(P0030009-P0030010) ; * Calculate blacks 18 and over; bla18_0= P0030004 + 0.5*P0030011 + 0.8*P0030016 + 0.6*(P0030017+P0030018+P0030040) + 0.5*P0030019 + 0.125*(P0030009-P0030010) ; * Calculate Native Americans 18 and over; ind18_0= P0030005 + 0.15*P0030012 + 0.1*P0030016 + 0.4*(P0030020+P0030021+P0030043) + 0.25*P0030022 + 0.125*(P0030009-P0030010) ; * Calculate Asians 18 and over; asi18_0= P0030006 + 0.35*P0030013 + 0.175*P0030034 + 0.2*P0030017 + 0.1*P0030040 + 0.4*P0030020 + 0.2*P0030043 + 0.5*P0030024 + 0.25*P0030046 + 0.125*P0030009 ; * Calculate Pacific Islanders 18 and over; haw18_0= P0030007 + 0.35*P0030014 + 0.175*P0030034 + 0.2*(P0030017+P0030018+P0030040) + 0.4*(P0030020+P0030021+P0030043) + 0.5*(P0030024+P0030025+P0030046) + 0.125*(P0030009-P0030010) ; * Calculate other race persons 18 and over; oth18_0= P0030008 + 0.25*P0030011 + 0.05*P0030012 + 0.2*(P0030013+P0030014+P0030034) + 0.5*P0030015 + 0.1*P0030016 + 0.2*(P0030017+P0030018+P0030040) + 0.5*P0030019 + 0.2*(P0030020+P0030021+P0030043) + 0.75*P0030022 + 0.5*(P0030024+P0030025+P0030046) + 0.5*(P0030009-P0030010) ; *------------------------------------------------------------------------------; * non-hispanic age 18 and over; *------------------------------------------------------------------------------; * Calculate non-his whites 18 and over; whi18nh= P0040005 + 0.25*P0040013 + 0.8*P0040015 + 0.45*(P0040015+P0040016+P0040036) + 0.5*P0040017 + 0.125*(P0040011-P0040012) ; * Calculate non-his blacks 18 and over; bla18nh= P0040006 + 0.5*P0040013 + 0.8*P0040018 + 0.6*(P0040019+P0040020+P0040042) + 0.5*P0040021 + 0.125*(P0040011-P0040012) ; * Calculate non-his Native Americans 18 and over; ind18nh= P0040007 + 0.15*P0040015 + 0.1*P0040018 + 0.4*(P0040022+P0040023+P0040045) + 0.25*P0040024 + 0.125*(P0040011-P0040012) ; * Calculate non-his Asians 18 and over; asi18nh= P0040008 + 0.35*P0040015 + 0.175*P0040036 + 0.2*P0040019 + 0.1*P0040042 + 0.4*P0040022 + 0.2*P0040045 + 0.5*P0040026 + 0.25*P0040048 + 0.125*(P0040011-P0040012) ; *Calculate non-his Pacific Islanders; haw18nh= P0040009 + 0.35*P0040016 + 0.175*P0040036 + 0.2*P0040020 + 0.1*P0040042 + 0.4*P0040023 + 0.2*P0040045 + 0.5*P0040027 + 0.25*P0040048 + 0.125*(P0040011-P0040012) ; * Calculate non-his other race persons 18 and over; oth18nh=ROUND( P0040010 + 0.25*P0040013 + 0.05*P0040014 + 0.2*(P0040015+P0040016+P0040036) + 0.5*P0040017 + 0.1*P0040018 + 0.2*(P0040019+P0040020+P0040042) + 0.5*P0040021 + 0.2*(P0040022+P0040023+P0040045) + 0.75*P0040024 + 0.5*(P0040026+P0040027+P0040048) + 0.5*(P0040011-P0040012)) ; KEEP logrecno whi_0 bla_0 ind_0 asi_0 haw_0 oth_0 whinh_0 blanh_0 indnh_0 asinh_0 hawnh_0 othnh_0 whihs_0 blahs_0 indhs_0 asihs_0 hawhs_0 othhs_0 whi18_0 bla18_0 ind18_0 asi18_0 haw18_0 oth18_0 whi18nh bla18nh ind18nh asi18nh haw18nh oth18nh P0040011-P0040073; file nchsout lrecl=600; put logrecno 1-7 (whi_0 bla_0 ind_0 asi_0 haw_0 oth_0 whinh_0 blanh_0 indnh_0 asinh_0 hawnh_0 othnh_0 whi18_0 bla18_0 ind18_0 asi18_0 haw18_0 oth18_0 whi18nh bla18nh ind18nh asi18nh haw18nh oth18nh) (9.); run;