Exercise 1

Create a table1 and use GGally::ggpairs to explore your data.

Table 1: Demographic stratified by lifetime marijuana use
No
(N=491)
Yes
(N=509)
Sex
Female 285 (58.0%) 249 (48.9%)
Male 206 (42.0%) 260 (51.1%)
Alcohol (age first used)
Mean (SD) 19.7 (5.09) 16.0 (3.08)
Median [Min, Max] 19.0 [3.00, 45.0] 16.0 [3.00, 29.0]
Missing 145 (29.5%) 12 (2.4%)
Age
18-25 53 (10.8%) 80 (15.7%)
26-34 52 (10.6%) 87 (17.1%)
35-49 129 (26.3%) 136 (26.7%)
50-64 109 (22.2%) 132 (25.9%)
65+ 148 (30.1%) 74 (14.5%)
Income
Less than $20,000 76 (15.5%) 85 (16.7%)
$20,000 - $49,999 166 (33.8%) 127 (25.0%)
$50,000 - $74,999 64 (13.0%) 81 (15.9%)
$75,000 or more 185 (37.7%) 216 (42.4%)

ggpairs plot

##            mj_lifetime    
##  demog_sex          No Yes
##     Female         285 249
##       Male         206 260
##            mj_lifetime      
##  demog_sex          No   Yes
##     Female       53.4% 46.6%
##       Male       44.2% 55.8%

Exercise 2

Prediction General Female Male
Probability 0.509 0.466 0.558
Odds 1.037 0.874 1.262
Log Odds 0.036 -0.135 0.233
Contrast Males vs. Females
Risk difference 0.092
Risk Ratio 1.197
Odds ratio 1.444
Log odds ratio 0.367

Exercise 3

## # A tibble: 1 × 7
##   term        estimate std.error statistic p.value conf.low conf.high
##   <chr>          <dbl>     <dbl>     <dbl>   <dbl>    <dbl>     <dbl>
## 1 (Intercept)    0.233    0.0933      2.50  0.0126   0.0505     0.416
Prediction General Female Male
Probability 0.509 CI [0.478, 0.54] 0.466 CI [0.424, 0.509] 0.558 CI [0.513, 0.603]
Odds 1.037 CI [0.916, 1.174] 0.874 CI [0.737, 1.035] 1.262 CI [1.052, 1.516]
Log Odds 0.036 CI [-0.088, 0.16] -0.135 CI [-0.305, 0.035] 0.233 CI [0.051, 0.416]
Prediction General Female Male
Probability 0.509 CI [0.478, 0.54] 0.466 CI [0.424, 0.509] 0.558 CI [0.513, 0.603]
Odds 1.037 CI [0.916, 1.174] 0.874 CI [0.736, 1.036] 1.262 CI [1.052, 1.52]
Log Odds 0.036 CI [-0.088, 0.16] -0.135 CI [-0.307, 0.035] 0.233 CI [0.051, 0.419]
Contrast Males vs. Females me_lm Males vs. Females me_glm Males vs. Females glm
Risk difference 0.092 CI [0.03, 0.154] 0.092 CI [0.03, 0.153] -
Risk Ratio 1.197 CI [1.051, 1.342] 1.197 CI [1.051, 1.342] -
Odds ratio 1.445 CI [1.125, 1.855] 1.445 CI [1.125, 1.854] 1.445 CI [1.126, 1.855]
Log odds ratio 0.368 CI [0.118, 0.618] 0.368 CI [0.118, 0.617] 0.368 CI [0.119, 0.618]

Exercise 4

Conclusion: Males have significantly higher odds of lifetime marijuana use than females (OR = 1.445 CI 95% [1.125, 1.854, p = 0.004). Males have 44.5% (higher) odds of lifetime marijuana use than females.

Exercise 5

Age at first alcohol use is significantly negatively associated with lifetime marijuana use (OR = 0.753 ; 95% CI = 0.713 , 0.792 ; p < 0.001 ). Individuals who first used alcohol at age 19 years have 25.06 % lower odds of having ever used marijuana than those who first used alcohol at age 18 years. In contrast, the reduction in odds associated with starting drinking alcohol 3 years later is -67.826 % lower odds.

Exercise 6

The AOR for our primary predictor alc_agefirst is 0,759 (with interaction 0,713). This represents the OR for lifetime marijuana use comparing those with a one-year difference in age at first use of alcohol, adjusted for age, sex, and income.

The remaining AORs compare levels of categorical predictors to their reference level, adjusted for the other predictors in the model. For example, comparing individuals with the same age of first alcohol use, sex, and income, 35-49 year-olds have 55.3 % (with interaction 55.8 %) lower odds of lifetime marijuana use than 18-25 year-olds (OR = 0.447 ; 95% CI = 0.247 , 0.791 ; p = 0,007 | with interaction: OR = 0.442 ; 95% CI = 0.243, 0.784 ; p = 0,006). An overall 4 df p-value for age can be read from the Type III Test table. It is significant at p = 0.001 . An overall, 3 df p-value for income is not significant at (p = 0.1).

Conclusion: After adjusting for age, sex, and income, age at first alcohol use is significantly negatively associated with lifetime marijuana use (AOR = 0.759 ; 95% CI = 0.718 , 0.8 ; p < 0.001 | with interaction AOR = 0.713 ; 95% CI = 0.654 , 0.772 ; p < 0.001 ). Individuals who first used alcohol at a given age have 24.1% (with interaction: 28.7 %) lower odds of having ever used marijuana than those who first used alcohol one year earlier. The association between age of first alcohol use and lifetime marijuana use differs significantly between males and females (p = 0.0322 ). A likelihood ratio test shows that the adjusted model with the interaction is superior to the one without the interaction (p = 0,031)

Exercise 7:

Replicate the model summary shown below, and discuss its main features. Use the likelihood ratio test to determine which model is best, and discuss the association between age of first alcohol and lifetime marijuana use, when comparing males to females.

## Likelihood ratio test
## 
## Model 1: mj_lifetime ~ alc_agefirst
## Model 2: mj_lifetime ~ alc_agefirst + demog_age_cat6 + demog_sex + demog_income
## Model 3: mj_lifetime ~ alc_agefirst + demog_age_cat6 + demog_sex + demog_income + 
##     alc_agefirst * demog_sex
##   #Df  LogLik Df   Chisq Pr(>Chisq)    
## 1   2 -484.22                          
## 2  10 -467.78  8 32.8861  6.457e-05 ***
## 3  11 -465.45  1  4.6556    0.03095 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
unadjasted adjusted interaction
(Intercept) 5.341*** 6.254*** 7.374***
(0.475) (0.591) (0.829)
alc_agefirst -0.284*** -0.275*** -0.338***
(0.027) (0.028) (0.042)
demog_age_cat626-34 -0.296 -0.295
(0.329) (0.331)
demog_age_cat635-49 -0.804** -0.816**
(0.297) (0.299)
demog_age_cat650-64 -0.690* -0.687*
(0.299) (0.301)
demog_age_cat665+ -1.275*** -1.260***
(0.304) (0.306)
demog_sexMale -0.061 -2.138*
(0.162) (0.985)
demog_income$20,000 - $49,999 -0.531* -0.530*
(0.266) (0.268)
demog_income$50,000 - $74,999 -0.079 -0.093
(0.305) (0.307)
demog_income$75,000 or more -0.361 -0.363
(0.253) (0.255)
alc_agefirst × demog_sexMale 0.119*
(0.056)
Num.Obs. 843 843 843
AIC 972.4 955.6 952.9
BIC 981.9 1002.9 1005.0
Log.Lik. -484.219 -467.776 -465.448
F 112.743 14.804 13.139
RMSE 0.44 0.43 0.43
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001

Exercise 8

Replicate the forest plot shown below, using centralized variables scaled such that standard deviations are 0.5 (you can use the function datawizard::standardize(two_sd = TRUE). What is the advantage of this plot compared to the model summary tables shown above?