## Task 2b: How to Estimate Mean Nutrient Intakes from Foods and Beverages Using SAS

This section describes how to use SAS to estimate mean nutrient intakes from food and beverages – that is, using only data on the dietary recalls – along with standard errors.  To illustrate this, consumption of calcium from foods and beverages by children ages 6-11 is used as an example.

### Step 1: Compute Properly Weighted Estimated Means and Standard Errors

Sorting is not a necessary first step in SAS as it is in SUDAAN. Therefore, properly weighted estimated means and standard errors can be obtained via a single SAS procedure, PROC SURVEYMEANS.

In the sample below, the NOBS, MEAN, and STDERR options in the PROC SURVEYMEANS statement request that the number of observations, the estimated mean, and its estimated standard error, respectively, be printed for each analysis variable.  The DOMAIN statement designates the combination of variables required to obtain separate estimates by gender (RIAGENDR) within the cohort of interest (INCOH).  INCOH is a variable that has value 1 if the individual is “in the cohort” and zero otherwise.  Here, children ages 6 to 11 with complete and reliable recall data have INCOH=1.  The VAR statement is used to identify the variable of interest.  DR1TCALC is a variable available from the NHANES dataset that represents total dietary calcium (i.e., from foods and beverages, not supplements).  The FORMAT statement controls how levels of the RIAGENDR variable are printed on the output.    Note that the strata and PSU variables are identified with strata and cluster statements, respectively.  As in the SUDAAN example above, the weight variable being used is for the dietary recall Day 1 subsample (WTDRD1).

#### Sample Code

*-------------------------------------------------------------------------;
* Use the PROC SURVEYMEANS procedure in SAS to compute properly weighted  ;
* estimated means and standard errors                                     ; * To properly analyze subgroups using the proc survey means procedure, a  ;
* domain statement is used to form a 2-way table of INCOH by RIAGENDR.    ;
* “INCOH” means “in the cohort.”  In this example, the statistics of      ;
* interest are those where INCOH=1 in the table.                          ; *-------------------------------------------------------------------------;

proc surveymeans nobs mean stderr data = CALCMILK;
strata SDMVSTRA;
cluster SDMVPSU;
domain INCOH*RIAGENDR;
var DR1TCALC;
weight WTDRD1;
format RIAGENDR GENDER. ;
title1Estimated daily intake of total dietary Calcium”;
title2 "children age 6-11, WWEIA, NHANES 2003-2004 - using SAS" ;
run

#### Output of Program

```Estimated daily
intake of total dietary Calcium
children age 6-11, WWEIA, NHANES 2003-2004 - using SAS

The SURVEYMEANS Procedure
Data Summary

Number of Strata                                  15
Number of Clusters                                30
Number of Observations                         10122
Number of Observations Used                     9034
Number of Obs with Nonpositive Weights          1088
Sum of Weights                             286222757

Statistics
Std ErrorVariable    Label                      N            Mean         of Mean
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
DR1TCALC    Calcium (mg)            8894      918.299483       16.587039
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Gender -                                                                Std Error
Adjudicated    INCOH  Variable    Label            N         Mean         of Mean
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Male             0    DR1TCALC    Calcium (mg)    3933   1019.861839     21.283685
1    DR1TCALC    Calcium (mg)     422   1109.561331     48.847753
Female           0    DR1TCALC    Calcium (mg)    4061    801.555808     15.852863
1    DR1TCALC    Calcium (mg)     478    945.933037     48.341631
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ  ```

Highlights from the output include:
• 900 persons were included in the cohort of interest (INCOH=1); 422 boys and 478 girls.
• Unlike SUDAAN, SAS does not print out an overall mean for the cohort of interest, because of the different ways the subpopulation/subdomain analysis is specified.  The value of 918 mg for DR1TCALC is based upon all individuals in the dataset, not all individuals in the cohort of interest.  For this analysis, only the values for INCOH=1 in the output are of interest.
• Among all the children, the average calcium intake was not shown.  For boys in the cohort, it was 1110 mg, and for girls, it was 946 mg. These are estimates of the population mean intake of calcium on a given day among 6-11 year old boys and girls. As noted in the Key Concepts section, these means also represent the mean usual intakes of calcium for these age-sex groups in the population.