diff --git a/docs/american-community-survey-acs.html b/docs/american-community-survey-acs.html index 6d0bdf1b..e5d51c1d 100644 --- a/docs/american-community-survey-acs.html +++ b/docs/american-community-survey-acs.html @@ -766,6 +766,7 @@
Please skim before you begin:
+Four Example Strengths & Limitations:
+✔️ Detailed questions about substance use and mental health
+✔️ Restricted data can be pooled for state estimates
+ +❌ Data from 2021 should not be compared to estimates from 2019 or earlier
+Three Example Findings:
2021 National Survey on Drug Use and Health (NSDUH): Public Use File Codebook
2021 National Survey on Drug Use and Health (NSDUH): Methodological Summary and Definitions
A haiku regarding this microdata:
Across 2002-2014, 36% of adolescents and young adults with ADHD used cannibis in the past month.
Two Methodology Documents:
+++2023 National Survey on Drug Use and Health (NSDUH): Public Use File Codebook
+
++2023 National Survey on Drug Use and Health (NSDUH): Methodological Summary and Definitions
+
One Haiku:
Download and import the national file:
zip_tf <- tempfile()
zip_url <-
- paste0(
- "https://www.datafiles.samhsa.gov/sites/default/files/field-uploads-protected/" ,
- "studies/NSDUH-2021/NSDUH-2021-datasets/NSDUH-2021-DS0001/" ,
- "NSDUH-2021-DS0001-bundles-with-study-info/NSDUH-2021-DS0001-bndl-data-r_v3.zip"
- )
-
-download.file( zip_url , zip_tf , mode = 'wb' )
+ "https://www.samhsa.gov/data/system/files/media-puf-file/NSDUH-2023-DS0001-bndl-data-r_v1.zip"
+
+download.file( zip_url , zip_tf , mode = 'wb' )
+
+nsduh_rdata <- unzip( zip_tf , exdir = tempdir() )
+
+nsduh_rdata_contents <- load( nsduh_rdata )
-nsduh_rdata <- unzip( zip_tf , exdir = tempdir() )
+nsduh_df_name <- grep( 'PUF' , nsduh_rdata_contents , value = TRUE )
-nsduh_rdata_contents <- load( nsduh_rdata )
+nsduh_df <- get( nsduh_df_name )
-nsduh_df_name <- grep( 'PUF' , nsduh_rdata_contents , value = TRUE )
+names( nsduh_df ) <- tolower( names( nsduh_df ) )
-nsduh_df <- get( nsduh_df_name )
-
-names( nsduh_df ) <- tolower( names( nsduh_df ) )
-
-nsduh_df[ , 'one' ] <- 1
Save the object at any point:
@@ -1411,11 +1427,11 @@This matches the prevalence and SE of alcohol use in the past month from Codebook Table G.2:
+This matches the prevalence and SE of alcohol use in the past month from Codebook Table F.2:
result <- svymean( ~ alcmon , nsduh_design )
-stopifnot( round( coef( result ) , 3 ) == 0.474 )
-stopifnot( round( SE( result ) , 4 ) == 0.0043 )
Two Methodology Documents:
Data File Documentation and User’s Guide
diff --git a/docs/rapid-surveys-system-rss.html b/docs/rapid-surveys-system-rss.html index c4011cda..a6c9f663 100644 --- a/docs/rapid-surveys-system-rss.html +++ b/docs/rapid-surveys-system-rss.html @@ -766,6 +766,7 @@- National Survey on Drug Use and Health (NSDUH)