/* February 7, 2001 */ /* This program merges the ADULT and IFF (individual food) files and the Codebook look-up table from NHANES III with the newly created PSDB files to calculate the Pyramid Servings for NHANES III participants ages 2 and older who supplied complete and reliable 24-hour dietary recalls. /* In this program, mean Pyramid Servings for adult men ages 20 and older were calculated. Sampling weights were used. */ /* To calculate the correct standard errors, SUDAAN must be used. */ /* Remember to change the libname statement for your work environment. */ /* If you have any questions regarding this SAS program, please contact Beth Dixon, PhD Applied Research Program, NCI 6130 Executive Blvd, MSC 7344 EPN 4005 Rockville, MD 20852 Phone: 301 435 4986 Fax: 301 435 3710 Email: ld120i@nih.gov */ libname LIBNAME 'c:\NHANES III\Datasets'; data onea; set LIBNAME.adult (keep = seqn dmpfseq dmpstat hay10 dmarethn hssex hsageir hfa8r dmppir hav12r has28 wtpfex6 wtpfqx6 sdppsu6 sdpstra6 ); label seqn = 'subject id' dmpfseq = 'family id' dmpstat = 'interview-examination status' hay10 = 'quality of interview' dmarethn = 'race-ethnicity' hssex = 'gender' hsageir = 'age at interview - years' hfa8r = 'years of education by head of HH' dmppir = 'poverty income ratio' wtpfex6 = 'total MEC examined sample final weight' wtpfqx6 = 'total interviewed sample final weight' sdppsu6 = 'total pseudo-PSU' sdpstra6 = 'total pseudo-stratum' ; if hsageir >= 20; /* AGES 20 AND OLDER */ if hssex = 1; /* MEN ONLY */ /* USING IFF DATASET */; data oneb; set LIBNAME.iff; if drpstat = 1; /* KEEPING RELIABLE RECALLS ONLY */ foodcode = input(drpfcode,7.); /* Numeric format of drpfcode converted to character format with new name "food code" to merge with PSDB */ run; proc sort data = onea; by seqn; proc sort data = oneb; by seqn; data one; merge onea (in=a) oneb (in=b); by seqn; if a and b; run; /* add USDA food descriptions from codebook file */; data two; set LIBNAME.codebook; foodcode = input(drpfcode,7.); /* Numeric format of drpfcode converted to character format with new name "food code" to merge with PSDB */ run; proc sort data=one out=iffdata; by foodcode; proc sort data=two out=codebook; by foodcode; data iffdata; merge iffdata (in=a) codebook (in=b); by foodcode; if a; run; /* add PSDB */ data psdb; set LIBNAME.PSDB; foodcode = input(drpfcode,7.); /* Numeric format converted to character format to merge with iffdata */ run; proc sort data = iffdata; by foodcode; proc sort data = psdb; by foodcode; data combine; merge iffdata (in=a) psdb (in=b); by foodcode; if a; newgram = drpigw / 100; iadd_sug = newgram * add_sug; ia_bev = newgram * a_bev; idiscfat = newgram * discfat; id_chees = newgram * d_cheese; id_milk = newgram * d_milk; id_total = newgram * d_total; id_yogur = newgram * d_yogurt; if_citml = newgram * f_citmlb; if_other = newgram * f_other; if_total = newgram * f_total; ig_nwhl = newgram * g_nwhl; ig_total = newgram * g_total; ig_whl = newgram * g_whl; im_egg = newgram * m_egg; im_fish = newgram * m_fish; im_frank = newgram * m_frank; im_meat = newgram * m_meat; im_mpf = newgram * m_mpf; im_nutsd = newgram * m_nutsd; im_organ = newgram * m_organ; im_poult = newgram * m_poult; im_soy = newgram * m_soy; iv_dpyel = newgram * v_dpyel; iv_drkgr = newgram * v_drkgr; iv_legum = newgram * v_legume; iv_other = newgram * v_other; iv_potat = newgram * v_potato; iv_starc = newgram * v_starcy; iv_tomat = newgram * v_tomato; iv_total = newgram * v_total; meattot = m_mpf + m_egg + m_soy + m_nutsd; imeat = newgram * meattot; run; data try1; set combine; proc sort; by seqn; proc means noprint; by seqn; var drpigw iadd_sug ia_bev idiscfat id_chees id_milk id_total id_yogur if_citml if_other if_total ig_nwhl ig_total ig_whl im_egg im_fish im_frank im_meat im_mpf im_nutsd im_organ im_poult im_soy iv_dpyel iv_drkgr iv_legum iv_other iv_potat iv_starc iv_tomat iv_total imeat; output out=out1 sum=sumigw sumadd_s suma_bev sumdiscf sumd_che sumd_mil sumd_tot sumd_yog sumf_cit sumf_oth sumf_tot sumg_nwh sumg_tot sumg_whl summ_egg summ_fis summ_fra summ_mea summ_mpf summ_nut summ_org summ_pou summ_soy sumv_dpy sumv_drk sumv_leg sumv_oth sumv_pot sumv_sta sumv_tom sumv_tot summeat; proc sort data=onea; by seqn; proc sort data=out1; by seqn; data adddemo; merge onea (in=a) out1 (in=b); by seqn; if a and b; label sumigw = 'total grams of food' sumadd_s = 'tsp added sugars' suma_bev = 'total drinks of alcohol' sumdiscf = 'grams of discretionary fat' sumd_che = 'number of cheese servings' sumd_mil = 'number of milk servings' sumd_tot = 'total number of dairy servings' sumd_yog = 'number of yogurt servings' sumf_cit = 'number of citrus, melon, berry servings' sumf_oth = 'number of other fruit servings' sumf_tot = 'total number of fruit servings' sumg_nwh = 'number of non-whole grain servings' sumg_tot = 'total number of grain servings' sumg_whl = 'number of whole grain servings' summ_egg = 'oz lean meat equivalent from eggs' summ_fis = 'oz lean meat from fish, other seafood' summ_fra = 'oz lean meat from franks, luncheon meats' summ_mea = 'oz lean meat from beef, pork, lamb, etc' summ_mpf = 'oz lean meat from meat, poultry, fish' summ_nut = 'oz lean meat equivalent from nuts, seeds' summ_org = 'oz lean meat from organ meats' summ_pou = 'oz lean meat from poultry' summ_soy = 'oz lean meat equivalent from soy product' summeat = 'total number of meat and alternates' sumv_dpy = 'number of deep yellow vegetable servings' sumv_drk = 'number of dark green leafy vegetable servings' sumv_leg = 'number of dry bean and pea servings' sumv_oth = 'number of other vegetable servings' sumv_pot = 'number of white potato servings' sumv_sta = 'number of other starchy vegetable servings' sumv_tom = 'number of tomato servings' sumv_tot = 'total number of vegetable servings' ; run; data means; set adddemo; proc means n mean std stderr min max; var sumigw sumadd_s suma_bev sumdiscf sumd_che sumd_mil sumd_tot sumd_yog sumf_cit sumf_oth sumf_tot sumg_nwh sumg_tot sumg_whl summ_egg summ_fis summ_fra summ_mea summ_mpf summ_nut summ_org summ_pou summ_soy summeat sumv_dpy sumv_drk sumv_leg sumv_oth sumv_pot sumv_sta sumv_tom sumv_tot; weight wtpfex6; title 'FGP Servings for Men, Ages 20 and Older - Wtd Means' ; /* proc univariate; var sumigw sumadd_s suma_bev sumdiscf sumd_che sumd_mil sumd_tot sumd_yog sumf_cit sumf_oth sumf_tot sumg_nwh sumg_tot sumg_whl summ_egg summ_fis summ_fra summ_mea summ_mpf summ_nut summ_org summ_pou summ_soy summeat sumv_dpy sumv_drk sumv_leg sumv_oth sumv_pot sumv_sta sumv_tom sumv_tot; freq wtpfex6; title 'FGP Servings for Men, Ages 20 and Older - Wtd Means' ; */ run;