Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
#cutdown data-set to only use variables of interest#recode variables#emotional ipv & birthssub<-ugtotal%>%transmute(int.cmc=v008,emoipv=d104,fbir.cmc=b3_01,sbir.cmc=b3_02, weight=v005/1000000,psu=v021,strata=v022)select(sub,int.cmc,fbir.cmc, sbir.cmc, emoipv, weight, psu, strata)
# A tibble: 18,506 × 7
int.cmc fbir.cmc sbir.cmc emoipv weight psu strata
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1400 NA NA NA 1.10 1 1
2 1400 1381 1330 NA 1.10 1 1
3 1400 1208 1173 NA 1.10 1 1
4 1400 1389 NA NA 1.10 1 1
5 1400 NA NA NA 1.10 1 1
6 1400 NA NA NA 1.10 1 1
7 1400 1380 1358 NA 1.10 1 1
8 1400 1329 1293 0 1.10 1 1
9 1400 1324 NA NA 1.10 1 1
10 1400 1364 1316 1 1.10 1 1
# … with 18,496 more rows
This project is a survival analysis of the event of experiencing a second birth amongst a population of Ugandan women, stratified by if they have experienced IPV or not
Define your event variable:
birth
Define a duration or time variable
interval between births
Define a censoring indicator
-women that have not experienced their next (second) birth
#censoring indicator- women that are not at risk for a second birthtable(is.na(ugtotal$bidx_01))
FALSE TRUE
13745 4761
Estimate the survival function for your outcome and plot it
fit %>%ggsurvfit()+labs(title ="Survival Function for Second Birth Interval,Uganda DHS 2016",y ="S(t)", x="Months")
This plot makes risk of a second birth seem similar amongst women that have experienced and that have not experienced emotional IPV to be at a similar risk for having a second birth. Next, I will check other types of IPV to see if I can find anything different.