Analyzing NHANES Data Using R Statistical Software

822 views
Skip to first unread message

Jyoti Shankar

unread,
Mar 4, 2010, 6:17:02 PM3/4/10
to meds...@googlegroups.com
Hi everyone,

The guide to analyzing the NHANES dataset recommends using SAS or SUDAAN software for analysis of the datasets. http://www.cdc.gov/nchs/tutorials/Nhanes/index_current.htm  It also provides sample codes and procedures for dealing with the complex sampling design and weights in SAS/SUDAAN. 

Does anyone know of a similar example code for R?

Thanks,
Jyoti



Juliet Hannah

unread,
Mar 5, 2010, 9:19:21 AM3/5/10
to meds...@googlegroups.com
I have not found example code for NHANES. But there is a survey
package by Lumley. There is also a book coming out (or
it may be out) on how to use this package for survey data.

> --
> To post a new thread to MedStats, send email to MedS...@googlegroups.com .
> MedStats' home page is http://groups.google.com/group/MedStats .
> Rules: http://groups.google.com/group/MedStats/web/medstats-rules

Jyoti Shankar

unread,
Mar 5, 2010, 10:59:23 AM3/5/10
to meds...@googlegroups.com
Thanks for your reply. I found Dr. Lumley's page with some pointers on survey analysis in R here: http://faculty.washington.edu/tlumley/survey/  It seems his book is already out: http://faculty.washington.edu/tlumley/svybook/

I will check these out. As always, any other resources that people can think of are always appreciated. 

Thanks,
Jyoti

Frank Harrell

unread,
Mar 7, 2010, 12:13:02 AM3/7/10
to MedStats
Keep in mind that in many cases, it is better to ignore sample weights
than to use them. Using weights in the analysis implies downweighting
some of the frequent observations, effectively reducing sample size
and increasing variance. When possible, conditioning on strata
(covariates) provides a better answer to questions of interest. If
you condition on, say, sex, and females were oversampled, the sampling
weight is not relevant.

Frank


On Mar 5, 9:59 am, Jyoti Shankar <jyoti.shan...@gmail.com> wrote:
> Thanks for your reply. I found Dr. Lumley's page with some pointers on
> survey analysis in R here:http://faculty.washington.edu/tlumley/survey/ It
> seems his book is already out:http://faculty.washington.edu/tlumley/svybook/
>
> <http://faculty.washington.edu/tlumley/svybook/>I will check these out. As
> always, any other resources that people can think of are always
> appreciated.
>
> Thanks,
> Jyoti
>

> On 5 March 2010 09:19, Juliet Hannah <juliet.han...@gmail.com> wrote:
>
> > I have not found example code for NHANES. But there is a survey
> > package by Lumley. There is also a book coming out (or
> > it may be out) on how to use this package for survey data.
>

> > On Thu, Mar 4, 2010 at 6:17 PM, Jyoti Shankar <jyoti.shan...@gmail.com>


> > wrote:
> > > Hi everyone,
> > > The guide to analyzing the NHANES dataset recommends using SAS or SUDAAN
> > > software for analysis of the

> > > datasets.http://www.cdc.gov/nchs/tutorials/Nhanes/index_current.htm It

Mike

unread,
Mar 17, 2010, 5:19:56 AM3/17/10
to MedStats
Dear Frank
Your remarks are are very pertinent. I would have thought this
depended on the question of interest. If you wanted to compare two
areas for, say, the prevalence of obesity, and you wanted to adjust
for sex, then I've never really understood how to use sample weights,
since it is the relationship within the sample that is of interest.
Conditioning seems very sensible. I'd be interested if there was a
reference for this? However if the question was what is the proportion
of women in the population, then surely you should use sample weights?
Mike

Frank Harrell

unread,
Mar 17, 2010, 10:50:44 PM3/17/10
to MedStats
Hi Mike,

I'll bet this is covered in Korn and Graubard's Analysis of Health
Surveys book. I think sampling weights are needed to answer questions
that are not for specific subjects, i.e., are not fully conditioned
upon.

Frank

Reply all
Reply to author
Forward
0 new messages