The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by smlneyman, 2019-01-16 01:35:47

NHANES Dietary Web Tutorial_397 pages

NHANES Dietary Web Tutorial_397 pages

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Print Text!

Task 2: Key Concepts about Measurement Error

Two of the primary challenges of dietary intake data are measurement error adjustment, and positively skewed data.
Regression calibration (see Module 21, Task 1 for more information on this topic) is a method for dealing with the former
challenge. In this method, the 24-hour recall data are replaced with a predictor of true intake, given the 24-hour recall
data. When the data are normally distributed, this estimate is fairly easy to obtain. However, when data are positively
skewed and must be transformed, the process for obtaining the regression calibration predictor involves numerical
integration. The NCI method uses adaptive Gaussian quadrature to obtain this estimate.

When regression calibration is used, it is necessary to include the covariates that will be used in the health parameter
model in the calculation of the regression calibration predictor. In other words,

Furthermore, the covariates X may comprise covariates that will aid in the prediction of estimating .These covariates may
include data from a food frequency questionnaire (FFQ). (It is assumed the food frequency information is not related to the
health parameter if true dietary intake is known.)

IMPORTANT NOTE
Note: If a food frequency variable is used as a covariate, BRR weights for the FFQ sample should be used.

This predictor is then used to estimate the relationship between usual dietary intake and the health parameter, using an
appropriate statistical model and a transformation of T (Box-Cox). BRR
is used to calculate standard errors (See Module 18, Task 4 for more information on this topic).
Software is available to apply this method, including the MIXTRAN, DISTRIB, and INDIVINT macros, which may be
downloaded from the NCI website.

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Info2.htm 1/1

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Print Text!

Task 2: How to Examine the Relationship Between Usual Intake of a Single
Ubiquitously-Consumed Dietary Constituent and Some Outcome

In this example, the relationship between calcium intake from foods and beverages and systolic blood pressure will be
modeled for adult women ages 19 years and older.

This example uses the demoadv dataset (download at Sample Code and Datasets). The variables w0304_0 to w0304_16
are the weights (sample weights and Balanced Repeated Replication [BRR] weights) used in the analysis of 2003-2004
dietary data that requires the use of BRR to calculate standard errors. The model is run 17 times, including 16 runs using
BRR (see Module 18, Task 4 for more information). BRR uses weights w0304_1 to w0304_16.

IMPORTANT NOTE

Note: if 4 years of NHANES data are used, 32 BRR runs are required.

A SAS macro is a useful technique for rerunning a block of code when the analyst only wants to change a few variables;
the macro BRR212 is created and called in this example. The BRR212 macro calls the MIXTRAN, DISTRIB, and INDIVINT
macros, and calculates BRR standard errors of the parameter estimates. The MIXTRAN macro obtains preliminary
estimates for the values of the parameters in the model, and then fits the model using PROC NLMIXED. It also produces
summary reports of the model fit. Recall that modeling the complex survey structure of NHANES requires procedures that
account for both differential weighting of individuals and the correlation among sample persons within a cluster. The SAS
procedure NLMIXED can account for differential weighting by using the replicate statement. The use of BRR to calculate
standard errors accounts for the correlation among sample persons in a cluster. Therefore, NLMIXED (or any SAS
procedure that incorporates differential weighting) may be used with BRR to produce standard errors that are suitable for
NHANES data without using specialized survey procedures. The DISTRIB macro estimates the distribution of usual intake,
producing estimates of percentiles and the percent of the population below a cutpoint.

The MIXTRAN, DISTRIB, and INDIVINT macros used in this example were downloaded from the NCI website. Version 1.1
of the macros was used. Check this website for macro updates before starting any analysis. Additional details regarding
the macros and additional examples also may be found on the website.

Step 1: Create one dataset so that each row corresponds to a single person day and define
indicator variables if necessary and create a second dataset for the INDIVINT macro

Statements Explanation

data demoadv; First, select only those people with
set nh.demoadv; dietary data by selecting those without
missing BRR weights.
if w0304_0 ne . ;
run ; Because the INDIVINT macro also
requires a dataset with 1 record per
data adultf; person, a dataset called adultf is created
set demoadv; for adult females ages 19 years and
if riagendr= 2 and ridageyr>= 19 ; older.
run ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 1/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data day1; The variables DR1TCALC and
set demoadv; DR2TCALC are NHANES variables
if riagendr= 2 and ridageyr>= 19 ; representing total calcium consumed on
DRTCALC=DR1TCALC; days 1 and 2 respectively from all foods
day= 1 ; and beverages (other than water). To
run ; create a dataset with 2 records per
person, the demoadv dataset is set 2
data day2; times to create 2 datasets, one where
set demoadv; day=1 and one where day=2. The same
if riagendr= 2 and ridageyr>= 19 ; variable name, DRTCALC, is used for
DRTCALC=DR2TCALC; calcium on both days. It is created by
day= 2 ; setting it equal to DR1TCALC for day 1
run ; and DR2TCALC for day 2.

data calcium; Finally, these data sets are appended.
set day1 day2;
run ;

Step 2: Sort the dataset by respondent and day

It is important to sort the dataset by respondent and day of intake because the NLMIXED procedure uses this information
to estimate the model parameters.
proc sort ; by seqn day; run ;

Step 3: Create the BRR212 macro

The BRR212 macro calls the MIXTRAN macro and computes standard errors of parameter estimates. After creating this
macro and running it 1 time, it may be called several times, each time changing the macro variables.

Statements Explanation

%include This code reads the MIXTRAN,

'C:\NHANES\Macros\mixtran_macro_v1.1.sas' DISTRIB, and INDIVINT macros
; into SAS so that these macros
%include
'C:\NHANES\Macros\indivint_macro_v1.1.sas' may be called.

;

%include
'C:\NHANES\Macros\distrib_macro_v1.1.sas'
;

title2 "Task 2 - Calcium Intake and This title should be printed on all
Systolic Blood Pressure" ; output.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 2/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

%macro BRR212(data, response, datam, The start of the BRR212 macro is

var12, regresponse, foodtype, subject, defined. All of the terms inside the
repeat, covars_prob, covars_amt, outlib,
modeltype, lambda, covars_reg, seq, parentheses are the macro
weekend, vargroup, numvargroups, subgroup, variables.

start_val1, start_val2, start_val3,
vcontrol, nloptions, titles, printlevel,
cutpts, ncutpts, nsim_mc, byvar, t0, t1,
final);

%MIXTRAN (data=&data, response=&response, Within the BRR212 macro, the
foodtype=&foodtype, subject=&subject, MIXTRAN macro is called. All of
repeat=&repeat, covars_prob=&covars_prob, the variables preceded by & will be
covars_amt=&covars_amt, outlib=&outlib, defined by the BRR212 macro
modeltype=&modeltype, call. The only variable without an
lambda=&lambda, replicate_var=w0304_0, & is the replicate_var macro
seq=&seq, weekend=&weekend, variable; it is set to w0304_0 for
vargroup=&vargroup, numvargroups= the first run.
&numvargroups, subgroup=&subgroup,
start_val1=&start_val1, Input datasets for the INDIVINT
start_val2=&start_val2, start_val3= macro are created. The datasets
&start_val3, vcontrol= &vcontrol, _pred_unc_&foodtype and
nloptions=&nloptions, titles= &titles, _param_unc_&foodtype are
printlevel= &printlevel) created in the MIXTRAN run. The
data parampred(keep = &subject a_var_u2 syntax “if (_n_=1) then set” is a
a_var_e a_lambda x2b2); way of doing a 1-to-many merge,
if (_n_ = 1 ) then set & outlib.._ where the dataset
param_unc_&foodtype; _param_unc_&foodtype is merged
set & outlib.._ pred_unc_&foodtype; with each row of the
run; _pred_unc_&foodtype dataset.

data parsubj1rec; The INDIVINT macro requires a
merge parampred &datam(keep = &subject dataset with only one line per
person called parsubj1rec. This is
&var12); defined by the macro variable
by &subject; datam in the BRR212 macro, and
the response variables are defined
run; by the macro variable var12.
title&titles;
title %eval (&titles+ 1 ); This code clears the titles created
in the DISTRIB macro and resets
the title for the example.

title "Task 2 - Calcium Intake and
Systolic Blood Pressure" ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 3/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

%DISTRIB (seed= 0 , nsim_mc= 100 The DISTRIB macro is used to find
,modeltype=&modeltype, pred=& outlib.._ the lambda for the transformation
pred_unc_&foodtype, param= & outlib.._ of the estimate of T (true usual
param_unc_&foodtype, outlib=&outlib, intake) that will be used in the
subject=&subject,food=&foodtype); regression model.

data _dist; The dataset
set & outlib..d descript_&foodtype_w0304_0 is
escript_&foodtype._w0304_0; from the DISTRIB macro. The
keep tpercentile1-tpercentile99; percentiles are saved from this
dataset.

run;

data _lambda (keep=lambda sse); This code finds the best lambda to
set _dist;
array Z (*) Z1-Z99; transform the estimate of T. This is
array T (*) T1-T99; done by finding the lambda that
array CP (*) CP1-CP99; minimizes the error sum of

array P (*) tpercentile1-tpercentile99; squares. Z is the inverse of the
normal cumulative distribution

do i= 1 to dim(z); function (probit). At the end of the

Z(i) = probit((i - 0.375 ) / 99.25 ); code, the best lambda is saved as
end;
a macro variable called lamt.

MZ = mean(of Z1-Z99);
SZZ = CSS(of Z1-Z99);
best_SSE = SZZ;
best_lambda = 0 ;
do lambda = 0 to 1 by 0.01 ;

do i = 1 to 99 ;
if (lambda = 0 ) then T(i) =

log(P(i));
else T(i) = (P(i)**lambda - 1 ) /

lambda;
end;

MT = mean(of T1-T99);
STT = CSS(of T1-T99);
do i = 1 to 99 ;

CP(i) = (T(i) - MT) * (Z(i) - MZ);
end;

STZ = sum(of CP1-CP99);

SSE = SZZ - ((STZ** 2 )/STT);
if (SSE < best_SSE) then do;
best_SSE = SSE;
best_lambda = lambda;
end;
end;

lambda = best_lambda;
sse = best_sse;
call symput( 'lamt' ,lambda);
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 4/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc univariate data=&data noprint; The minimum amount consumed
where &response> 0 ; on a consumption day is
var &response; calculated and saved in a dataset
output out=outmin_amt min=min_amt; called outmin_amt.

run;

data paramsubj1rec; The minimum amount is added to

if _n_= 1 then set outmin_amt; the dataset. Zero values are set to
set parsubj1rec;
lamt = &lamt; ½ of the mimimum amount. The
array zero( 2 ) &var12; dataset is sorted by subject. The
do i= 1 to 2 ; variable lamt is created from the
if zero[i]= 0 then zero[i]=(min_amt/ 2 ); macro value lamt that was created
end; previously.

run;

proc sort; by &subject; run;

%indivint(model12= 1 , The INDIVINT macro is called.

subj1recdata=paramsubj1rec, Because we are fitting a one-part
recid=&subject, r24vars=&var12,
min_amt=min_amt, var_u1=, var_u2=a_var_u2, model, the macro variable
cov_u1u2=, var_e=a_var_e, lambda=a_lambda, model12 is set equal to 1. This
xbeta1=, xbeta2=x2b2, boxcox_t_lamt=y, macro uses the dataset with 1

lamt=lamt, dencalc=y, denopt=y, u1nlmix=, record per person
u2nlmix=, titles=&titles, notesprt=y); (paramsubj1rec), and specifies the

two 24-hour recall variables

(var12). The minimum amount

that was saved in the

paramsubj1rec dataset is specified

for the min_amt macro variable, as

are the parameters that are saved

in that dataset, including

a_var_u2, a_var_e, and

a_lambda. The macro variable

boxcox_t_lamt is set to y for ‘Yes’,

indicating that a Box-Cox

parameter is specified. This

parameter is lamt, which was

defined in the paramsubj1rec

dataset in the last step. The

macro variables dencalc, denopt,

and notesprt are set to y for ‘Yes’,

indicating that denominator

integration is perfomed,

denominator optimization is

performed, and notes are printed

in the SAS log, respectively.

data subj1recres; The dataset _resdata is created in
merge &datam _resdata(keep = &subject the INDIVINT macro. It is merged
with the dataset adultf.
indusint);
by &subject;

run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 5/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc reg data=subj1recres outest=regout; The regression model is run using
freq w0304_0; the expected usual intake from the
model &regresponse = indusint INDIVINT macro, called indusint.
Because boxcox_t_lamt was set to
&covars_reg; y, this variable was already
title %eval (&titles+ 1 ) "Regression transformed in the INDIVINT
Model: Adjusted for Measurement Error" ; macro, using the value of lamt in a
Box-Cox transformation.

data diethealthout0; The output dataset from the
set regout(rename = (indusint=rcbeta)); regression above (regout) is set,
lamt = &lamt; and the parameter for the
t0boxcox = (&t0**lamt - 1 )/lamt; expected true usual intake is
t1boxcox = (&t1**lamt - 1 )/lamt; renamed to rcbeta. In addition,
tdiffrcbeta = (t1boxcox - lamt is saved, and the variables
t0boxcox and t1boxcox and their
t0boxcox)*rcbeta; difference multipled by rcbeta are
run; computed. The macro variables t0
and t1 are set to a range that is
relevant to the data, e.g., the 10th
and 90th percentile.

proc datasets nolist; delete parampred Unneeded datasets are deleted.
parsubj1rec paramsubj1rec subj1recres
_resdata regout; run; This code starts a loop to run the
%do run= 1 %to 16 ; 16 BRR runs.

%put ~~~~~~~~~~~~~~~~~~~ Run &run The run number is printed to the
~~~~~~~~~~~~~~~~~~~~; log.

%MIXTRAN (data=&data, response=&response, Within the BRR212 macro, the
foodtype= &foodtype, subject=&subject, MIXTRAN macro is called. All of
repeat=&repeat, the variables preceded by & will be
covars_prob=&covars_prob, defined by the BRR212 macro
covars_amt=&covars_amt, outlib=&outlib, call. The only variable without an
modeltype=&modeltype, lambda=&lambda, & is the replicate_var macro
replicate_var=w0304_&run, seq=&seq, variable; it is set to w0304_&run
weekend=&weekend, vargroup=&vargroup, where &run equals 1 to 16.
numvargroups= &numvargroups,
subgroup=&subgroup, Input datasets for the INDIVINT
start_val1=&start_val1, macro are created. The datasets
start_val2=&start_val2, _pred_unc_&foodtype and
start_val3=&start_val3, _param_unc_&foodtype are
vcontrol=&vcontrol, nloptions=&nloptions, created in the MIXTRAN run. The
titles= &titles, printlevel=&printlevel) syntax “if (_n_=1) then set” is a
data parampred(keep = &subject a_var_u2 way of doing a 1-to-many merge,
a_var_e a_lambda x2b2); where the dataset
_param_unc_&foodtype is merged
if (_n_ = 1 ) then set & outlib.._ with each row of the
param_unc_&foodtype; set & outlib.._ _pred_unc_&foodtype dataset.
pred_unc_&foodtype;

run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 6/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data parsubj1rec; The INDIVINT macro requires a
merge parampred &datam(keep = &subject dataset with only one line per
person called parsubj1rec. This is
&var12); defined by the macro variable
by &subject; datam in the BRR212 macro, and
the response variables are defined
run; by the macro variable var12.

proc univariate data=&data noprint; The minimum amount consumed
where &response> 0 ; on a consumption day is
var &response; calculated and saved in a dataset
output out=outmin_amt min=min_amt; called outmin_amt.

run;

data paramsubj1rec; The minimum amount is added to

if _n_= 1 then set outmin_amt; the dataset. Zero values are set to
set parsubj1rec;
½ of the mimimum amount. The
array zero( 2 ) &var12;
dataset is sorted by subject. The
do i= 1 to 2 ;
variable lamt is created from the
if zero[i]= 0 then zero[i]=(min_amt/ 2 );
end; macro value lamt that was created
lamt = &lamt; previously.

run;

%indivint(model12= 1 , The INDIVINT macro is called.

subj1recdata=paramsubj1rec, Because we are fitting a one-part
recid=&subject, r24vars=&var12,
min_amt=min_amt, var_u1=, var_u2=a_var_u2, model, the macro variable
cov_u1u2=, var_e=a_var_e, lambda=a_lambda,
xbeta1=, xbeta2=x2b2, boxcox_t_lamt=y, model12 is set equal to 1. This
macro uses the dataset with 1

lamt=lamt, dencalc=y, denopt=y, u1nlmix=, record per person
u2nlmix=, titles=&titles, notesprt=y); (paramsubj1rec), and specifies the

two 24-hour recall variables

(var12). The minimum amount

that was saved in the

paramsubj1rec dataset is specified

for the min_amt macro variable, as

are the parameters that are saved

in that dataset, including

a_var_u2, a_var_e, and

a_lambda. The predicted values

x2b2 from the MIXTRAN run are

specified. The macro variable

boxcox_t_lamt is set to y for ‘Yes’,

indicating that a Box-Cox

parameter is specified. This

parameter is lamt, which was

defined in the paramsubj1rec

dataset in the last step. The

macro variables dencalc, denopt,

and notesprt are set to y for ‘Yes’,

indicating that denominator

integration is perfomed,

denominator optimization is

performed, and notes are printed

in the SAS log, respectively.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 7/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data subj1recres; The dataset _resdata is created in
merge &datam _resdata(keep = &subject the INDIVINT macro. It is merged
with the dataset adultf.
indusint);
by &subject; The regression model is run using
the expected usual intake from the
run; INDIVINT macro, called indusint.
Because boxcox_t_lamt was set to
proc reg data=subj1recres outest=regout; y, this variable was already
freq w0304_&run; transformed in the INDIVINT
model &regresponse = indusint macro, using the value of lamt in a
Box-Cox transformation. Title3 is
&covars_reg; reset.
title %eval (&titles+ 1 ) "Regression

Model: Adjusted for Measurement Error" ;

data diethealthout; The output dataset from the
set regout(rename = (indusint=rcbeta)); regression above (regout) is set,
lamt = &lamt; and the parameter for the
t0boxcox = (&t0**lamt - 1 )/lamt; expected true usual intake is
t1boxcox = (&t1**lamt - 1 )/lamt; renamed to rcbeta. In addition,
tdiffrcbeta = (t1boxcox - lamt is saved, and the variables
t0boxcox and t1boxcox and their
t0boxcox)*rcbeta; difference multipled by rcbeta are
run; computed. The macro variables t0
and t1 are set to a range that is
relevant to the data, e.g., the 10th
and 90th percentile.

proc append base=brr_runs The BRR datasets are appended
data=diethealthout; into a dataset called brr_runs.
run;
proc datasets nolist; delete parampred After appending the information to
parsubj1rec paramsubj1rec subj1recres brr_runs, diethealthout and the
_resdata regout diethealthout; run; other datasets created in the BRR
runs can be deleted.

%end ; The BRR runs end.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 8/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data _null_; This code creates macro calls that
format list listd listsum $255. ; are a list of the variables with the
%let I=1; prefix ‘b’ and ‘db’.
%let varamtu= %upcase (&covars_reg);

%do %until ( %qscan (&varamtu,&I, %str ( ))=

%str ());

%let varb&I= %qscan (&varamtu,&I, %str (
));

num= %eval (&i+ 1 );

varA= strip( "&&varb&i." );

list = trim(list)|| ' ' || 'b'
||trim(varA);

listd = trim(listd)|| ' ' || 'db'
||trim(varA);

listsum = trim(listsum)|| ' ' ||

'sum_db' ||trim(varA);

%let I= %eval (&I+1);

%end ;

%let cnt= %eval (&I-1);

%if &covars_reg= %str () %then %let cnt=0;

call symput( 'list' ,list);

call symput( 'listd' ,listd);

call symput( 'listsum' ,listsum);
run;

data parambrr; The brr_runs dataset is set, and a
set brr_runs; new dataset is created. This
rename rcbeta=brcbeta dataset renames the BRR
tdiffrcbeta=btdiffrcbeta parameters to have a prefix of ‘b’
intercept=bintercept; using a rename statement and the
array covs (&cnt) &covars_reg;
array newname (&cnt) &list; macro calls created above.

do i= 1 to &cnt;
newname[i]=covs[i];
end;
data parambrr;
set parambrr;
keep bintercept brcbeta btdiffrcbeta &list
run;
run;

data ss; The estimates from the first run
if _n_= 1 then set diethealthout0; are merged with the BRR
set parambrr; estimates, and the squared
array bvar (*) bintercept brcbeta difference is computed for each
BRR run.
btdiffrcbeta &list;
array varo (*)intercept rcbeta

tdiffrcbeta &covars_reg;
array dsqr (*) dbintercept dbrcbeta

dbtdiffrcbeta &listd;

do i= 1 to dim(bvar);

dsqr[i]=(bvar[i]-varo[i])** 2 ;
end;
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 9/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc means data=ss sum; The sum of squares is computed.
var dbintercept dbrcbeta dbtdiffrcbeta
The standard errors are computed.
&listd;
output out=sums sum=sum_dbintercept The point estimates are merged
with the standard errors.
sum_dbrcbeta sum_dbtdiffrcbeta &listsum; The data are transposed.
run; The final dataset is created, and p-
values and 95% confidence
data brr; intervals are computed.
set sums;
array sumt (*) sum_dbintercept The final dataset is printed.
The end of the BRR212 macro is
sum_dbrcbeta sum_dbtdiffrcbeta &listsum; indicated.
array se (*) intercept rcbeta

tdiffrcbeta &covars_reg;
do j= 1 to dim(sumt);
se[j]=sqrt((sumt[j])/( 16 * .49 ));
end;
keep intercept rcbeta tdiffrcbeta

&covars_reg;
run;

data wparms;
set diethealthout0 brr;

keep intercept rcbeta tdiffrcbeta
&covars_reg;

proc transpose data=wparms out=wparmst;
run;

data &final;
format pvalue 6.4 ;
set wparmst(rename=(col1=estimate

col2=brrse));
waldchisq = (estimate/brrse)** 2 ;
pvalue = 1 - probchi(waldchisq, 1 );
lower95lim = estimate - 1.96 *brrse;
upper95lim = estimate + 1.96 *brrse;
drop _label_;

run;

proc print;
run;

%mend BRR212;

Step 4: Call the BRR212 macro

Statements Explanation

%BRR212(data=calcium, This code calls the BRR212 macro.
response=DRTCALC, datam=adultf, The dataset calcium defined in Step 1 is
var12=dr1tcalc dr2tcalc, used; the macro variable response for
regresponse=mean_sbp, which we want to model the distribution
foodtype=Calcium, subject=seqn, is DRTCALC. We also have to define a
repeat=day, seq=, dataset with one line per person, datam,
covars_amt=ridageyr, which is set equal to the dataset adultf,
covars_reg=ridageyr, weekend=, calculated in Step 1. The response
outlib=work, modeltype=amount, variables for this dataset are defined by
titles= 2 , printlevel= 2 , nsim_mc=

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 10/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

100 , t0= 424 , t1= 1200 , macro variable var12 and equal
final=nh.m21task2) DR1TCALC and DR2TCALC. The
dependent variable for the regression is
mean_sbp.

The macro variable foodtype is used to
label the datasets from the MIXTRAN
and DISTRIB macros. The variable
seqn identifies the subject, and the
macro variable repeat defines the
variable that identifies the repeats on
the subject, which is day. The
covars_amt macro variable needs to
include the covariates for the usual
intake model, which is defined by
ridageyr. The same covariates must be
put in the macro variable covars_reg;
however, there may be additional
variables in covars_amt that are not in
covars_reg.

Note that a numeric id is required for
“subject” in the INDIVINT macro.

The macro variable outlib specifies the
library where the data are to be stored.
In this case, the working directory, work,
was used. Because this is a ubiquitously
consumed dietary constituent,
modeltype= amount is specified. This
fits the amount model.

The macro variable titles saves 2 lines
for titles supplied by the user. The
printlevel is 2, which prints the output
from the NLMIXED runs and the
summary.

The macro variable nsim_mc is used to
specify the number of pseudo-
individuals for which the distribution is
simulated per respondent.

The macro variables t0 and t1 must be
specified. In this case, the approximate
10th and 90th percentiles of the
distribution were used.

The variable final specifies the name of
the final dataset produced.

IMPORTANT NOTE

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 11/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

Although the macro variable weekend is
defined in the macro, this macro
currently is not capable of adjusting for
weekends as described earlier in the
course (see Module 18, Task 3 for more
information) as the DISTRIB macro
does.

WARNING

Note that SAS 9.2 TS1MO will produce an error with missing data in PROC IML, which is used in the INDIVINT macro.
The problem is fixed in SAS 9.2 TS2M2. The SAS Problem Note documents the problem. From the HOT FIX tab a link
to download the hot fix is available. This error is not encountered in SAS 9.1.3.

Step 5: Interpret output

Depending on the printlevel selected, the output from each NLMIXED run will be printed in the output. The first
NLMIXED output (replicate variable w0304_0) is a listing of the parameter estimates for the estimation of calcium.
However, the standard errors are incorrect; BRR is needed to obtain the correct standard errors. The regression
model is also output for the base model. The other NLMIXED and REG runs are from the BRR replications.
The regression parameters and standard errors are printed at the end of the output.

The parameter rcbeta represents the relationship between usual intake of calcium ( ) and systolic blood pressure.
The difference between 1200 mg and 424 mg of calcium (recall we defined the macro variables t0=424, t1=1200) is
associated with a decrease in systolic blood pressure of -1.2 mg Hg. This is not statistically significant (p=0.49).
IMPORTANT NOTE
Note: Your results may vary slightly, as a random seed is used to estimate the distribution of usual intake. However, they
would not be expected to vary by more than 1%.

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task2.htm 12/12

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 3

Print Text!

Task 3: Key Concepts about Examining the Relationship Between Usual
Intake of a Single Episodically-consumed Dietary Constituent and Some
Outcome

Two of the primary challenges of dietary intake data are measurement error adjustment, and positively skewed data.
Regression calibration (see Module 21, Task 1 for more information on this topic) is a method for dealing with the former
challenge. In this method, the 24-hour recall data are replaced with a predictor of true intake, given the 24-hour recall
data. When the data are normally distributed, this estimate is fairly easy to obtain. However, when data are positively
skewed and must be transformed, the process for obtaining the regression calibration predictor involves numerical
integration. The NCI method uses adaptive Gaussian quadrature to obtain this estimate.

When interest is in modeling an episodically-consumed dietary component in relation to a health outcome, additional
challenges arise. These include many days of zero intakes, and a correlation between the probability of consuming a food
and the amount consumed on a consumption day. In addition, when modeling health parameters, it is almost always
necessary to include covariates to adjust for potential confounders (see Module 17, Task 3 for a discussion of
confounders). The NCI method for relating usual intake of an episodically consumed food to a health parameter has been
developed to meet these challenges, in addition to the challenges mentioned previously. Essentially, a two-part model is
used to model both the probability of consumption of the episodically-consumed dietary constituent and the consumption
day amount, using the model that is at the core of the NCI method. After fitting the model, numerical integration is used to
estimate the regression calibration predictor. When regression calibration is used, it is necessary to include the covariates
that will be used in the health parameter model in the calculation of the regression calibration predictor, i.e.,

Furthermore, the covariates X may comprise covariates that will aid in the prediction of .These covariates may include
data from a food frequency questionnaire (FFQ). (It is assumed the food frequency information is not related to the health
parameter if true dietary intake is known.) This predictor is then used to estimate the relationship between usual dietary
intake and the health parameter, using an appropriate statistical model. Balanced repeated replication (BRR) (see Module
18, Task 4 for more information on this topic) is used to calculate standard errors.

IMPORTANT NOTE

Note: If a food frequency variable is used as a covariate, BRR weights for the FFQ sample should be used.

Software is available to apply this method, including the MIXTRAN, DISTRIB, and INDIVINT macros, which may be
downloaded from the NCI website.

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Info3.htm 1/1

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Print Text!

Task 3: How to Examine the Relationship Between Usual Intake of a Single
Episodically-consumed Dietary Constituent and Some Outcome

In this example, the relationship between milk intake and osteoporosis treatment status (treatosteo) will be modeled. A
participant was coded as having had treatment for osteoporosis if he or she responded “yes” to OSQ.070 (“{Were you/Was
SP} treated for osteoporosis?”) from the osteoporosis questionnaire, and was set to “no” if he or she responded “no” to
OSQ.070 or to OSQ.060 (“Has a doctor ever told {you/SP} that {you/s/he} had osteoporosis, sometimes called thin or
brittle bones?”) from the osteoporosis questionnaire. (The SAS code to create this variable is found in the “Supplement
Program” sample SAS code.)

This example uses the demoadv dataset (download at Sample Code and Datasets). The variables w0304_0 to
w0304_16 are the weights (dietary weights and balanced repeated replication (BRR) weights) used in the analysis of
2003-2004 dietary data that requires the use of BRR to calculate standard errors. The model is run 17 times, including 16
runs using BRR (see Module 18, Task 4 for more information). BRR uses weights w0304_1 to w0304_16.

IMPORTANT NOTE

Note: If 4 years of NHANES data are used, 32 BRR runs are required. Additional weights are found in the demoadv
dataset.

A SAS macro is a useful technique for rerunning a block of code when the analyst only wants to change a few variables;
the macro BRR212 is created and called in this example. The BRR212 macro calls the MIXTRAN, DISTRIB, and INDIVINT
macros, and calculates BRR standard errors of the parameter estimates. The MIXTRAN macro obtains preliminary
estimates for the values of the parameters in the model, and then fits the model using PROC NLMIXED. It also produces
summary reports of the model fit. Recall that modeling the complex survey structure of NHANES requires procedures that
account for both differential weighting of individuals and the correlation among sample persons within a cluster. The SAS
procedure NLMIXED can account for differential weighting by using the replicate statement. The use of BRR to calculate
standard errors accounts for the correlation among sample persons in a cluster. Therefore, NLMIXED (or any SAS
procedure that incorporates differential weighting) may be used with BRR to produce standard errors that are suitable for
NHANES data without using specialized survey procedures. The DISTRIB macro estimates the distribution of usual intake,
producing estimates of percentiles and the percent of the population below a cutpoint.

IMPORTANT NOTE
Note that the DISTRIB macro currently requires at least 2 cutpoints be requested in order to calculate the percent of the
population below a cutpoint.

The MIXTRAN, DISTRIB, and INDIVINT macros used in this example were downloaded from the NCI website. Version
1.1 of the macros was used. Check this website for macro updates before starting any analysis. Additional details
regarding the macro and additional examples also may be found on the website and in the users’ guide.

Step 1: Create one dataset so that each row corresponds to a single person day and define
indicator variables if necessary, and create a second dataset for the INDIVINT macro

Statements Explanation

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 1/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data demoadv; First, select only those people with
set nh.demoadv; dietary data by selecting those without
missing BRR weights.
if w0304_0 ne . ;
run ; Because the INDIVINT macro also
requires a dataset with 1 record per
data adultf; person, a dataset called adultf for adult
set demoadv; females ages 19 years and older is
if riagendr= 2 and ridageyr>= 19 ; created.
run ;

data day1; The variables d_milk_d1 and d_milk_d2
set demoadv; are calculated variables representing
if riagendr= 2 and ridageyr>= 19 ; total milk consumed on days 1 and 2
d_milk=d_milk_d1; respectively from all foods and
day= 1 ; beverages (see Module 4, Task 2 and
run ; Module 9, Task 4 for more details). To
create a dataset with 2 records per
data day2; person, the demoadv dataset is set 2
set demoadv; times to create 2 datasets, one where
if riagendr= 2 and ridageyr>= 19 ; day=1 and one where day=2. The same
d_milk=d_milk_d2; variable name, d_milk, is used for
day= 2 ; calcium on both days. It is created by
run ; setting it equal to d_milk_d1 for day 1
and d_milk_d2 for day 2.

data milk; Finally, these data sets are appended.
set day1 day2;
run ;

Step 2: Sort the dataset by respondent and day

It is important to sort the dataset by respondent and day of intake because the NLMIXED procedure uses this information
to estimate the model parameters.
proc sort ; by seqn day; run ;

Step 3: Create the BRR212 macro

The BRR212 macro calls the MIXTRAN macro and computes standard errors of parameter estimates. After creating this
macro and running it 1 time, it may be called several times, each time changing the macro variables.

Statements Explanation

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 2/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

%include This code reads the MIXTRAN,

'C:\NHANES\Macros\mixtran_macro_v1.1.sas' DISTRIB, and INDIVINT macros
; into SAS so that these macros
%include
'C:\NHANES\Macros\indivint_macro_v1.1.sas' may be called.

;

%include
'C:\NHANES\Macros\distrib_macro_v1.1.sas'
;

title2 "Task 3 - Milk and Osteoporosis This title should be printed on all
Treatment" ; output.

%macro BRR212(data, response, datam, The start of the BRR212 macro is

var12, regresponse, foodtype, subject, defined. All of the terms inside the
repeat, covars_prob, covars_amt, outlib,
modeltype, lambda, covars_reg, seq, parentheses are the macro
weekend, vargroup, numvargroups, subgroup, variables.

start_val1, start_val2, start_val3,
vcontrol, nloptions, titles, printlevel,
cutpts, ncutpts, nsim_mc, byvar, t0, t1,
final);

%MIXTRAN (data=&data, response=&response, Within the BRR212 macro, the
foodtype=&foodtype, subject=&subject, MIXTRAN macro is called. All of
repeat=&repeat, covars_prob=&covars_prob, the variables preceded by & will be
covars_amt=&covars_amt, outlib=&outlib, defined by the BRR212 macro
modeltype=&modeltype, call. The only variable without an
lambda=&lambda, replicate_var=w0304_0, & is the replicate_var macro
seq=&seq, weekend=&weekend, variable; it is set to w0304_0 for
vargroup=&vargroup, numvargroups= the first run.
&numvargroups, subgroup=&subgroup,
start_val1=&start_val1, Input datasets for the INDIVINT
start_val2=&start_val2, start_val3= macro are created. The datasets
&start_val3, vcontrol= &vcontrol, _pred_unc_&foodtype and
nloptions=&nloptions, titles= &titles, _param_unc_&foodtype are
printlevel= &printlevel) created in the MIXTRAN run. The
syntax “if (_n_=1) then set” is a
data parampred(keep = &subject a_var_u2 way of doing a 1-to-many merge,
a_var_e a_lambda x2b2); where the dataset
if (_n_ = 1 ) then set & outlib.._ _param_unc_&foodtype is merged
param_unc_&foodtype; with each row of the
set & outlib.._ pred_unc_&foodtype; _pred_unc_&foodtype dataset.
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 3/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data parsubj1rec; The INDIVINT macro requires a
merge parampred &datam(keep = &subject dataset with only one line per
person called parsubj1rec. This is
&var12); defined by the macro variable
by &subject; datam in the BRR212 macro, and
the response variables are defined
run; by the macro variable var12.

%DISTRIB (seed= 0 , nsim_mc= 100 The DISTRIB macro is used to find
,modeltype=&modeltype, pred=& outlib.._ the lambda for the transformation
pred_&foodtype, param= & outlib.._ of the estimate of T (true usual
param_&foodtype, outlib=&outlib, intake) that will be used in the
subject=&subject,food=&foodtype); regression model.

title&titles; This code clears the titles created
title %eval (&titles+ 1 ); in the DISTRIB macro and resets
the title for the example.

title "Task 3 - Milk and Osteoporosis
Treatment" ;

data _dist; The dataset
set & outlib..d descript_&foodtype_w0304_0 is
escript_&foodtype._w0304_0; from the DISTRIB macro. The
keep tpercentile1-tpercentile99; percentiles are saved from this
run; dataset.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 4/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data _lambda (keep=lambda sse); This code finds the best lambda to
set _dist;
array Z (*) Z1-Z99; transform the estimate of T. This is
array T (*) T1-T99; done by finding the lambda that
array CP (*) CP1-CP99; minimizes the error sum of

array P (*) tpercentile1-tpercentile99; squares. Z is the inverse of the
normal cumulative distribution

do i= 1 to dim(z); function (probit). At the end of the

Z(i) = probit((i - 0.375 ) / 99.25 ); code, the best lambda is saved as
end;
a macro variable called lamt.

MZ = mean(of Z1-Z99);
SZZ = CSS(of Z1-Z99);
best_SSE = SZZ;
best_lambda = 0 ;
do lambda = 0 to 1 by 0.01 ;

do i = 1 to 99 ;
if (lambda = 0 ) then T(i) =

log(P(i));
else T(i) = (P(i)**lambda - 1 ) /

lambda;
end;

MT = mean(of T1-T99);
STT = CSS(of T1-T99);
do i = 1 to 99 ;

CP(i) = (T(i) - MT) * (Z(i) - MZ);
end;

STZ = sum(of CP1-CP99);

SSE = SZZ - ((STZ** 2 )/STT);
if (SSE < best_SSE) then do;
best_SSE = SSE;
best_lambda = lambda;
end;
end;

lambda = best_lambda;
sse = best_sse;
call symput( 'lamt' ,lambda);
run;

proc univariate data=&data noprint; The minimum amount consumed
where &response> 0 ; on a consumption day is
var &response; calculated and saved in a dataset
output out=outmin_amt min=min_amt; called outmin_amt.

run;

data paramsubj1rec; The minimum amount is added to

if _n_= 1 then set outmin_amt; the dataset. Zero values are set to
set parsubj1rec;
lamt = &lamt; ½ of the mimimum amount. The
array zero( 2 ) &var12; dataset is sorted by subject. The
do i= 1 to 2 ; variable lamt is created from the
if zero[i]= 0 then zero[i]=(min_amt/ 2 ); macro value lamt that was created
end; previously.

run;

proc sort; by &subject; run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 5/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

%indivint(model12= 2 , The INDIVINT macro is called.

subj1recdata=paramsubj1rec, Because we are fitting a two-part
recid=&subject, r24vars=&var12,
min_amt=min_amt, var_u1=p_var_u1, model, the macro variable
var_u2=a_var_u2, cov_u1u2=cov_u1u2, model12 is set equal to 2. This
var_e=a_var_e, lambda=a_lambda, macro uses the dataset with 1

xbeta1=x1b1, xbeta2=x2b2, boxcox_t_lamt=y, record per person
lamt=lamt, dencalc=y, denopt=y, u1nlmix=, (paramsubj1rec), and specifies the
u2nlmix=, titles=&titles, notesprt=y);
two 24-hour recall variables

(var12). The minimum amount

that was saved in the

paramsubj1rec dataset is specified

for the min_amt macro variable, as

are the parameters that are saved

in that dataset, including

p_var_u1, a_var_u2, cov_u1u2,

a_var_e, and a_lambda. The

predicted values x1b1 and x2b2

from the MIXTRAN run are

specified. The macro variable

boxcox_t_lamt is set to y for ‘Yes’,

indicating that a Box-Cox

parameter is specified. This

parameter is lamt, which was

defined in the paramsubj1rec

dataset in the last step. The

macro variables dencalc, denopt,

and notesprt are set to y for ‘Yes’,

indicating that denominator

integration is perfomed,

denominator optimization is

performed, and notes are printed

in the SAS log, respectively.

data subj1recres; The dataset _resdata is created in
merge &datam _resdata(keep = &subject the INDIVINT macro. It is merged
with the dataset adultf.
indusint);
by &subject; The regression model is run using
the expected usual intake from the
run; INDIVINT macro, called indusint.
Because boxcox_t_lamt was set to
proc reg data=subj1recres outest=regout; y, this variable was already
freq w0304_0; transformed in the INDIVINT
model &regresponse = indusint macro, using the value of lamt in a
Box-Cox transformation. Title3 is
&covars_reg; reset.
title %eval (&titles+ 1 ) "Regression
Model: Adjusted for Measurement Error" ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 6/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data diethealthout0; The output dataset from the
set regout(rename = (indusint=rcbeta)); regression above (regout) is set,
lamt = &lamt; and the parameter for the
t0boxcox = (&t0**lamt - 1 )/lamt; expected true usual intake is
t1boxcox = (&t1**lamt - 1 )/lamt; renamed to rcbeta. In addition,
tdiffrcbeta = (t1boxcox - lamt is saved, and the variables
t0boxcox and t1boxcox and their
t0boxcox)*rcbeta; difference multipled by rcbeta are
run; computed. The macro variables t0
and t1 are set to a range that is
relevant to the data, e.g., the 10th
and 90th percentile.

proc datasets nolist; delete parampred Unneeded datasets are deleted.
parsubj1rec paramsubj1rec subj1recres
_resdata regout; run; This code starts a loop to run the
%do run= 1 %to 16 ; 16 BRR runs.

%put ~~~~~~~~~~~~~~~~~~~ Run &run The run number is printed to the
~~~~~~~~~~~~~~~~~~~~; log.

%MIXTRAN (data=&data, response=&response, Within the BRR212 macro, the
foodtype= &foodtype, subject=&subject, MIXTRAN macro is called. All of
repeat=&repeat, the variables preceded by & will be
covars_prob=&covars_prob, defined by the BRR212 macro
covars_amt=&covars_amt, outlib=&outlib, call. The only variable without an
modeltype=&modeltype, lambda=&lambda, & is the replicate_var macro
replicate_var=w0304_&run, seq=&seq, variable; it is set to w0304_&run
weekend=&weekend, vargroup=&vargroup, where &run equals 1 to 16.
numvargroups= &numvargroups,
subgroup=&subgroup, Input datasets for the INDIVINT
start_val1=&start_val1, macro are created. The datasets
start_val2=&start_val2, _pred_unc_&foodtype and
start_val3=&start_val3, _param_unc_&foodtype are
vcontrol=&vcontrol, nloptions=&nloptions, created in the MIXTRAN run. The
titles= &titles, printlevel=&printlevel) syntax “if (_n_=1) then set” is a
data parampred(keep = &subject a_var_u2 way of doing a 1-to-many merge,
a_var_e a_lambda x2b2); where the dataset
_param_unc_&foodtype is merged
if (_n_ = 1 ) then set & outlib.._ with each row of the
param_unc_&foodtype; set & outlib.._ _pred_unc_&foodtype dataset.
pred_unc_&foodtype;

run;

data parsubj1rec; The INDIVINT macro requires a
merge parampred &datam(keep = &subject dataset with only one line per
person called parsubj1rec. This is
&var12); defined by the macro variable
by &subject; datam in the BRR212 macro, and
the response variables are defined
run; by the macro variable var12.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 7/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc univariate data=&data noprint; The minimum amount consumed
where &response> 0 ; on a consumption day is
var &response; calculated and saved in a dataset
output out=outmin_amt min=min_amt; called outmin_amt.

run;

data paramsubj1rec; The minimum amount is added to

if _n_= 1 then set outmin_amt; the dataset. Zero values are set to
set parsubj1rec;
½ of the mimimum amount. The
array zero( 2 ) &var12;
dataset is sorted by subject. The
do i= 1 to 2 ;
variable lamt is created from the
if zero[i]= 0 then zero[i]=(min_amt/ 2 );
end; macro value lamt that was created
lamt = &lamt; previously.

run;

%indivint(model12= 2 , The INDIVINT macro is called.

subj1recdata=paramsubj1rec, Because we are fitting a one-part
recid=&subject, r24vars=&var12,
min_amt=min_amt, var_u1=, var_u2=a_var_u2, model, the macro variable
cov_u1u2=, var_e=a_var_e, lambda=a_lambda, model12 is set equal to 2. This
xbeta1=, xbeta2=x2b2, boxcox_t_lamt=y, macro uses the dataset with 1

lamt=lamt, dencalc=y, denopt=y, u1nlmix=, record per person
u2nlmix=, titles=&titles, notesprt=y); (paramsubj1rec), and specifies the

two 24-hour recall variables

(var12). The minimum amount

that was saved in the

paramsubj1rec dataset is specified

for the min_amt macro variable, as

are the parameters that are saved

in that dataset, including

p_var_u1, a_var_u2, cov_u1u2,

a_var_e, and a_lambda. The

predicted values x1b1and x2b2

from the MIXTRAN run are

specified. The macro variable

boxcox_t_lamt is set to y for ‘Yes’,

indicating that a Box-Cox

parameter is specified. This

parameter is lamt, which was

defined in the paramsubj1rec

dataset in the last step. The

macro variables dencalc, denopt,

and notesprt are set to y for ‘Yes’,

indicating that denominator

integration is perfomed,

denominator optimization is

performed, and notes are printed

in the SAS log, respectively.

data subj1recres; The dataset _resdata is created in
merge &datam _resdata(keep = &subject the INDIVINT macro. It is merged
with the dataset adultf.
indusint);
by &subject;

run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 8/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc reg data=subj1recres outest=regout; The regression model is run using
freq w0304_&run; the expected usual intake from the
model &regresponse = indusint INDIVINT macro, called indusint.
Because boxcox_t_lamt was set to
&covars_reg; y, this variable was already
title %eval (&titles+ 1 ) "Regression transformed in the INDIVINT
macro, using the value of lamt in a
Model: Adjusted for Measurement Error" ; Box-Cox transformation. Title3 is
reset.

data diethealthout; The output dataset from the
set regout(rename = (indusint=rcbeta)); regression above (regout) is set,
lamt = &lamt; and the parameter for the
t0boxcox = (&t0**lamt - 1 )/lamt; expected true usual intake is
t1boxcox = (&t1**lamt - 1 )/lamt; renamed to rcbeta. In addition,
tdiffrcbeta = (t1boxcox - lamt is saved, and the variables
t0boxcox and t1boxcox and their
t0boxcox)*rcbeta; difference multipled by rcbeta are
run; computed. The macro variables t0
and t1 are set to a range that is
relevant to the data, e.g., the 10th
and 90th percentile.

proc append base=brr_runs The BRR datasets are appended
data=diethealthout; into a dataset called brr_runs.
run;
proc datasets nolist; delete parampred After appending the information to
parsubj1rec paramsubj1rec subj1recres brr_runs, diethealthout and the
_resdata regout diethealthout; run; other datasets created in the BRR
runs can be deleted.

%end ; The BRR runs end.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 9/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

data _null_; This code creates macro calls that
format list listd listsum $255. ; are a list of the variables with the
%let I=1; prefix ‘b’ and ‘db’.
%let varamtu= %upcase (&covars_reg);

%do %until ( %qscan (&varamtu,&I, %str ( ))=

%str ());

%let varb&I= %qscan (&varamtu,&I, %str (
));

num= %eval (&i+ 1 );

varA= strip( "&&varb&i." );

list = trim(list)|| ' ' || 'b'
||trim(varA);

listd = trim(listd)|| ' ' || 'db'
||trim(varA);

listsum = trim(listsum)|| ' ' ||

'sum_db' ||trim(varA);

%let I= %eval (&I+1);

%end ;

%let cnt= %eval (&I-1);

%if &covars_reg= %str () %then %let cnt=0;

call symput( 'list' ,list);

call symput( 'listd' ,listd);

call symput( 'listsum' ,listsum);
run;

data parambrr; The brr_runs dataset is set, and a
set brr_runs; new dataset is created. This
rename rcbeta=brcbeta dataset renames the BRR
tdiffrcbeta=btdiffrcbeta parameters to have a prefix of ‘b’
intercept=bintercept; using a rename statement and the
array covs (&cnt) &covars_reg;
array newname (&cnt) &list; macro calls created above.

do i= 1 to &cnt;
newname[i]=covs[i];
end;
data parambrr;
set parambrr;
keep bintercept brcbeta btdiffrcbeta &list
run;
run;

data ss; The estimates from the first run
if _n_= 1 then set diethealthout0; are merged with the BRR
set parambrr; estimates, and the squared
array bvar (*) bintercept brcbeta difference is computed for each
BRR run.
btdiffrcbeta &list;
array varo (*)intercept rcbeta

tdiffrcbeta &covars_reg;
array dsqr (*) dbintercept dbrcbeta

dbtdiffrcbeta &listd;

do i= 1 to dim(bvar);

dsqr[i]=(bvar[i]-varo[i])** 2 ;
end;
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 10/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

proc means data=ss sum; The sum of squares is computed.
var dbintercept dbrcbeta dbtdiffrcbeta
The standard errors are computed.
&listd;
output out=sums sum=sum_dbintercept The point estimates are merged
with the standard errors.
sum_dbrcbeta sum_dbtdiffrcbeta &listsum; The data are transposed.
run; The final dataset is created, and p-
values and 95% confidence
data brr; intervals are computed.
set sums;
array sumt (*) sum_dbintercept The final dataset is printed.
The end of the BRR212 macro is
sum_dbrcbeta sum_dbtdiffrcbeta &listsum; indicated.
array se (*) intercept rcbeta

tdiffrcbeta &covars_reg;
do j= 1 to dim(sumt);
se[j]=sqrt((sumt[j])/( 16 * .49 ));
end;
keep intercept rcbeta tdiffrcbeta

&covars_reg;
run;

data wparms;
set diethealthout0 brr;

keep intercept rcbeta tdiffrcbeta
&covars_reg;

proc transpose data=wparms out=wparmst;
run;

data &final;
format pvalue 6.4 ;
set wparmst(rename=(col1=estimate

col2=brrse));
waldchisq = (estimate/brrse)** 2 ;
pvalue = 1 - probchi(waldchisq, 1 );
lower95lim = estimate - 1.96 *brrse;
upper95lim = estimate + 1.96 *brrse;
drop _label_;

run;

proc print;
run;

%mend BRR212;

Step 4: Call the BRR212 macro

Statements Explanation

%BRR212(data=milk, response=d_milk, This code calls the BRR212 macro.
datam=adultf, var12=d_milk_d1
d_milk_d2, day=, The dataset milk defined in Step 1 is
regresponse=treatosteo, used; the macro variable response for
foodtype=Milk, lambda= 0.01, which we want to model the distribution
subject=seqn, repeat=day, is d_milk. We also have to define a

covars_prob=ridageyr, dataset with one line per person,

covars_amt=ridageyr, datam, which is set equal to the dataset
covars_reg=ridageyr, outlib=work,
adultf, calculated in Step 1. The
modeltype=corr, titles= 2, printlevel= response variables for this dataset are

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 11/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

2, nsim_mc= 100, t0= 0.5, t1= 1.5, defined by macro variable var12 and
nloptions=technique=trureg maxfunc= equal d_milk_d1 and d_milk_d2. The
10000 maxiter= 200, dependent variable for the regression is
final=nh.m21task3) treatosteo.

The macro variable foodtype is used to
label the datasets from the MIXTRAN
and DISTRIB macros. The variable
seqn identifies the subject, and the
macro variable repeat defines the
variable that identifies the repeats on
the subject, which is day. The
covars_prob and covars_amt macro
variables need to include the covariates
for the usual intake model, which is
defined by ridageyr. The same
covariates must be put in the macro
variable covars_reg; however, there
may be additional variables in
covars_prob and covars_amt that are
not in covars_reg.

Note that a numeric id is required for
“subject” in the INDIVINT macro.

The macro variable outlib specifies the
library where the data are to be stored.
In this case, the working directory,
work, was used. Because this is an
episodically-consumed dietary
constituent, modeltype= corr is
specified. This fits the two-part model
with correlated random effects.

Nloptions are specified, as the last BRR
run had a floating point error when the
default options were used.

The macro variable titles saves 2 lines
for titles supplied by the user. The
printlevel is 2, which prints the output
from the NLMIXED runs and the
summary.

The macro variable nsim_mc is used to
specify the number of pseudo-
individuals for which the distribution is
simulated per respondent.

The macro variables t0 and t1 must be
specified. In this case, the approximate
10th and 90th percentiles of the
distribution were used.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 12/13

12/19/2018 NHANES Dietary Web Tutorial: Examine the Relationship Between Dietary Intake and Some Outcome Measure: Task 2

Statements Explanation

The variable final specifies the name of
the final dataset produced.

IMPORTANT NOTE

Although the macro variable weekend
is defined in the macro, this macro
currently is not capable of adjusting for
weekends as described earlier in the
course (see Module 18, Task 3 for more
information) as the DISTRIB macro
does.

WARNING

Note that SAS 9.2 TS1MO will produce an error with missing data in PROC IML, which is used in the INDIVINT macro.
The problem is fixed in SAS 9.2 TS2M2. The SAS Problem Note documents the problem. From the HOT FIX tab a link
to download the hot fix is available. This error is not encountered in SAS 9.1.3.

Step 5: Interpret output

Depending on the printlevel selected, the output from each NLMIXED run will be printed in the output. The first
NLMIXED output (replicate variable w0304_0) is a listing of the parameter estimates for the estimation of milk (see
‘Results from Fitting Correlated Model’). However, the standard errors are incorrect and are not printed in the
summary table; BRR is needed to obtain estimates of the standard errors. The logistic regression model is also
output for the base model. The other NLMIXED and LOGISTIC runs are from the BRR replications.
The regression parameters and standard errors are printed at the end of the output.

The parameter rcbeta represents the relationship between usual intake of milk and treatement for osteoporosis,
expressed in log odds of the Box Cox transformed estimate of usual intake for the individual.
The relationship between usual milk intake and treatment for osteoporosis is significant (p=0.0069). The odds ratio
for 1.5 cup equivalents of milk per day compared to 0.5 cup equivalents is 1.39 (95% CI 1.09,1.76).
IMPORTANT NOTE
Note: Your results may vary slightly, as a random seed is used to estimate the distribution of usual intake. However, they
would not be expected to vary by more than 1%.

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineRelationship/Task3.htm 13/13

NHANES Dietary Web Data Tutorial - Examine Usual Total Nutrient Int... https://www.cdc.gov/nchs/tutorials/dietary/advanced/ExamineUsualTota...

Examine Usual Total Nutrient Intake from Supplements and Diet

Purpose

The term “dietary intake” in this module will include foods and beverages reported on the 24-hour recalls in addition to
supplement intake from the household interview. Researchers are often interested in estimating the distribution of usual
intake of dietary components for a population from all sources, including supplements. This module will focus on using the
method developed by researchers at NCI and elsewhere (the “NCI method”) for this purpose.

IMPORTANT NOTE
Many of the statistical methods used in this course are advanced, and may require consultation with a statistician. For modules
18-22, it is required that you have the statistical knowledge of mixed effects models, and program knowledge of calling in SAS
macros. Since Module 18 provides the background information for Modules 19-22, it is advised that you carefully read Module
18 first before tackling other modules.

IMPORTANT NOTE
Note that the method described in this tutorial is applicable to the NHANES 2003-2006 data; starting in 2007-2008 dietary
supplement data also were collected using 24-hour recalls.

Task 1: Estimate Distributions of Total Nutrient Intake

Dietary supplement use can be an important contributor to total nutrient intake in addition to diet. In NHANES, dietary
supplement use information is collected during the household interview using the Dietary Supplement Questionnaire.
Information about use, frequency, type, and amount taken over the past 30 days is collected for each supplement. From this,
the average daily intake of nutrients from dietary supplements may be calculated for an individual.

Key Concepts about Estimating Distributions of Total Nutrient Intake (/nchs/tutorials/Dietary/Advanced
/ExamineUsualTotalNutrient/Info1.htm)
How to Estimate Distributions of Total Nutrient Intake (/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient
/Task1.htm)
Download Sample Code and Datasets (/nchs/tutorials/Dietary/downloads/downloads.htm)

Page last updated: May 2, 2013
Page last reviewed: May 2, 2013
Content source: CDC/National Center for Health Statistics
Page maintained by: NCHS/NHANES

Centers for Disease Control and Prevention 1600 Clifton Road Atlanta, GA 30329-4027, USA
800-CDC-INFO (800-232-4636) TTY: (888) 232-6348 - Contact CDC–INFO

1 of 1 1/14/2019, 9:24 PM

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Print Text!

Task 1: Key Concepts about Estimating Distributions of Total Nutrient
Intake

Dietary supplement use can be an important contributor to total nutrient intake in addition to diet. In NHANES 2003-2004
and 2005-2006, dietary supplement use information was collected during the household interview using the Dietary
Supplement Questionnaire. Information about use, frequency, type, and amount taken over the past 30 days is collected
for each supplement. From this, the average daily intake of nutrients from dietary supplements may be calculated for an
individual. Dietary consumption data are collected using two 24-hour recalls, one obtained in the Mobile Examination
Center, and one by telephone. For further details on dietary intake and supplement variables, please see Module 6 of the
Dietary Tutorial and Information about Dietary Variables in the Additional Resources Section. Because the formats of the
intake measures from food and supplements are different, and due to the differences in the different types of consumption
patterns observed for supplement intake compared to dietary intake, joint modeling of the total nutrient intake is
challenging. In this module, we adapt the method of Carriquiry, in which the reported amounts of nutrients from dietary
supplements are combined with adjusted individual mean reported amounts from (repeated) 24 hour recalls.

Two of the primary challenges of modeling nutrient intake data from 24-hour recall measures are measurement error
adjustment, and positively skewed data. The method developed by researchers at the National Cancer Institute (the “NCI
method”) may be used to estimate the distribution of usual intake of nutrients, meeting these challenges. (See Module 20,
Task 2 for further details.) Usual intake of nutrients solely from foods and beverages may differ between supplement users
and non-users. To allow the usual intake of nutrients solely from food and beverages to differ between supplement users
and non-users, the reported amount of the nutrient provided from supplements may be incorporated as a covariate in the
model. This allows the mean intake to differ by supplement use. Rather than using a Monte Carlo method to estimate the
distribution of usual intake of the nutrient from food and beverages, a shrinkage estimator, or adjusted mean, is calculated
for each person based on their 24-hour recalls. Then, the individual’s average daily nutrient intake from dietary
supplements (see Module 14, Task 3 for details on how this is calculated) is added to this adjusted mean, and the
empirical distribution of the sum is used to estimate the distribution of usual intake from all sources. Survey weights are
incorporated in the modeling and estimated procedures. Balanced repeated replication (BRR) (Module 18, Task 4) is used
to calculate standard errors.

Complete details of the NCI method and the SAS macro necessary to fit this model can be found at the NCI website.

References:
Carriquiry AL. Estimation of usual intake distributions of nutrients and foods. Journal of Nutrition 2003;133:601-608

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Info1.htm 1/1

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Print Text!

Task 1: How to Estimate Distributions of Total Nutrient Intake

In this example, the distribution of total calcium intake will be estimated for women older than age 50 years.

This example uses the demoadv dataset (download at Sample Code and Datasets). The variables w0304_0 to
w0304_16 are the weights (dietary weights and balanced repeated replication [BRR] weights) used in the analysis of 2003-
2004 dietary data that requires the use of BRR to calculate standard errors. The model is run 17 times, including 16 runs
using BRR (see Module 18, Task 4 for more information). BRR uses weights w0304_1 to w0304_16.

IMPORTANT NOTE

Note: If 4 years of NHANES data are used, 32 BRR runs are required. Additional weights are found in the demoadv
dataset.

A SAS macro is a useful technique for rerunning a block of code when the analyst only wants to change a few variables;
the macro BRR212 is created and called in this example. The BRR212 macro calls the MIXTRAN macro, and calculates
BRR standard errors of the parameter estimates. The MIXTRAN macro obtains preliminary estimates for the values of the
parameters in the model, and then fits the model using PROC NLMIXED. It also produces summary reports of the model
fit. Recall that modeling the complex survey structure of NHANES requires procedures that account for both differential
weighting of individuals and the correlation among sample persons within a cluster. The SAS procedure NLMIXED can
account for differential weighting by using the replicate statement. The use of BRR to calculate standard errors accounts
for the correlation among sample persons in a cluster. Therefore, NLMIXED (or any SAS procedure that incorporates
differential weighting) may be used with BRR to produce standard errors that are suitable for NHANES data without using
specialized survey procedures.

The MIXTRAN macro used in this example was downloaded from the NCI website. Version 1.1 of the macro was used.
Check this website for macro updates before starting any analysis. Additional details regarding the macro and additional
examples also may be found on the website and in the users’ guide.

Step 1: Create a dataset so that each row corresponds to a single person day and define
indicator variables if necessary

Statements Explanation

data demoadv; In NHANES 2003-2004, calcium from water was not

set nh.demoadv; included in DR1TCALC and DR2TCALC, so this is added

if (DR1_330>= 0 and using the water variables DR1_330, DR2_330, DR1BWATR,
and DR2BWATR, creating new variables DR1CALCW and
DR1BWATR >= 0 )
then DR2CALCW. The amount of calcium in tap water (DR1_330
DR1TCALCW=DR1TCALC
+ round((((DR1_330 or DR2_330) and bottled water (DR1BWATR or
* 3 ) + (DR1BWATR * DR2BWATR) are estimated to be 3 mg and 10 mg per 100
10 ))/ 100 ), 1.0 ); grams, respectively. (Note: In 2005-2006 this was changed,
if (DR2_330>= 0 and so this step is not necessary.) If there are no water variables,
DR2BWATR >= 0 ) then the new calcium variables are set to missing.
then Categorical supplement variables are created using
DR2TCALCW=DR2TCALC do/select syntax with the DAILYAVG variable, which is a

+ round((((DR2_330 created variable that is equal to the daily average calcium
* 3 ) + (DR2BWATR * intake from dietary supplements (see Module 14, Task 3 for
10 ))/ 100 ), 1.0 ); more details). Dummy variables are created from these

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 1/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

if (not(DR1_330>= 0 categories. Dummy variables are also created for weekend.
and DR1BWATR >= 0 In this dataset only those people with dietary data are
)) then do ; selected by including those without missing BRR weights.
DR1TCALCW= .
;DR2TCALCW= . ; end
;

select ;
when (DAILYAVG=

0 ) SUPP_CAT= 1 ;
when (DAILYAVG>

0 and DAILYAVG <=
100 ) SUPP_CAT= 2 ;

when (DAILYAVG>
100 and DAILYAVG <=
400 ) SUPP_CAT= 3 ;

when (DAILYAVG>
400 ) SUPP_CAT= 4 ;
otherwise SUPP_CAT=
.;
end ;

array dum1 ( 3 )
CA_SU2 CA_SU3
CA_SU4;

do i= 1 to 3 ;
dum1(i) =
(SUPP_CAT = i+ 1 );
end ;

if DR1DAY in ( 1 , 6
, 7 ) then weekend1=
1;
else if DR1DAY in (
2 , 3 , 4 , 5 ) then
weekend1= 0 ;
if DR2DAY in ( 1 , 6
, 7 ) then weekend2=
1;
else if DR2DAY in (
2 , 3 , 4 , 5 ) then
weekend2= 0 ;

if w0304_0 ne .
; /* keeps only
those with dietary
data */
format WEEKEND1
WEEKEND2 wkend.
SUPP_CAT sc. ;
run ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 2/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

data adultf; A dataset that selects women older than age 50 years is
set demoadv; created for this example.

if riagendr= 2 and

ridageyr>= 51 ;
run ;

data day1; The variables DR1CALCW and DR2CALCW created above

set demoadv; represent total calcium consumed on days 1 and 2

if riagendr= 2 and respectively from all foods and beverages (including water).
To create a dataset with 2 records per person, the demoadv
ridageyr>= 51 ;
DRTCALCW=DR1TCALCW; dataset is set 2 times to create 2 datasets, one where day=1
DAY_WK=DR1DAY;
and one where day=2. The same variable name,
day= 1 ;
DRTCALCW, is used for calcium on both days. It is created
run ;
by setting it equal to DR1TCALCW for day 1 and

DR2TCALCW for day 2.

data day2;

set demoadv;

if riagendr= 2 and

ridageyr>= 51 ;
DRTCALCW=DR2TCALCW;
DAY_WK=DR2DAY;

day= 2 ;
run ;

data calcium; Finally, these data sets are appended and a weekend

set day1 day2; variable is created. (This variable must be named weekend

if DAY_WK in ( 1 , 6 for the MIXTRAN macro.)

, 7 ) then weekend=

1;

else if DAY_WK in (

2 , 3 , 4 , 5 ) then

weekend= 0 ;

DAY2=(DAY= 2 );

format WEEKEND

wkend. SUPP_CAT sc.
;

run ;

Step 2: Sort the dataset by respondent and day

It is important to sort the dataset by respondent and intake day (day 1 and 2) because the NLMIXED procedure uses this
information to estimate the model parameters.

proc sort ; by seqn day; run ;

Step 3: Create the BRR221 macro 3/16

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

The BRR221 macro calls the MIXTRAN macro and DISTRIB macro and computes standard errors of parameter
estimates. After creating this macro and running it 1 time, it may be called several times, each time changing the macro
variables.

Statements Explanation

%include This code reads the MIXTRAN

'C:\NHANES\Macros\mixtran_macro_v1.1.sas' macro into SAS so that it may be
; called.

%macro BRR221(data, response, datam, The start of the BRR221 macro is
var1, var2, supp, EAR, UL, foodtype, defined. All of the terms inside the
subject, repeat,covars_amt, outlib, parentheses are the macro
modeltype, lambda, seq, weekend, variables that are used in the
vargroup, numvargroups, subgroup, macro.
start_val1, start_val2, start_val3,
vcontrol, loptions, titles, printlevel,
final);

%MIXTRAN (data=&data, response=&response, Within the BRR221 macro, the
foodtype=&foodtype, subject=&subject,
repeat=&repeat, ovars_amt=&covars_amt, MIXTRAN macro is called. All of
outlib=&outlib, modeltype=&modeltype, the variables preceded by & will be
lambda=&lambda, replicate_var= w0304_0, defined by the BRR221 macro call.
seq=&seq, weekend=&weekend, The only variable without an & is

vargroup=&vargroup, the replicate_var macro variable; it
numvargroups=&numvargroups,
subgroup=&subgroup, start_val1= is set to w0304_0 for the first run.

&start_val1, start_val2=&start_val2,
start_val3=&start_val3,
vcontrol=&vcontrol, nloptions=&nloptions,
titles=&titles, printlevel=&printlevel)

data _allparm; The dataset
set & outlib.._ param_unc_& foodtype. ; _param_unc_&foodtype is created
run= 0 ; in the MIXTRAN run. This data
run; step saves those parameter
estimates and labels the run as ‘0’.
data _allpred; The dataset _pred_unc_&foodtype
and is created in the MIXTRAN run.
set & outlib.._ pred_unc_& foodtype. This data step saves the predicted
(rename=(w0304_0=w0304)); values, renames the weight to
w0304, and drops unneeded
run= 0 ; variables.

drop numsubjects totsubjects totwts This datastep pulls a_lambda from
indwts grpwts weekend x2b2_1; _param_unc_&foodtype and
creates a macro variable called
run; lamb.
data _null_;
set & outlib.._ param_unc_& foodtype. ;
call symput ( 'lamb' ,a_lambda);
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 4/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

%do brun= 1 %to 16 ; This code starts a loop to run the 16
BRR runs.

options nonotes; Notes are turned off to save room in
the log.

%put ~~~~~~~~~~~~~~RUN The run number is printed to the
&brun~~~~~~~~~~~~~~~; log.

%MIXTRAN (data=&data, response=&response, Within the BRR221 macro, the
foodtype=&foodtype, subject=&subject,
repeat=&repeat, covars_amt=&covars_amt, MIXTRAN macro is called. All of
outlib=&outlib, modeltype=&modeltype, the variables preceded by & will be
lambda=&lamb, replicate_var=w0304_&brun, defined by the BRR221 macro call.
seq=&seq, weekend=&weekend, vargroup= The only variable without an & is

&vargroup, numvargroups=&numvargroups, the replicate_var macro variable; it
subgroup=&subgroup,
start_val1=&start_val1, is set to w0304_&brun where &brun
start_val2=&start_val2, equals 1 to 16.

start_val3=&start_val3,
vcontrol=&vcontrol, nloptions=&nloptions,
titles=&titles, printlevel=&printlevel)

data brrparm; The dataset
set & outlib.._ param_unc_& foodtype. ; _param_unc_&foodtype is created
run=&brun; in the MIXTRAN run. This data
run; step saves those parameter
estimates and labels the run as
&brun.

proc append base=_allparm data=brrparm; The BRR datasets are appended
run; into the _allparm dataset that was
created for run 0.

data brrpred; The dataset _pred_unc_&foodtype
and is created in the MIXTRAN run.
set & outlib.._ pred_unc_& foodtype. This data step saves the predicted
(rename=(w0304_& brun. =w0304)); values, renames the weight to
w0304, and drops unneeded
run=&brun; variables.

drop numsubjects totsubjects totwts
indwts grpwts weekend x2b2_1;

run; The BRR datasets are appended
proc append base=_allpred data=brrpred; into the _allpred dataset that was
run; created for run 0.
proc datasets nolist; delete brrparms
brrpred; run; The BRR datasets are appended
into the _allpred dataset that was
%end ; created for run 0. Unneeded
datasets are deleted.

The BRR runs end.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 5/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

%if &weekend ne %str () %then %do ; Weekend macro variables
data _null_; wkendparm, weekend1, and
weekend2 are created. These
%let I=1; variables are set to 0 if the macro
variable weekend is not set to a
%let varamtu= %upcase (&covars_amt); value in order to estimate the usual
intake of calcium in a data step
%do %until ( %qscan (&varamtu,&I, %str ( below.
))= %str ());

%let I= %eval (&I+1);

%end ;

%let cnt=&I;

%if &covars_amt= %str () %then %let
cnt=1;

%if &cnt lt 9 %then %let znum = "0";
%else %let znum= %str () ;

num= %eval (&i+ 1 );

varA= strip( 'A'
||strip(&znum)||strip(num)|| '_' );

wkendparm=strip(strip(varA)|| 'WEEKEND'
);

%if &covars_amt= %str () %then %let
cnt=0;

call symput ( 'wkendparm' ,wkendparm);
run;

%let weekend1=WEEKEND1;

%let weekend2=WEEKEND2;

%end ;

%else %do ; %let wkendparm=0; %let
weekend1=0; %let weekend2=0; %end ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 6/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

%if &seq ne %str () %then %do ; Sequence macro variable seqparm
data _null_; is created. This variable is set to 0
%let I=1; if the macro variable seq is not set
%let varamtu= %upcase (&covars_amt); to a value in order to estimate the
usual intake of calcium in a data
step below.

%do %until ( %qscan (&varamtu,&I, %str (
))= %str ());

%let I= %eval (&I+1);

%end ;

%let cnt= %eval (&I+1);

%if &covars_amt= %str () %then %let
cnt=1;

%if &cnt lt 9 %then %let znum = "0";
%else %let znum= %str () ;

num= %eval (&i+ 2 );

varA= strip( 'A'
||strip(&znum)||strip(num)|| '_' );

seqparm=strip(strip(varA)||strip(
"&seq" ));

call symput ( 'seqparm' ,seqparm);
run;

%end ;

%else %let seqparm=0; The predictions and parameter
data _allpred; datasets are merged.
merge _allpred _allparm;
by run; The data are sorted by the
run; respondent and by the BRR run.
proc sort data=_allpred; The final dataset is sorted.
by seqn run;
run; The dataset with 1 line per person
proc sort data=&final; is sorted by respondent.
by &subgroup line;
run;
proc sort data=&datam;
by seqn;
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 7/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

data analyze; This data step merges _allpred with
merge _allpred &datam; the dataset with 1 line per person
by seqn; and creates empirical shrinkage
estimates.

NDAYS= 0 ; The day 1 data are transformed
if (&var1 ^= . ) using the Box-Cox transformation.
Within this transformation step, if
then do; the variable=0 then it is set to ½ of
NDAYS=NDAYS+ 1 ; the minimum amount. Next, the
Z1=(((&var1 + .5 *min_amt*(&var1= 0 residual is computed (toterr1). This
))**a_lambda)- 1 )/a_lambda; process is repeated for day 2. The
toterr1=Z1 - (x2b2_0 + coding assumes that &seqparm is
&wkendparm*&WEEKEND1); equal to 1 for day 2 and 0 for day 1.
The average residual (avgerr) is
end; computed. The empirical shrinkage
if (&var2 ^= . ) is computed (ui). The variables
A_VAR_U2 and A_VAR_E come
then do; from the _param_unc_&foodtype
NDAYS=NDAYS+ 1 ; from MIXTRAN. The shrinkage
Z2=(((&var2 + .5 *min_amt*(&var2= 0 estimates are added to the fixed
))**a_lambda)- 1 )/a_lambda; effects predictions for weekdays
toterr2=Z2 - (x2b2_0 + and weekends (zbar_0 and
&wkendparm*&WEEKEND2 + &seqparm); zbar_1), and then the data are
end; backtransformed. The Taylor series
avgerr=mean(toterr1,toterr2); transformation is used to ensure
ui=avgerr*sqrt(A_VAR_U2/(A_VAR_U2 + that the mean of the
A_VAR_E/NDAYS)); backtransformed data is the same
zbar_0=x2b2_0 + ui; as the mean on the original scale.
zbar_1=x2b2_0 + &wkendparm + ui;
bt_0 = a_lambda*zbar_0 + 1 ; Overall usual intake from foods,
bt_1 = a_lambda*zbar_1 + 1 ; beverages, and water is computed
if (bt_0 <= 0 ) then bt_0= 0 ; as the weighted mean of weekday
and weekend intake
(&foodtype_FDW). Total usual
intake from food, beverages, water,
and supplements (&foodtype_TOT)
is the sum of &foodtype_FDW and
the intake of supplements (&supp).
The variables FDW_GE_EAR and
TOT_GE_EAR are set to 1 if the
corresponding usual intake value is
greater than the DRI EAR;
FDW_GE_UL and TOT_GE_UL are
defined analogously for the DRI UL.

else bt_0 = (bt_0**( 1 /a_lambda)) + ( 1 -
a_lambda)*(A_VAR_E/ 2 )*(bt_0**( 1
/a_lambda - 2 ));

if (bt_1 <= 0 ) then bt_1= 0 ;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 8/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

else bt_1 = (bt_1**( 1 /a_lambda)) + ( 1 -
a_lambda)*(A_VAR_E/ 2 )*(bt_1**( 1
/a_lambda - 2 ));

&foodtype._FDW=( 4 *bt_0 + 3 *bt_1)/ 7 ;

&foodtype._TOT=&foodtype._FDW + &supp;

FDW_GE_EAR=(&foodtype._FDW >= &EAR);

TOT_GE_EAR=(&foodtype._TOT >= &EAR);

FDW_GT_UL=(&foodtype._FDW > &UL);

TOT_GT_UL=(&foodtype._TOT > &UL);

drop toterr1 toterr2 avgerr zbar_0 zbar_1 Unneeded variables are dropped.

bt_0 bt_1 x2b2_0 min_amt A_VAR_U2 A_VAR_E
a_lambda &supp &var1 &var2 NDAYS z1 z2;
run;

proc sort data=analyze; The dataset is sorted.
by run seqn;
run;

proc univariate plot data=analyze Percentiles are computed by run
noprint;
by run; using the weight w0304 (which was
var &foodtype._FDW &foodtype._TOT; renamed in an earlier dataset from
freq w0304; w0304_&brun). Percentiles 1, 5,

output out=distrib pctlpts= 1 5 25 50 75 95 25, 50, 75, 95, and 99 are saved.
The freq statement is used to
99 pctlpre=FDW_P TOT_P;
run; account for the complex survey

sampling of NHANES.

proc univariate plot data=analyze The mean values (including
noprint; proportions for the EAR and UL
by run; variables) are computed using proc
var &foodtype._FDW &foodtype._TOT univariate. These variables need to
FDW_GE_EAR FDW_GT_UL TOT_GE_EAR be weighted by the w0304 to
TOT_GT_UL; calculate the means properly
freq w0304; adjusted for the complex sampling
output out=means mean=&foodtype._FDW in NHANES. A new dataset, called
&foodtype._TOT FDW_GE_EAR FDW_GT_UL means, is created with these
TOT_GE_EAR TOT_GT_UL; values.
run;

data distrib; The means and percentiles are
merge means distrib; merged, and proportions that were
by run; computed in means are converted
FDW_GE_EAR=FDW_GE_EAR* 100 ; to percents.
FDW_GT_UL=FDW_GT_UL* 100 ;
TOT_GE_EAR=TOT_GE_EAR* 100 ;
TOT_GT_UL=TOT_GT_UL* 100 ;

run;

data distrib0; The estimates for the base run are
set distrib(where=(run= 0 )); saved in distrib0.

run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 9/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

proc means data=distrib(where=(run > 0 )) This code computes the means and
noprint; variances of the BRR runs. The

var &foodtype._FDW FDW_P1 FDW_P5 FDW_P25 means are prefixed with
FDW_P50 FDW_P75 FDW_P95 FDW_P99 underscores to distinguish them
FDW_GE_EAR FDW_GT_UL &foodtype._TOT from the base runs. The variances
TOT_P1 TOT_P5 TOT_P25 TOT_P50 TOT_P75 are prefixed with S_.

TOT_P95 TOT_P99 TOT_GE_EAR TOT_GT_UL;

output out=brr mean= _&foodtype._FDW
_FDW_P1 _FDW_P5 _FDW_P25 _FDW_P50
_FDW_P75 _FDW_P95 _FDW_P99 _FDW_GE_EAR
_FDW_GT_UL _&foodtype._TOT _TOT_P1
_TOT_P5 _TOT_P25 _TOT_P50 _TOT_P75
_TOT_P95 _TOT_P99 _TOT_GE_EAR
_TOT_GT_UL var= S_&foodtype._FDW
S_FDW_P1 S_FDW_P5 S_FDW_P25 S_FDW_P50
S_FDW_P75 S_FDW_P95 S_FDW_P99
S_FDW_GE_EAR S_FDW_GT_UL S_&foodtype._TOT
S_TOT_P1 S_TOT_P5 S_TOT_P25 S_TOT_P50
S_TOT_P75 S_TOT_P95 S_TOT_P99
S_TOT_GE_EAR S_TOT_GT_UL;

run; The base datasets and BRR
data distrib0; datasets are combined. There are
merge distrib0 brr; 20 statistics that need standard
errors that are defined in arrays.
array est ( 20 ) &foodtype._FDW FDW_P1 The standard error is computed
FDW_P5 FDW_P25 FDW_P50 FDW_P75 FDW_P95 from the variance (multiplied by
FDW_P99 FDW_GE_EAR FDW_GT_UL 15/16 due to the variance from proc
&foodtype._TOT TOT_P1 TOT_P5 TOT_P25 means being divided by N-1 rather
TOT_P50 TOT_P75 TOT_P95 TOT_P99 than N) and the squared difference
TOT_GE_EAR TOT_GT_UL; between the mean of the BRR
parameter and the mean of the
array se ( 20 ) S_&foodtype._FDW S_FDW_P1 base parameter.
S_FDW_P5 S_FDW_P25 S_FDW_P50 S_FDW_P75 The standard error is multiplied by
S_FDW_P95 S_FDW_P99 S_FDW_GE_EAR -1 so that it can be formatted to
S_FDW_GT_UL S_&foodtype._TOT S_TOT_P1 print in parentheses.
S_TOT_P5 S_TOT_P25 S_TOT_P50 S_TOT_P75
S_TOT_P95 S_TOT_P99 S_TOT_GE_EAR
S_TOT_GT_UL;

array tmp ( 20 ) _&foodtype._FDW _FDW_P1
_FDW_P5 _FDW_P25 _FDW_P50 _FDW_P75
_FDW_P95 _FDW_P99 _FDW_GE_EAR _FDW_GT_UL
_&foodtype._TOT _TOT_P1 _TOT_P5 _TOT_P25
_TOT_P50 _TOT_P75 _TOT_P95 _TOT_P99
_TOT_GE_EAR
_TOT_GT_UL;

do i= 1 to 20 ;

se(i)=-1*sqrt(se(i)*( 15 / 16 ) + (est(i)-
tmp(i))** 2 )/sqrt( .49 );

if (se(i)= 0 ) then se(i)=- 0.0001 ; 10/16
end;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

drop _&foodtype._FDW _FDW_P1 _FDW_P5 Unneeded variables are dropped.
_FDW_P25 _FDW_P50 _FDW_P75 _FDW_P95
_FDW_P99 _FDW_GE_EAR _FDW_GT_UL
_&foodtype._TOT _TOT_P1 _TOT_P5 _TOT_P25
_TOT_P50 _TOT_P75 _TOT_P95 _TOT_P99
_TOT_GE_EAR _TOT_GT_UL;

drop i;

run;

data toprint1; To create the final dataset, the point
set distrib0;
estimates are saved in a file called
line= 1;
toprint1. The variable line will

keep &foodtype._FDW FDW_P1 FDW_P5 FDW_P25 identify them as estimates.
FDW_P50 FDW_P75 FDW_P95 FDW_P99
FDW_GE_EAR FDW_GT_UL &foodtype._TOT
TOT_P1 TOT_P5 TOT_P25 TOT_P50

TOT_P75 TOT_P95 TOT_P99 TOT_GE_EAR
TOT_GT_UL line;

run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 11/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

data toprint2; The standard errors are saved in a
set distrib0(drop=&foodtype._FDW FDW_P1 dataset called toprint2. The
FDW_P5 FDW_P25 FDW_P50 FDW_P75 FDW_P95 variable line will identify them as
FDW_P99 FDW_GE_EAR FDW_GT_UL standard errors. The standard
&foodtype._TOT TOT_P1 TOT_P5 TOT_P25 errors are renamed to the original
TOT_P50 TOT_P75 TOT_P95 TOT_P99 variable names.
TOT_GE_EAR TOT_GT_UL);

line= 2 ; The final dataset is created by
rename appending toprint1 and toprint2.
S_&foodtype._FDW=&foodtype._FDW

S_FDW_P1= FDW_P1
S_FDW_P5= FDW_P5
S_FDW_P25= FDW_P25
S_FDW_P50= FDW_P50
S_FDW_P75= FDW_P75
S_FDW_P95= FDW_P95
S_FDW_P99= FDW_P99
S_FDW_GE_EAR= FDW_GE_EAR
S_FDW_GT_UL= FDW_GT_UL
S_&foodtype._TOT=&foodtype._TOT
S_TOT_P1= TOT_P1
S_TOT_P5= TOT_P5
S_TOT_P25= TOT_P25
S_TOT_P50= TOT_P50
S_TOT_P75= TOT_P75
S_TOT_P95= TOT_P95
S_TOT_P99= TOT_P99
S_TOT_GE_EAR=TOT_GE_EAR
S_TOT_GT_UL=TOT_GT_UL;
drop run;
run;
data &final;
set toprint1 toprint2;
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 12/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

proc sort data=&final; The final dataset is sorted.
by line;
The estimate for calcium from
run; foods, beverages, and water are
proc print data=&final split= ' ' noobs; printed, labeling the variables. The
var line &foodtype._FDW FDW_P1 FDW_P5 format negparen will make the
FDW_P25 FDW_P50 FDW_P75 FDW_P95 FDW_P99 standard errors print in
FDW_GE_EAR FDW_GT_UL ; parentheses.
label

line =''

&foodtype._FDW = 'Mean'

FDW_P1 = '1st Pctile'

FDW_P5 = '5th Pctile'

FDW_P25 = '25th Pctile'

FDW_P50 = '50th Pctile'

FDW_P75 = '75th Pctile'

FDW_P95 = '95th Pctile'

FDW_P99 = '99th Pctile'

FDW_GE_EAR = 'Pct>=EAR'

FDW_GT_UL = 'Pct>UL' ;

format line line. &foodtype._FDW FDW_P1
FDW_P5 FDW_P25 FDW_P50 FDW_P75 FDW_P95
FDW_P99 FDW_GE_EAR FDW_GT_UL negparen10.1
;

title 'Usual Intake of Calcium from Food
and Water Sources Only' ;

title2 'NHANES 2003-04' ;
run;

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 13/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

proc print data=&final split= ' ' noobs; The estimate for calcium from food,
var line &foodtype._TOT TOT_P1 TOT_P5 beverages, water, and supplements
TOT_P25 TOT_P50 TOT_P75 TOT_P95 TOT_P99 are printed, labeling the variables.
TOT_GE_EAR TOT_GT_UL; The format negparen will make the
label standard errors print in
parentheses.

line =''

&foodtype._TOT = 'Mean'

TOT_P1 = '1st Pctile'

TOT_P5 = '5th Pctile'

TOT_P25 = '25th Pctile'

TOT_P50 = '50th Pctile'

TOT_P75 = '75th Pctile'

TOT_P95 = '95th Pctile'

TOT_P99 = '99th Pctile'

TOT_GE_EAR= 'Pct>=EAR'

TOT_GT_UL= 'Pct>UL' ;

format line line. &foodtype._TOT TOT_P1
TOT_P5 TOT_P25 TOT_P50 TOT_P75 TOT_P95
TOT_P99 TOT_GE_EAR TOT_GT_UL negparen10.1
;

title 'Usual Intake of Calcium from Food
and Water Plus Dietary Supplement
Sources' ;

title2 'NHANES 2003-04' ; The end of the BRR221 macro is
indicated.
run;
%mend BRR221;

Step 4: Call the BRR221 macro

Statements Explanation

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 14/16

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Statements Explanation

%BRR221(data=calcium, This code calls the BRR221 macro. The
response=drtcalcw, datam=adultf,
var1=DR1TCALCW, var2=DR2TCALCW, dataset calcium defined in Step 1 is
supp=DAILYAVG, EAR= 1000 , UL= 2500 , used; the macro variable response for
foodtype=calciumw, subject=seqn, which we want to model the distribution
repeat=DAY2, covars_amt=CA_SU2 CA_SU3 is DRTCALCW. The individual day

CA_SU4, outlib=work, variables, DR1TCALCW and

modeltype=amount, lambda=, seq=DAY2, DR2TCALCW , and the supplement
weekend=WEEKEND, vargroup=,
numvargroups=, subgroup=, variable, DAILYAVG must also be
start_val1=, start_val2=, specified. By specifying the EAR and UL
start_val3=, vcontrol=, nloptions=, values of 1000 mg and 2500 mg,
titles= 1 , printlevel= 1 , respectively, the macro will produce an
final=nh.m22task1) estimate of the proportion of the

population below these values. These

variables are required.

The macro variable foodtype is used to
label the _pred and _param datasets.
The variable seqn identifies the subject,
and the macro variable repeat defines
the variable that identifies the repeats
on the subject, which is day2. The
covariates CA_SU2 CA_SU3 CA_SU4
are included in the model.

The macro variable outlib specifies the
library where the data are to be stored.
In this case, the working directory, work,
was used. Because this is a
ubiquitously-consumed dietary
constituent, modeltype= amount is
specified. This fits the amount model.

The seq variable is day2, which
indicates if the recall was the 1st or 2nd
day. The weekend macro variable
includes a weekend effect in the model,
and it calculates the distribution by 4/7
for weekdays and 3/7 for weekends. It
must be set equal to a variable called
weekend in the dataset.

The macro variable titles saves 1 line for
a title supplied by the user. The
printlevel is 2, which prints the output
from the NLMIXED runs and the
summary.

The variable final specifies the name of
the final dataset produced.

Step 5: Interpret output 15/16

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm

12/19/2018 NHANES Dietary Web Tutorial: Examine Usual Total Nutrient Intake from Supplements and Diet: Task 1

Depending on the printlevel selected, the output from each NLMIXED run will be printed in the output. The first
NLMIXED output (replicate variable w0304_0) is a listing of the parameter estimates for the estimation of calcium.
However, the standard errors are incorrect. The other NLMIXED runs are from the BRR replications.
At the end of the output, the usual intake of calcium from food and water sources is printed:

The median intake of calcium from food and water is 721 mg (SE=27 mg). Only 17.5% of women were above the
EAR value (1000 mg).
The usual intake of calcium from food, water, and supplements is printed on the last page of the output:

The median intake of calcium from food, water, and supplements is 1,011 mg (SE=48 mg).
IMPORTANT NOTE
Note: Your results may vary slightly, as a random seed is used to estimate the distribution of usual intake. However, they
would not be expected to vary by more than 1%.

Close Window to return to module page.

https://www.cdc.gov/nchs/tutorials/Dietary/Advanced/ExamineUsualTotalNutrient/Task1.htm 16/16

NOTES

Stephanie - 2019


Click to View FlipBook Version