Skip to content
Prev 78378 / 398502 Next

"Survey" package and NAMCS data... unsure of specification

On Tue, 4 Oct 2005, David L. Van Brunt, Ph.D. wrote:

            
Supposing your data frame is called 'namcs'

dnamcs <- svydesign(id=~CPSUM, strata=~CSTRATM, weight=~PATWT, data=namcs)

or perhaps

dnamcs <- svydesign(id=~CPSUM, strata=~CSTRATM, weight=~PATWT,
                       data=namcs, nest=TRUE)

(nest=TRUE is needed if CPSUM repeats the same values in different 
strata).

Also, if you have access to design variables for the multistage design you 
can use them (but it probably won't make much difference). There's a very 
brief example using the National Health Interview Study at
  http://faculty.washington.edu/tlumley/survey/example-twostage.html


 	-thomas