MA 678 HW5
Shuning Zhu
10/7/2021
15.1 Poisson and negative binomial regression:
The folder RiskyBehavior contains data from a randomized trial targeting couples at high risk of HIV
infection. The intervention provided counseling sessions regarding practices that could reduce their likelihood
of contracting HIV. Couples were randomized either to a control group, a group in which just the woma
...[Show More]
MA 678 HW5
Shuning Zhu
10/7/2021
15.1 Poisson and negative binomial regression:
The folder RiskyBehavior contains data from a randomized trial targeting couples at high risk of HIV
infection. The intervention provided counseling sessions regarding practices that could reduce their likelihood
of contracting HIV. Couples were randomized either to a control group, a group in which just the woman
participated, or a group in which both members of the couple participated. One of the outcomes examined
after three months was “number of unprotected sex acts.”
a)
Model this outcome as a function of treatment assignment using a Poisson regression. Does the model fit
well? Is there evidence of overdispersion?
risk <- read.csv("https://raw.githubusercontent.com/avehtari/ROS-Examples/master/RiskyBehavior/data/risk
risk$fupacts_R = round(risk$fupacts)
risk$women_alone <- as.factor(risk$women_alone)
risk$couples <- as.factor(risk$couples)
risk$bs_hiv <- as.factor(risk$bs_hiv)
fit_1.1 <- stan_glm(fupacts_R ~ women_alone, family = poisson(link = "log"), data = risk, refresh = 0)
print(fit_1.1, digits = 4)
## stan_glm
## family:
## formula: |
poisson [log]
fupacts_R ~ women_alone |
## observations: 434 |
## predictors:
## ------
##
## (Intercept) |
2 |
Median MAD_SD
2.9209 0.0141 |
## women_alone1 -0.4041 0.0282
##
[Show Less]