Tuesday, March 25, 2014

How do I account for complex sampling design when analyzing NSDUH data?

National Survey on Drug Use and Health (NSDUH)1 employs a multistage (stratified cluster) sample design for the selection of a representative sample from non-institutional members of United States households aged twelve and older. The NSDUH public-use file (PUF) includes the variance estimation variables (which were derived from the complex sample designs2): variance estimation stratum (VESTR), variance estimation cluster replicates (VEREP) and final analysis weight (ANALWT_C). VEREP is nested within the VESTR. It is therefore considered that the complex survey method for NSDUH PUF is a single-stage stratified clustering design, where the clusters are sampled with replacement (WR). There are no missing values in the variance estimation variables and final analysis weight, VESTR, VEREP and ANALWT_C. However, analysis variables can have missing values.

SUDAAN, all survey procedures in SAS, Stata, R and the survey add-on module in SPSS can handle data from complex sampling designs. The WR design is the default design, except in SPSS and Taylor series linearization is also the default method for variance estimation of them. Note that users should read the help document (of her/his respective statistical package) regarding how missing values are being handled if any exist in the analysis variables.

SAMPLE SYNTAX

Using analysis weights is important to get the point estimates right. Users must consider the weighting, clustering, and stratification of the survey design to produce correct standard errors (and degrees of freedom). The example code provided below shows how to specify these variables correctly, using an individual year of the NSDUH PUF, and also indicates how to calculate the proportions, standard errors (SE), and confidence intervals of the risk of smoking one or more packs of cigarettes per day by gender. This statistical analysis plan (SAP), in turn, results in two subpopulation analyses of proportions for each level of gender. The dependent or outcome variable is the risk of smoking one or more packs of cigarettes per day and is determined using the categorical variable, RSKPKCIG. Gender is determined using the categorical variable, IRSEX. Both of the variables in the NSDUH PUF file are numeric in downloadable SAS, Stata, SPSS, and R specific datasets. RSKPKCIG is coded numeric as 1 to 4 for no risk, slight risk, moderate risk, and great risk for valid values and as system missing for invalid values. IRSEX is imputation revised gender for missing values and is coded numeric as 1 for male and 2 for female.

For analysis of the NSDUH PUF file, one should consider three important things before preparing program code in a statistical software package:

  1. How to correctly specify the variance estimation variables including analysis weights;
  2. The statistical procedure along with requested statistics; and
  3. The domains of analysis, if any.

Each of these three considerations is discussed below. [Note the following conventions for wording in program syntax: upper case codes are statements/procedures, upper case italics are option keywords in software packages, and upper case bolded codes are variables from the input dataset.]

  1. Specify variance estimation variables. For variance estimation, each sample program code uses the Taylor linearization method for this example SAP. The WR design method is the default with the Taylor method for all but SPSS software packages. The stratification and clustering of the complex sample design in the NSDUH PUF are described by specifying the variance estimation variables (and also the analysis weight) via the statements in the analysis procedure program code for SUDAAN and SAS software packages. For example, "NEST VESTR VEREP /MISSUNIT; WEIGHT ANALWT_C;" in SUDAAN and "STRATA VESTR; CLUSTER VEREP; WEIGHT ANALWT_C;"in SAS. Note that the order of the variables in the NEST statement is important. One should use the above block of statements (specific to NSDUH complex design) in any survey procedure program code for any SAP. For example, PROC SURVEYLOGISTIC in SAS and PROC LOGISTIC in standalone SUDAAN.

    The above can be implemented by the SVYSET command in Stata as "SVYSET VEREP[pweight =ANALWT_C], STRATA(VESTR) SINGLEUNIT(centered)". SPSS requires an analysis plan design file for the data file to perform a complex survey analysis. The first block of code in the SPSS program syntax, below, for the CSPLAN ANALYSIS procedure will create such an analysis plan file.

    See the "How are complex sampling variances computed by Taylor linearization method?" FAQ on the use of MISSUNIT option in SUDAAN, SINGLEUNIT(centered) option in Stata, and the NOMCAR procedure option in SAS.

  2. Statistical procedures and requested statistics. In the SAP, RSKPKCIG is the analysis variable with four valid and missing values and IRSEX will be used to define the domains or subpopulations. [In general, the goal is to get results in proportions (not in percentages) of a (outcome or dependent) variable for multiple subpopulations.] Stata's SVY: PROPORTION produces estimates of proportions, along with SEs, for character or numeric variables. SAS's SURVEYMEANS always analyzes character variables as categorical. So, RSKPKCIG can be declared as a character variable by specifying it in both the CLASS and VAR statements to obtain the estimates of the proportions, along with SEs. R’s svyby procedure with the factor (variable) function and FUN=svymean argument produces the mean, SEs and confidence intervals, in which the factor function converts a variable to a set of dummy variables, while SUDAAN's DESCRIPT procedure and SPSS's CSDESCRIPTIVES method compute means, along with SEs, for only continuous variables. The mean estimate of a 0/1 coding dummy variable is essentially a proportion estimate. Therefore, the four dummy variables (RSK1, RSK2, RSK3, and RSK4) that were created for the RSKPKCIG variable also contain missing values. SUDAAN’s DESCRIP and SPSS’s CSDESCRIPTIVES procedures can be used for our desired analysis by obtaining means (i.e., proportions), along with SEs, for the four dummy variables of RSKPKCIG. [Note that using SVY: MEAN in Stata and SURVEYMEANS (no CLASS statement) in SAS, the same analysis of means can be obtained for a list of indicator variables of a categorical variable.]

  3. Domains of Analysis. The CLASS and TABLES statements in SUDAAN, OVER command in Stata, DOMAIN statement in SAS and SUBPOP TABLE statement in SPSS specify the multiple subpopulations/domains for a variable (e.g., two for IRSEX) to which analyses are to be performed. For example, the following SAS program code with "DOMAIN IRSEX;" statement will output the analysis results for the variables in VAR statement for two domains; one for the male (IRSEX=1) population and the other for the female (IRSEX=2) population.

SUDAAN standalone syntax:

[The input data file that is used for this example is in the SAS Export format. SUDAAN recommends that an input dataset is sorted by the variables in the NEST statement; otherwise, NOTSORTED option must be specified in the PROC statement.]

PROC DESCRIPT filetype=SASXPORT data="path\nsduh2011.xpt" NOTSORTED;
NEST  VESTR  VEREP  / MISSUNIT;
WEIGHT  ANALWT_C;
CLASS IRSEX;
TABLES IRSEX;
VAR  RSK1  RSK2  RSK3  RSK4;
PRINT mean semean lowmean upmean
/style=nchs meanfmt=f6.3 semeanfmt=f6.3 lowmeanfmt=f7.3 upmeanfmt=f7.3;

Stata specific code for the same analysis:

use drivename:\path\nsduh2011.dta
svyset VEREP[pweight=ANALWT_C], strata(VESTRsingleunit(centered)
save drivename:\path\nsduh2011svy.dta, replace

[It is a good practice to save the survey setting permanently in the data file. This allows for this saved data to be used for any subsequent survey analysis.]

use drivename:\path\nsduh2011svy.dta
SVY: PROP RSKPKCIG, OVER(IRSEX)

SAS code for this analysis:

PROC SURVEYMEANS data=sasdata NOMCAR mean clm;
STRATA VESRT;
CLUSTER VEREP;
WEIGHT ANALWT_C;
DOMAIN IRSEX / DFADJ;
CLASS RSKPKCIG;
VAR RSKPKCIG;
run;

The SPSS specific code for the same analysis:

[The example code assumes that the user's SPSS software package has the complex survey module installed. Select the first block of code below, copy, and then paste it into the SPSS Syntax Editor. Replace the ‘folder-path' by providing the path location where you would like to save the nsduh11.csplan xml file. Select and run this modified syntax code in the Syntax Editor. CSPLAN will write this Analysis Design into the nsduh11.csplan xml file. The second block of code shows how to reference the nsduh11.csplan xml file in the CSDESCRIPTIVES and other Complex Survey procedures in the current and future SPSS sessions.]

CSPLAN ANALYSIS
/PLAN FILE='folder-path\nsduh11.csplan'
/PLANVARS ANALYSISWEIGHT= ANALWT_C
/DESIGN STRATA= VESTR CLUSTER= VEREP
 /ESTIMATOR TYPE = WR.

get file='path\nsduh2011.sav'.

CSDESCRIPTIVES
/PLAN FILE= 'folder-path\nsduh11.csplan'
/SUMMARY VARIABLES= RSK1  RSK2  RSK3  RSK4
/SUBPOP TABLE= IRSEX DISPLAY=LAYERED
/MEAN
/STATISTICS se cin(95)
/MISSING SCOPE=ANALYSIS CLASSMISSING=EXCLUDE.

R specific sample code for the same analysis:

load("folder-path/nsduh2011.rda")
keepvars = c("VESTR", "VEREP",  "ANALWT_C", "IRSEX", "RSKPKCIG" )
nsduh11 = nsduh2011[, keepvars]             #make a data file with fewer variables

library(prettyR)   # requires to install the prettyR package
nsduh11$RSKPKCIG<- as.numeric(sub("^\\(0*([0-9]+)\\).+$", "\\1", nsduh11$RSKPKCIG))
nsduh11$IRSEX <- as.numeric(sub("^\\(0*([0-9]+)\\).+$", "\\1", nsduh11$IRSEX))

library(survey)  #needs to install the survey package
options( survey.lonely.psu = "adjust" )
desg <- svydesign(id = ~VEREP , strata = ~VESTR , weights = ~ANALWT_C , data = nsduh11 , nest = TRUE )

# calculate the means or proportions of RSKPKCIG by the levels of IRSEX and their SEs
out = svyby(~factor(RSKPKCIG), ~IRSEX, design = desg , FUN=svymean, vartype=c("se","ci"), na.rm = TRUE)
coef(out)      #extracting the means
SE(out)         #extracting the SEs of means
confint(out)  # 95% confidence intervals of mean
print(out)     #all results

Note that the variance estimation variables (except the sampling weight variable) do not affect the mean, proportion, percent, and other first-order moment statistics. For example, in SUDAAN syntax code, the design=WR option and entire "nest VESRT VEREP;" statement in PROC DESCRIPT have no impact on mean/proportion estimates. However, the variance estimation variables must be used (e.g., design=option and nest statement as above) to produce the SE estimates of descriptive (e.g., SE of mean/proportion) and inferential statistics (e.g., confidence intervals of mean/proportion and p-value of testing hypothesis).



1Prior to 2002, data were collected under the old title - National Household Survey on Drug Abuse (NHSDA)

2For further details on the sampling design and weighting adjustment method, please see the 2011 NSDUH Methodological Resource Book

57 comments:

  1. Thank you for this. So helpful!

    ReplyDelete
    Replies
    1. Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download Now

      >>>>> Download Full

      Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download LINK

      >>>>> Download Now

      Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download Full

      >>>>> Download LINK 8s

      Delete
  2. This is extremely helpful, thanks so much!

    ReplyDelete
  3. This blog gives very important info about SAS Thanks for sharing.Very well written information. Many

    thanks.
    SAS training

    ReplyDelete
  4. Many thanks! just what i was looking for

    ReplyDelete
  5. What is the corresponding R function (in the survey package) similar to the nomcar option in SAS to estimate the variance? Thanks

    ReplyDelete
  6. Such an amazing blog! This is a great article shared by you. It's very informative and knowledgeable.
    I am very happy to read thi blog and appreciate your sharing.
    Hire a Statistician
    analysis in statistics
    spss method of data analysis
    what statistical test to use
    statistics help online

    ReplyDelete
  7. STATA 17 MP Crack Full Version
    Stata 17.0 MP Crack Full Version is an integrated statistical tool which gives data analysis
    Stata 17 MP Crack Full Version Full Download! Stata 17 MP Crack Full Version is flexible and powerful statical software for the science field
    Link Download Stata 17 MP Crack Full Version
    https://dik.si/MPV17

    ReplyDelete

  8. Nice explanation and article. Continue to write articles like these, and visit my website at https://usacrack.info/ for more information.
    SparkoCam Crack
    Stata Crack

    ReplyDelete

  9. Nice explanation and article. Continue to write articles like these, and visit my website at https://usacrack.info/ for more information.
    Rockstar 1.1 Crack
    DC Unlocker 1.00 Crack
    DLL Files Fixer Crack
    Quillbot Premium Crack

    ReplyDelete
  10. Instagram unveils Reels, a TikTok clone
    Is TikTok the best app in the world right now? There is an increasing amount of evidence that a lot of people at Facebook and Instagram HQ seem to think so.

    sms sending jobs
    mobile app store

    What is Windows 10X?
    Foldable screens and new dual screen devices have increasingly become the trend. Manufacturers now want to show themselves as forward thinking hardware developers. Microsoft's upcoming Windows 10X operating system has long been rumored to be the software giant's first foray into the dual screen world we all look likely...


    Report: Your phone number reveals more personal info than your name
    According to a recent New York Times article, your phone number has loads of personal information attached to it. Quite often, websites and apps ask us for our phone number when logging in or creating an account.



    A dark mode is coming to Google Chrome on desktop
    A dark mode is coming to Google Chrome on desktop
    Every app these days seems to have a new dark mode or one in development. This is due in part to the appearance a slick black background can give but also due to recent research from Google that shows darker colors use up less battery power on devices with...


    Google now allows you to play podcasts within search results
    The podcasting world has always been a bit of the Wild West. You'd discover a series through word of mouth or maybe by way of an article listing recommendations. Then it's on you to use a podcasting app or go to the website to download the episode and listen..

    LEAK: Windows 10 removes live tiles in new Start menu
    A new leak shows that Windows 10's new look will not feature live tiles. For those who do not know, live tiles are the moving tiles on your Start menu.

    ReplyDelete
  11. Nice explanation and article. Continue to write articles like these, and visit my website athttps://usacrack.info/ for more information.
    Microsoft Toolkit Crack
    iMazing Crack
    DC Unlocker Crack
    DLL Files Fixer Crack
    Dr.Fone Carck

    ReplyDelete
  12. PC Software Download
    You make it look very easy with your presentation, but I think this is important to Be something that I think I would never understand
    It seems very complex and extremely broad to me. I look forward to your next post,
    Cylance Smart Antivirus Crack
    Neevia Document Converter Crack
    Loaris Trojan Remover Crack
    ON1 Photo RAW Crack
    Burp Suite Pro Crack
    Luminar Crack

    ReplyDelete
  13. After reviewing numerous blog posts on the site,
    We really appreciate how your blog works.
    We've added it to your list of favorite sites, and we'll review it soon.
    Future. Also, check out my website and let us know what you think.
    You have done a great job. I appreciate your work, thank you for sharing.
    Ecrack.org Full Version Softwares Free
    ON1 Photo Raw Crack

    ReplyDelete
  14. Download Software for PC & Mac
    You make it look very easy with your presentation, but I think this is important to Be something that I think I would never understand
    It seems very complex and extremely broad to me. I look forward to your next post,
    Arclab Watermark Studio Crack
    Movavi Video Converter Crack
    TunesKit Spotify Converter Crack
    Samsung Smart Switch Crack
    FortKnox Personal Firewall Crack
    SparkoCam Crack

    ReplyDelete
  15. After looking through a few blog articles on your website,we sincerely appreciate the way you blogged.We’ve added it to our list of bookmarked web pages and will be checking back in the nearfuture. Please also visit my website and tell us what you think.Great work with hard work you have done I appreciate your work thanks for sharing it.
    Keyword Researcher Pro Crack
    Tridef 3D Crack
    iCloud Remover Crack
    AVG Secure VPN Crack
    SAM Broadcaster Pro Crack
    QuarkXPress Crack
    Glyphs Crack
    Acorn Crack

    ReplyDelete
  16. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. axcrack.com I hope to have many more entries or so from you.
    Very interesting blog.
    DC Unlocker Crack

    ReplyDelete
  17. I came here looking for advice and also discovered a platform that can help me do it too. Thanks
    Express Scribe Crack
    iMyFone Fixppo Crack
    Stata Crack

    ReplyDelete
  18. “Thank you so much for sharing all this wonderful info with the how-to's!!!! It is so appreciated!!!” “You always have good humor in your posts/blogs. So much fun and easy to read!


    Sidify Music Converter Crack

    EaseUS Todo Backup Crack

    Windows 11 Crack

    SparkoCam Crack

    Titanium Backup Pro Crack

    GlassWire Crack

    ReplyDelete
  19. “Thank you so much for sharing all this wonderful info with the how-to's!!!! It is so appreciated!!!” “You always have good humor in your posts/blogs. So much fun and easy to read!


    PassMark BurnInTest Pro Crack

    OpenShot Video Editor Crack

    SparkoCam Crack

    Apowersoft Watermark Remover Crack

    ReplyDelete




  20. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. wahabtech.net I hope to have many more entries or so from you.
    Very interesting blog.
    Neevia Document Converter Pro Crack

    ReplyDelete
  21. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the

    past 6 years, but I had no idea of solving some basic issues. I do not know how to

    Download Cracked Pro Softwares
    But thankfully, I recently visited a website named Crack Softwares Free Download
    Luminar Crack
    Wondershare Recoverit Crack
    AquaSoft SlideShow Ultimate Crack

    ReplyDelete
  22. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. gurucrack.org I hope to have many more entries or so from you.
    Very interesting blog.
    Clone Files Checker Crack

    ReplyDelete
  23. Mobile App Development Company
    We are a leading mobile app development agency known for developing custom mobile apps for iOS and Android platforms. Our mobile app developers have the expertise to create mobile applications using AI and ML technologies. Want to make your own app

    backlinking what are backlinks
    thinking like search engine
    kei keyword effectiveness

    ReplyDelete
  24. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    Crackplus.org
    Adobe Acrobat Pro DC Crack
    EaseUS Partition Master Crack
    Aiseesoft FoneTrans Crack
    4K Video Downloader Crack
    CherryPlayer Crack

    ReplyDelete
  25. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    iMyFone Fixppo Crack free downoad

    ReplyDelete
  26. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.

    Live Home 3D Pro Crack Free Downloard

    CyberLink PowerDirector Crack Free Downloard
    DaVinci Resolve Crack Free Downloard
    Cool Edit Pro Crack Free Downloard
    FL Studio Crack Free Downloard

    ReplyDelete
  27. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 6 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited a website named PCexe.org
    All Pro Cracked Softwares Download
    Revo Uninstaller Pro Crack
    VueScan Pro Crack
    Panda Antivirus Pro Crack
    Windows 12 Pro Crack
    Zemana AntiMalware Premium Crack

    ReplyDelete
  28. OpenShot Video Editor 2.7.1 Crack is a simple user-friendly video editor. It helps you edit videos with eye-catching beauty and creativity. ..https://getpcrack.com/openshot-video-editor-crack/

    ReplyDelete
  29. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. Keep it up!
    Titanium Backup Pro Crack APK
    IntelliJ IDEA Download
    Veritas Backup Exec Full Crack
    Download Tally ERP 9 Latest Version Free Crack

    ReplyDelete
  30. Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download Now

    >>>>> Download Full

    Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download LINK

    >>>>> Download Now

    Samhda Faqs: How Do I Account For Complex Sampling Design When Analyzing Nsduh Data? >>>>> Download Full

    >>>>> Download LINK rQ

    ReplyDelete
  31. I came here looking for advice and also discovered a platform that can help me do it too. Thanks
    Jaws Crack

    ReplyDelete
  32. I'm really impressed with your writing skills, as smart as the structure of your


    Latest Software Free Download



    weblog. Is this a paid topic



    Diskdigger crack



    do you change it yourself? However, stopping by with great quality writing, it's hard to see any good blog today.



    Program4pc audio convertercrack





    Diskdigger-crack





    Reimage pc reapir crack




    aquasoft pro crack



    ReplyDelete
  33. I’m really impressed with your article, such great & usefull knowledge you mentioned here. https://freesoftwareapps.com/chief-architect-premier-crack/

    ReplyDelete
  34. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot.I hope to have many more entries or so from you.
    Very interesting blog.
    crackplus.org
    Adobe Acrobat Pro DC Crack
    PhpStorm Crack
    Virtual DJ Pro Infinity Crack
    EASEUS Data Recovery Wizard Crack
    CCleaner Professional Crack

    ReplyDelete

  35. I really like your content. Your post is really informative. I have learned a lot from your article and I’m looking forward to applying it in my article given below!.
    CPUID HWMonitor Pro Crack
    Movavi Photo Editor Crack

    ReplyDelete
  36. I thought this was a pretty interesting read when it comes to this topic. Thank you
    Universal Keygen Generator Crack
    StarUML Crack
    iDevice Manager Crack
    Windows TubeMate Crack

    ReplyDelete
  37. Great Article. I am learning to be social on SM and learning to blog etc. So all your info helps

    solid-edge-crack
    gta-trilogy-crack
    alfred-crack

    ReplyDelete
  38. It's simple to use, offers an excellent variety of effects, and can help you improve the quality of your videos. Version in its entirety Click Here for Interesting Links.안동출장마사지
    영천출장마사지
    영주출장마사지
    포항출장마사지
    경산출장마사지
    구미출장마사지
    경주출장마사지
    완도출장마사지
    궁합출장마사지

    ReplyDelete
  39. I read this article! I hope you will continue to have such articles to share with everyone! thank you! You can Visit my websit홈케어
    홈케어
    홈케어
    홈케어
    홈케어
    홈케어
    홈케어

    ReplyDelete
  40. Amazing blog! I really like the way you explained such information about this post with us. And blog is really helpful for us this website양평아로마
    경기아로마
    수원아로마
    성남아로마
    의정부아로마
    양평아로마
    안양아로마

    ReplyDelete
  41. Tally ERP Crack Free Download Tally ERP 9.6.7 Crack is a powerful utility tool for resource management. It allows you to handle inventory control, payroll, accounting, and tax management. available on Fasisoftz.com Tally ERP enables you to do all of their business without any difficulties.

    ReplyDelete
  42. I'm really impressed with your writing skills, as smart as the structure of your weblog.
    Appreciation is a wonderful thing...thanks for sharing kepp it up.
    Free Download Crack
    Free Download Crack
    Free Download Crack
    Free Download Crack

    ReplyDelete