## Task 1b: How to Estimate Mean Food Intakes Using SAS

This section describes how to use SAS to estimate mean food intakes along with standard errors.  To illustrate this, consumption of milk is used as an example.  As explained in the key concepts section, there are different ways to group foods for analysis, and so it is with examining “milk” intakes.  One way is to consider only fluid milk reported separately—not as part of a combination—and another is to account for all milk and milk products—including milk, yogurt and cheese—whether reported separately or as part of a combination or mixture.  In the programs that follow, consumption of fluid milk not in combination, measured in grams, and consumption of all milk and milk products, measured in cup equivalents, are used as examples.

The following analyses are for children ages 6-11, and mean intakes are estimated among users.  Such estimates answer the question: on average, what quantity is consumed in a given day by users of the food?  Analysts interested in per capita consumption (that is, including zeroes for non-consumers) would need to specify that missing values should be set to zero.  See full program under Additional Resources for note about this.

### 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 FORMAT statement controls how levels of the RIAGENDR variable are printed on the output.  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 perform a subdomain analysis, form a 2-way table of INCOH   ;
* by RIAGENDR.  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 MILK0 D_TOTAL;
weight WTDRD1;
format RIAGENDR GENDER. ;
title1 "Estimated daily intake of fluid milk drunk by itself as a beverage;
and of total milk and milk products" ;
title2 "children age 6-11, WWEIA, NHANES 2003-2004 - using SAS" ; run ;

#### Output of Program

```Estimated daily intake of fluid milk drunk by itself as a beverage;       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 Error

Variable  Label                                                                    N            Mean       of Mean ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

MILK0     Fluid milk (g) consumed outside of a combination for consumers          2332      451.443365    12.905530

D_TOTAL   Total number of milk group (milk, yogurt & cheese) cupequivalents       8273        1.761007     0.048017
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Gender -                                                                                                       Std Error
Adjudic.  INCOH Variable Label                                                               N       Mean        of Mean
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Male        0   MILK0    Fluid milk (g) consumed outside of a combination for consumers     1034   503.310228   22.624207
D_TOTAL  Total number of milk group (milk, yogurt & cheese) cupequivalents  3615     1.916645    0.059658
1   MILK0    Fluid milk (g) consumed outside of a combination for consumers      143   395.289004   45.893677
D_TOTAL  Total number of milk group (milk, yogurt & cheese) cupequivalents   422     2.595515    0.162629
Female      0   MILK0    Fluid milk (g) consumed outside of a combination for consumers      984   426.001838   13.414503
D_TOTAL  Total number of milk group (milk, yogurt & cheese) cupequivalents  3758     1.500916    0.048613
1   MILK0    Fluid milk (g) consumed outside of a combination for consumers      171   305.434366   27.785526
D_TOTAL  Total number of milk group (milk, yogurt & cheese) cupequivalents   478     2.133974    0.141756
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

```

Highlights from the output include:

• 9,034 observations (respondents) were read by the program; 1,088 additional observations were skipped because their sampling weight value was zero (due to recall being unreliable or person otherwise ineligible).
• 900 respondents were included in this analysis; of these, 314 reported milk as a beverage; 143 were boys and 171 were girls.
• The mean intake was 395 gm for boys and 305 gm for girls.  These are estimates of the population mean intake of fluid milk 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 fluid milk for these age-sex groups in the population.
• The mean number of total milk group cup equivalents was 2.60 for boys and 2.13 for girls.  These are estimates of the population mean intake of total milk cup equivalents on a given day among 6-11 year old boys and girls and also represent the mean usual intakes of total milk cup equivalents for these age-sex groups in the population.
• The standard errors of these means were 45.9 and 27.8, respectively.  See the NHANES Analytic Guidelines for more information on how to interpret standard errors.
• Unlike the SUDAAN output, the SAS output provides data for individuals who are not in the cohort of children ages 6-11.  As we are not interested in those data, they can be ignored.

IMPORTANT NOTE

It is important to note that the analysis above was conducted using only children ages 6-11 who were consumers of milk as a beverage. If, however all members (i.e. consumers and non-consumers) of the selected age group were included (total n = 900; 422 males and 478 females), then the average amounts would be lower. For males, the mean milk intake would be 145 gm and for females, it would be 136 gm (see the full Milk program in the Additional Resources section for example code). These means represent the per capita consumption.