library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.2     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(pastecs)
## 
## Attaching package: 'pastecs'
## 
## The following objects are masked from 'package:dplyr':
## 
##     first, last
## 
## The following object is masked from 'package:tidyr':
## 
##     extract
library(readxl)
duh_data <- load("NSDUH 2022.Rdata")
nsduh <- puf2022_110424
stat.desc(nsduh$ALCDAYS)
##                         x
## nbr.val      5.906900e+04
## nbr.null     0.000000e+00
## nbr.na       0.000000e+00
## min          1.000000e+00
## max          9.800000e+01
## range        9.700000e+01
## sum          3.253693e+06
## median       9.100000e+01
## mean         5.508292e+01
## SE.mean      1.732658e-01
## CI.mean.0.95 3.396016e-01
## var          1.773312e+03
## std.dev      4.211071e+01
## coef.var     7.644968e-01

The variable ALCDAYS represents the respondents’ best estimate regarding the number of days they drank alcohol in the previous 30 days (range 0-30). This is the study’s independent variable; higher values indicate more frequent alcohol use. ALCDAYS will be analyzed to determine whether increased alcohol use is associated with higher psychological distress.

hist(nsduh$ALCDAYS)

nsduh_transform<-nsduh|>mutate(ALCDAYS_log=log(ALCDAYS))
hist(nsduh_transform$ALCDAYS_log)