## Task 3b: How to Estimate Mean Nutrient Intakes from Supplements Using SAS

This section describes how to use SAS to estimate mean nutrient intakes from supplements, along with standard errors.  To illustrate this, consumption of supplemental calcium by females ages 20 and older is used as an example.

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

Use the PROC SURVEYMEANS procedure to compute properly weighted estimated means and standard errors.

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 the cohort of interest (INCOHF20) within each age group (AGEGRP).  INCOHF20 is a variable that has value 1 if the individual is “in the cohort” and zero otherwise.  Here, females ages 20 and older have INCOHF20=1.  As in the SUDAAN example above, the weight variable being used is for the MEC subsample (WTMEC2YR).

#### Sample Code

*-------------------------------------------------------------------------;
* Use the PROC SURVEYMEANS procedure in SAS to estimate mean intakes of   ;
* calcium from supplements using complex survey design factors (strata    ;
* and PSU)                                                                ;
*-------------------------------------------------------------------------;

proc surveymeans nobs mean stderr data = DEMOOSTS;
strata SDMVSTRA;
cluster SDMVPSU;
domain INCOHF20*AGEGRP;
var DAILYAVG;
weight WTMEC2YR;
format AGEGRP AGEGRP. ;
run ;

#### Output of Program

```
Data Summary

Number of Strata                                  15
Number of Clusters                                30
Number of Observations                         10122
Number of Observations Used                     9643
Number of Obs with Nonpositive Weights           479
Sum of Weights                             286222757

Statistics
Std Error
Variable               N            Mean         of Mean
--------------------------------------------------------
DAILYAVG            9618      142.999400        9.643379
--------------------------------------------------------

Domain Analysis: Age of subject*INCOHF20

Age of                                                                Std Error
subject    INCOHF20    Variable               N            Mean         of Mean
-------------------------------------------------------------------------------
20-39             0    DAILYAVG             767       62.602567        6.471849
1    DAILYAVG             885      135.856261       17.035929
40-59             0    DAILYAVG             653      148.634197       17.715262
1    DAILYAVG             679      251.803537       23.644341
>= 60             0    DAILYAVG             849      197.511972       14.782058
1    DAILYAVG             898      426.392544       26.575240
-------------------------------------------------------------------------------
```

Highlights from the output include:

• 9,643 observations (respondents) were read by the program; 479 were skipped because their sampling weight value was zero (ineligible)
• 2,462 respondents were in the cohort; 885 were ages 20-39; 679 were ages 40-59; and 898 were ages 60 or older.
• Females ages 20-39 reported 136 mg, while those ages 40-59 reported 252 mg, and those ages 60 and older reported 426 mg. These are estimates of the population mean intake of supplemental calcium on a given day, which is equivalent to the mean usual intake of supplemental calcium for these age groups in the population.
• The standard errors of these means were 17.0, 23.6, and 26.6, 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.  As we are not interested in those data, they can be ignored.