-
Notifications
You must be signed in to change notification settings - Fork 1
/
AYAZAZI_econ_hardship_IPVperp_analysis_30may2023b.Rmd
1263 lines (952 loc) · 55.2 KB
/
AYAZAZI_econ_hardship_IPVperp_analysis_30may2023b.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Economic Hardship and IPV perpetration"
author: "C. Andrew Basham, Rishav Singh, Kalysha Closson"
date: "March 23, 2023"
output:
word_document: default
toc: default
html_document:
df_print: paged
pdf_document:
df_print: paged
---
# Changelog
March 8 2023: Created program with Rishav's R script to start with (Andrew).
March 9 2023: Added Kalysha's outcome variable definition code (Andrew).
March 9 2023: Kalysha cleaning up some of the code and addaing in the tables
March 9 2023: added separate code for andrew and kalysha data loading paths (andrew)
March 9 2023: updated race variable (kalysha) & fixed IPV perpetration variable
March 9 2023: updated nb variables so that they were numeric not factor now runs
March 11 2023: Included packages and cleaned code for all of the plots and tables of the regression results. Added effect modification code not yet run to be checked for errors (Rishav)
March 13 2023: Fixed an error in the food harder variable (Kalysha)
March 13 2023: Fixed error in plots (Rishav)
March 14 2023: Added PS-MW analysis (Andrew)
March 14 2023: Cleaned up stray ``` in program and began "automated" Table 1 OR compiling code (Andrew)
March 15 2023: removed OR plots from the program as they presented adjusted covariate ORs that
are subject to table 1 fallacy (andrew).
March 16 2023: Added in some potential effect modification models + comments on the analyses getting an error in the weighting code below (Kalysha)
March 23 2023: Changed the outcome variable to be combined and we added income into the model.
May 18: removed some excess programming and added e-value analysis; added n/% IPV by econ hardship which is needed for abstract to show absolute number and percent
# Work needed
<!-- Update inclusion criteria to require complete data on both sIPV and pIPV and re-run. -->
<!-- Why is anychildren adjusted but not the number of children? Both are listed in the DAG so they should both be adjusted for. -->
<!-- Fix the "Create interaction terms" operations in the Effect Modification Analysis section, which does not run currently and is commented out. -->
Fix/expand the "automated" Table 1 OR compiling code to output a CSV with ORs and CIs for bivariable ORs of covariates. Add similar code for Table 2 OR and CI compiling to output a CSV with Table 2 Results for (crude, age-adj, cov-adj).
Add PS-MW analysis of the secondary outcomes (sIPV and pIPV) - note, this could be done in one dataset, rather than having separate datasets for physical, sexual, and any IPV.
KC: Do we want to look at the exposures on their own?
# Project Information
Title:
Economic Hardship and Perpetration of Intimate Partner Violence by Young Men aged 16-24 Residing in the eThekwini District of Durban, South Africa during the COVID-19 Pandemic: A Cross-Sectional Study
SAP Authors:
Campion Zharima, Rishav Singh, C. Andrew Basham, Kalysha Closson
Project: AYAZAZI RIGHTS
Investigators:
Angela Kaida (PI, Simon Fraser University), Kalysha Closson
Funding Information: AYAZAZI RIGHTS is funded by the Centre for International Child Health (CICH) through the generous support of the British Columbia Children’s Hospital Foundation, Canada.
Ethics Approval: Research Ethics British Columbia (REBC) network and the Office of Research Ethics (ORE) at Simon Fraser University in Canada (REB number: H21-02027), and by the University of the Witwatersrand Human Research Ethics Committee (Wits HREC-Medical) in South Africa (REB number: M210863). Participants were provided with an electronic consent letter, detailing the purpose of the survey, benefits and risk for participation, and key contacts for further question prior to accessing to the questionnaire. A list of resources including online and in-person local support services such as for mental health and sexual and reproductive health care was provided at the end of the questionnaire.
# Objective
To estimate the effect of economic hardship during the COVID-19 pandemic on the perpetration of intimate partner violence (IPV) by young men in South Africa.
# Study Population
The study population is young men in South Africa of the eThekwini District of Durban. Data on this population were sourced from AYAZAZI RIGHTS, which was a mobile anonymous online survey distributed among South African youth with the general aim of filling in knowledge gaps around COVID-19 experiences among adolescents. The survey solicited data about sexual orientation and gender identity, experiences of economic hardship due to the pandemic and perpetration of intimate partner violence, as well as sociodemographic and health status data.
# Data Source
“AYAZAZI RIGHTS (Rapid Investigation of Gendered Health outcomes in the Time of Sars-Cov-2) is a cross-sectional survey that aims to address youth experiences of COVID-19 public health responses and impacts on priority sexual and reproductive health and mental health outcomes. This mobile health survey was conducted from the 21st of December 2021 to the 31st of May 2022” (AYAZAZI RIGHTS Manuscript Outline v.2.3, July 2022)."
“A multi-pronged recruitment strategy was used to enrol participants, all those activities being led by a trained, local research assistant. First, this included contacts with former participants from studies led by MatCH Research Unit (MRU) who have agreed to be recontacted for other research projects. Those studies were focusing on condom use: Female Condom Contraceptive Study (Coco), conducted in 2019-2021, and a functional performance and acceptability study of a synthetic nitrile male condom, and a latex graphene male condom compared to a standard latex male condom (Karex), conducted in 2021. Both these studies were conducted in Durban area with participants from ages 18-35, some of whom would still qualify for this project. A second strategy was engagement with community-based and youth-led organisations such as Community Advisory Boards (CAB), especially the Adolescent CAB(ACAB) which includes girls from High schools and Tertiary institutions from in and around the Durban area, as well as Senior CAB members of the MRU. Third, flyer distributions were organised in areas highly frequented by youth such as commercial retail settings, transit areas on their way into work or school, CAB offices and health care facilities. The survey was also advertised online and via e-mails to various local institutions. For example, it was displayed on the MRU website as a pop-up message, and posted on social media platforms of youth-led organisations and of Community Media Trust, a not-for-profit company located in Durban that specializes in communication. Participants had also the opportunity to share the link and the QR code of the survey to their eligible peers and family members. The study team made contact with the universities to share the survey to their students but several events prevented us recruiting from universities during the enrolment period (additional ethical clearance requirements, students on strike, serious flooding in mid-April). To promote further the survey, a prize draw to win cash prizes of R100 (CAD$ 8.50) was organized for participants providing their mobile phone number at the end of the survey. Chances of winning ranged from one in every twenty (Dec 21-mid-Feb 22) to one in every five (mid-Feb to mid-March 22) then one in every ten participants (mid-March-May 22) over the enrolment period. Participants could enter and complete the mobile health survey via a web link at no cost for them, as data needed to fill the survey were covered by the research team thanks to a partnership with the #datafree Moya Messenger App. The web link was made #datafree by the company in exchange of a monthly subscription from our team (R2000 [CAD170] per month)” (AYAZAZI RIGHTS Manuscript Outline v.2.3, July 2022).
# Libraries
```{r}
#install.packages("DataExplorer")
require(DataExplorer)
require(tableone)
require(Publish)
require(tidyr)
require(dplyr)
#install.packages("tidyverse")
require(tidyverse)
require(tableone)
library(ggplot2)
#install.packages("epiR")
#library(epiR)
#install.packages("sjPlot")
library(sjPlot)
#install.packages("mice")
#install.packages("Publish")
library(mice)
library(magrittr)
library(jtools)
library(survey)
library(naniar)
```
#Load Data
Inclusion Criteria applied
• People identifying as men
• Answered the question on IPV perpetration either physical or sexual (outcome)
• Answered the question of food insecurity OR income decrease (exposure)
• Answers of “prefer not to say” were treated as missing values for the food insecurity variable.
```{r}
#getwd()
#setwd("C:/Users/risha/OneDrive/Documents/")
# Rishav
#
#data <- read.csv2("C:\\Users\\risha\\OneDrive\\Documents\\Aya Data\\RIGHTS_2095_Feb2023.csv", header=TRUE)
# Kalysha data loading
#data <- read.csv2("~/Simon Fraser University (1sfu)/Julie Jesson - AYAZAZI RIGHTS/Database/RIGHTS_2095_Feb2023.csv", header=TRUE)
# Andrew data loading
ayadata<- read.csv2("C:/Users/16174/Documents/SFU/Rishav_Campion/RIGHTS_2095_Feb2023.csv", header=TRUE)
dim(ayadata)
table(ayadata$othersubstanceF_spec)
table(ayadata$othersubstanceF)
table(ayadata$othersubstance_change)
# table(ayadata$sex)
# table(ayadata$gender)
# table(ayadata$gender_self)
ayadata <- mutate(ayadata,
gender_3 = case_when(
gender ==1 ~ 1,
gender ==2 ~ 0,
gender ==3 | gender==4 ~ 2
)
)
table(ayadata$gender_3)
##subsetting data to include those with gender identity responses n=2068
ayadata1 <- subset(ayadata, gender_3==0 |gender_3==1 | gender_3==2 )
ayadata1$gendercat[ayadata1$gender_3 == 0] <- "woman"
ayadata1$gendercat[ayadata1$gender_3 == 1] <- "man"
ayadata1$gendercat[ayadata1$gender_3 == 2] <- "nb_nogender"
ayadata1$gendercat<-factor(ayadata1$gendercat, levels=c("man", "woman", "nb_nogender"))
filtered_data <- ayadata1[ayadata1$gendercat == "man",]
filtered_data_backup <- filtered_data
table(filtered_data$age_group)
241+215+425
summary(filtered_data$age)
```
# Data Management
Creates variables for outcomes, exposure, and covariates.
Applies exclusion criterion: Missing values for any of the covariates.
(Andrew Note: might want to clean this up a bit, and consolidate into 1 dataset for whole analysis - i.e., the analytic data).
```{r}
### Outcome variables
# Physical IPV Perpetration = 0 no 1 yes
table(filtered_data_backup$rltship_slapping)
table(filtered_data_backup$rltship_slapping_freq)
filtered_data_backup <- mutate(filtered_data_backup,
perpipv = case_when(
rltship_slapping==1 ~ 1,
rltship_slapping==2 ~ 0
)
)
# Sexual IPV Perpetration (0 no 1 yes )
table(filtered_data_backup$rltship_youforced)
table(filtered_data_backup$rltship_youforced_freq)
filtered_data_backup <- mutate(filtered_data_backup,
persipv = case_when(
rltship_youforced==1 ~ 1,
rltship_youforced==2 ~ 0
)
)
table(filtered_data_backup$persipv)
table(filtered_data_backup$perpipv)
filtered_data_backup <- mutate(filtered_data_backup,
peranyipv = case_when(
perpipv==1 | persipv==1 ~ 1,
perpipv==0 & persipv==0 ~0
)
)
table(filtered_data_backup$peranyipv)
# Exposure Variable
filtered_data_backup <- mutate(filtered_data_backup,
foodharder = case_when(
fi_change ==1 ~ "Yes",
fi_change ==2 | fi_change==3 ~ "No or same"))
table(filtered_data_backup$foodharder)
# Income decrease any 1 increased any 2 stayed the same 3 unsure
table(filtered_data_backup$income_change)
filtered_data_backup <- mutate(filtered_data_backup,
income_change = case_when(
income_change ==1 | income_change==2 ~ 0,
income_change ==3 | income_change==4 ~ 1,
income_change ==5 ~ 2,
income_change ==6 ~ 3
)
)
filtered_data_backup$inc_decrease[filtered_data_backup$income_change==0] <- "yes"
filtered_data_backup$inc_decrease[filtered_data_backup$income_change==1] <- "no"
filtered_data_backup$inc_decrease[filtered_data_backup$income_change==2] <- "no"
filtered_data_backup$inc_decrease[filtered_data_backup$income_change==3] <- NA
table(filtered_data_backup$inc_decrease)
filtered_data_backup <- mutate(filtered_data_backup,
anyhardship = case_when(
foodharder=="Yes" | inc_decrease=="yes" ~ "yes",
foodharder=="No or same" | inc_decrease=="no" ~"no"
)
)
table(filtered_data_backup$anyhardship)
###income
table(filtered_data_backup$income)
##0=no income 1 -3 = 2-4 in datadic 4=3210+
table(filtered_data_backup$income)
##0=no income 1 -3 = 2-4 in datadic 4=3210+
filtered_data_backup <- mutate(filtered_data_backup,
inc_cat = case_when(
income ==1~ "aI do not get an income",
income ==2 ~"bR1-R800",
income == 3 ~"cR801-R1600",
income == 4 ~"dR1601-R3200",
income ==5 | income==6| income==7 ~"eR3201+"
)
)
table(ayadata1$income)
filtered_data_backup <- mutate(filtered_data_backup,
inc_cat2 = case_when(
income ==1~ "aI do not get an income",
income ==2 | income == 3 ~"bR1-1600",
income == 4 |income ==5 | income==6| income==7 ~"eR1601+"
)
)
table(filtered_data_backup$inc_cat)
#Race
filtered_data_backup <- mutate(filtered_data_backup,
race = case_when(
race ==1 | race_other=="Congolese"| race_other=="Ghanaian"| race_other=="Malawian" | race_other=="Mozambican" | race_other=="Namibian"| race_other=="Nigerian"| race_other=="Zimbabwean" ~ 0,
race ==2 ~ 1,
race ==3 ~ 2,
race ==4 ~ 3,
)
)
table(filtered_data_backup$race)
filtered_data_backup$blk[filtered_data_backup$race==0] <- "yes"
filtered_data_backup$blk[filtered_data_backup$race==1] <- "no"
filtered_data_backup$blk[filtered_data_backup$race==2] <- "no"
filtered_data_backup$blk[filtered_data_backup$race==3] <- "no"
# filtered_data_backup$blk[filtered_data_backup$language==2] <- "yes"
# table(filtered_data_backup$blk, filtered_data_backup$language, useNA = "always")
table(filtered_data_backup$blk)
# filtered_data_backup <- mutate(filtered_data_backup,
# peranyipv = case_when(
# perpipv==1 | persipv==1 ~ 1,
# perpipv==0 | persipv==0 ~ 0))
table(filtered_data_backup$HHSscore2)
##0 not changed or easier 1 harder 2 pnta
table(filtered_data_backup$fi_change)
filtered_data_backup <- mutate(filtered_data_backup,
foodharder = case_when(
fi_change ==1 ~ 1,
fi_change ==2 | fi_change==3 ~ 0,
fi_change==4 ~ 2
)
)
###covariates
## sex_orient2
filtered_data_backup <- mutate(filtered_data_backup,
sex_orient3 = case_when(
sex_orient ==1 ~ "hetero",
sex_orient ==2 | sex_orient ==3 ~ "lgb",
sex_orient ==4 | sex_orient ==5 ~ "ques_or_none"
)
)
filtered_data_backup$sex_orient2[filtered_data_backup$sex_orient3=="hetero"] <- "hetero"
filtered_data_backup$sex_orient2[filtered_data_backup$sex_orient3=="lgb"] <- "LGBQQA"
filtered_data_backup$sex_orient2[filtered_data_backup$sex_orient3=="ques_or_none"] <- "LGBQQA"
table(filtered_data_backup$sex_orient2)
##schoolemploy"
##0 no 1 yes
table(filtered_data_backup$school_enrol)
filtered_data_backup <- mutate(filtered_data_backup,
school_enrol = case_when(
school_enrol ==2 ~ 0,
school_enrol ==1 ~ 1
)
)
##0 no 1 yes
table(filtered_data_backup$employment_enrol)
filtered_data_backup <- mutate(filtered_data_backup,
employment_enrol = case_when(
employment_enrol ==2 ~ 0,
employment_enrol ==1 ~ 1
)
)
##0 no 1 yes
filtered_data_backup <- mutate(filtered_data_backup,
schoolemploy = case_when(
employment_enrol ==0 & school_enrol ==0 ~ "no",
employment_enrol ==1 | school_enrol ==1 ~ "yes"
)
)
"inrelationship"
##0 no boyfrined, 1 have boyfriend, living together, 2 boyfriend not living togeether,
table(filtered_data_backup$relationship)
filtered_data_backup <- mutate(filtered_data_backup,
relationship = case_when(
relationship ==3 ~ 0,
relationship ==2 ~ 1,
relationship ==1 ~ 2,
)
)
table(filtered_data_backup$relationship)
filtered_data_backup$inrelationship[filtered_data_backup$relationship==0] <- "no"
filtered_data_backup$inrelationship[filtered_data_backup$relationship==1] <- "yes"
filtered_data_backup$inrelationship[filtered_data_backup$relationship==2] <- "yes"
table(filtered_data_backup$inrelationship)
##"anychild"
##0=0 1=1 2=≥2
table(filtered_data_backup$children)
filtered_data_backup <- mutate(filtered_data_backup,
children = case_when(
children ==1 ~ 0,
children ==2 ~ 1,
children ==3 | children==4 ~ 2,
)
)
table(filtered_data_backup$children)
filtered_data_backup$anychild[filtered_data_backup$children==0] <- "no"
filtered_data_backup$anychild[filtered_data_backup$children==1] <- "yes"
filtered_data_backup$anychild[filtered_data_backup$children==2] <- "yes"
table(filtered_data_backup$anychild)
##alcohol frequency
table(filtered_data_backup$alcoholF)
filtered_data_backup <- mutate(filtered_data_backup,
alcoholfreq = case_when(
alcoholF==1 ~ "never" ,
alcoholF==2 ~ "less than monthly or once a month",
alcoholF==3| alcoholF==4| alcoholF==5 ~ "once or twice per week or more",
)
)
###HIV
table(filtered_data_backup$HIV_status)
filtered_data_backup <- mutate(filtered_data_backup,
HIV = case_when(
HIV_status ==2 ~ "negative",
HIV_status ==1 ~ "positive",
HIV_status==3 | HIV_status==4 ~ "uknown or PNTA"
)
)
##these are the different subsets of data here is the one for any IPV
outdata<-subset(filtered_data_backup, peranyipv==0|peranyipv==1)
##This is one for the any harship exposure variable
comexpdata <-subset(outdata, anyhardship=="no"| anyhardship=="yes" )
#Cleaning data and removing missing values on variables+co-variat
ayavars <- c( "fi_change", "persipv", "perpipv", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope", "fi_nomoney", "fi_closure", "fi_supplies", "fi_transport", "fi_leavehshld", "relationship")
comexpdata[,ayavars] <- lapply(comexpdata[,ayavars], factor)
table(comexpdata$anyhardship, useNA = "always")
combdata<-comexpdata[c("record_id",
"age",
"sex_orient2",
"inc_cat",
"inc_cat2",
"schoolemploy",
"blk",
"inrelationship",
"relationship",
"anychild",
"nb_children",
"nb_adults",
"nb_seniors",
"HIV",
"per1`",
"perpipv",
"persipv",
"alcoholfreq",
"anyhardship",
"cov_anxious",
"cov_worried",
"cov_upset",
"cov_nocope"
)
]
```
# Table 1 - outcome stratified
This table show with missing data the any IPV outcome using the inc and exclu criteria.
```{r}
Descriptivesanyipvna <- CreateTableOne(vars = c("anyhardship", "inc_decrease", "inc_cat", "foodharder", "age", "sex_orient2", "schoolemploy", "blk", "inrelationship" ,"relationship", "anychild", "nb_children", "nb_adults", "nb_seniors", "HIV" , "alcoholfreq", "fi_nomoney", "fi_closure", "fi_supplies", "fi_transport", "fi_leavehshld", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope"),data = comexpdata, strata = "peranyipv", includeNA = T)
Descriptivesanyipvna <- print(Descriptivesanyipvna, showAllLevels= TRUE)
Descriptivesanyipvna <- print(Descriptivesanyipvna, showAllLevels = TRUE, missing = TRUE, printToggle = FALSE, cramVars = TRUE, varLabels = TRUE, explain = FALSE) %>%
as_tibble(rownames = NA)
Descriptivesanyipvna <- as.data.frame(Descriptivesanyipvna)
write.csv(x = Descriptivesanyipvna, file = "Descriptivesanyipvna.csv")
###This is using complete case with no missing included
Descriptivesanyipv <- CreateTableOne(vars = c("anyhardship", "inc_cat", "inc_decrease", "foodharder", "age", "sex_orient2", "schoolemploy", "blk", "inrelationship", "relationship","anychild", "nb_children", "nb_adults", "nb_seniors", "HIV" , "alcoholfreq", "fi_nomoney", "fi_closure", "fi_supplies", "fi_transport", "fi_leavehshld", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope"),data = comexpdata, strata = "peranyipv", includeNA = F)
Descriptivesanyipv <- print(Descriptivesanyipv)
Descriptivesanyipv <- print(Descriptivesanyipv, showAllLevels = TRUE, missing = TRUE, printToggle = FALSE, cramVars = TRUE, varLabels = TRUE, explain = FALSE) %>%
as_tibble(rownames = NA)
Descriptivesanyipv <- as.data.frame(Descriptivesanyipv)
print(Descriptivesanyipv)
write.csv(x = Descriptivesanyipv, file = "Descriptivesanyipv.csv")
### This table is an overall table without the strata for the ANALYTIC SAMPLE.
Descriptivesanyipvoverall <- CreateTableOne(vars = c("anyhardship", "inc_decrease", "inc_cat", "foodharder", "age", "sex_orient2", "schoolemploy", "blk", "inrelationship" ,"relationship", "anychild", "nb_children", "nb_adults", "nb_seniors", "HIV" , "alcoholfreq", "fi_nomoney", "fi_closure", "fi_supplies", "fi_transport", "fi_leavehshld", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope"),data = comexpdata, includeNA = T)
Descriptivesanyipvoverall
OverallTable <- print(Descriptivesanyipvoverall, showAllLevels= TRUE)
OverallDescriptives <- as.data.frame(OverallTable)
write.csv(x= OverallDescriptives, file = "OverallIPV.csv")
```
# Missing Data
```{r}
##this is how you can look at the missingness of the data here we are looking for the any IPV and any hardship variables
plot_missing(combdata)
nabular(combdata)
combdata$missany<-add_any_miss(combdata)
combdata$missprop<-add_prop_miss(combdata)
combdata$misscluster<-add_miss_cluster(combdata)
summary(combdata$anymiss)
summary(combdata$missprop)
summary(combdata$misscluster)
gg_miss_case(combdata)
gg_miss_var(combdata)
```
hard_imputed <- nabular(combdata) %>%
as.data.frame() %>%
simputation::impute_lm(nb_seniors~sex_orient2+inc_cat+age+nb_children+cov_anxious+cov_worried+cov_upset+cov_nocope) %>%
add_label_shadow()
summary(hard_imputed$nb_seniors_NA)
summary(hard_imputed$nb_seniors)
hard_imputed %>%
group_by(any_missing) %>%
summarise_at(.vars = vars(nb_seniors),
.funs = lst(min, mean, median, max))
table(hard_imputed$nb_seniors_NA)
table(hard_imputed$any_missing)
# Table 1 - Complete Case analysis publishable
```{r}
###Now we want to run the same tables above without the missing data included so we just have to chence include NA from T to F and run the same tables but using the complete case data now
####Here we want to run the complete case for each of the outcomes
anyipvcase <- as.data.frame(na.omit(combdata))
dim(comexpdata)
dim(combdata)
dim(anyipvcase)
table(anyipvcase$peranyipv)
table(anyipvcase$persipv)
table(anyipvcase$age)
anyipvcase$age_corrected<-anyipvcase$age+15
table(anyipvcase$age_corrected)
summary(anyipvcase$age_corrected)
table(anyipvcase$perpipv)
table(anyipvcase$persipv)
###Here now is the table with the any IPV ooutcome and complete case data
Descriptivesanyipvcc <- CreateTableOne(vars = c("anyhardship", "inc_cat", "age_corrected", "sex_orient2", "schoolemploy", "blk", "inrelationship", "relationship","anychild", "nb_children", "nb_adults", "nb_seniors", "HIV" , "alcoholfreq", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope"),data = anyipvcase, strata = "peranyipv", includeNA = F)
print(Descriptivesanyipv, test=F, smd=F)
###Here now is the table with the any IPV ooutcome and complete case data
CreateTableOne(vars = c("perpipv","persipv","anyhardship", "inc_cat", "age_corrected", "sex_orient2", "schoolemploy", "blk", "inrelationship", "relationship","anychild", "nb_children", "nb_adults", "nb_seniors", "HIV" , "alcoholfreq", "cov_anxious", "cov_worried", "cov_upset", "cov_nocope"),data = anyipvcase, includeNA = F)
print(Descriptivesanyipv, test=F, smd=F)
Descriptivesanyipvcc
Complete_case <- print(Descriptivesanyipvcc, showAllLevels= TRUE)
Descriptivesanyipvcc <- as.data.frame(Complete_case)
write.csv(x = Complete_case, file = "C:/Users/16174/Documents/SFU/Rishav_Campion/Descriptivesanyipvcc_06dec2023.csv")
#write.csv(x = Descriptivesanyipvcc, file = "Descriptivesanyipvcc_May17th2023.csv")
```
# Statistical Analysis
Exposure to economic hardship will be measured through a combined exposure to either income decrease or food insecurity, with any IPV modeled on this combined exposure in our primary analysis. Three separate models will be utilized for each exposure-outcome relationship. The first model will be a simple binary logistic regression of each exposure and IPV perpetration, second will be age-adjusted, third will be covariate-adjusted. As secondary analyses, the effect of economic hardship on the secondary outcomes of physical IPV perpetration and sexual IPV perpetration will be studied separately.
## Bivariable Analyses
Bivariable logistic regressions of the outcome of any IPV on each covariate will estimate the association, and the precision of these estimates, between each covariate and the outcome using the crude odds ratios (ORs) and 95% CIs, respectively.
### Any IPV
```{r}
# sexual orientation
SexualOrientationAnyIPV <- glm(I(peranyipv==1) ~ sex_orient2,
data = anyipvcase,
family = binomial())
publish(SexualOrientationAnyIPV)
# school or employed
SchoolEmployAnyIPV <- glm(I(peranyipv==1) ~ schoolemploy,
data = anyipvcase,
family = binomial())
publish(SchoolEmployAnyIPV)
# race
RaceAnyIPV <- glm(I(peranyipv==1) ~ blk,
data = anyipvcase,
family = binomial())
publish(RaceAnyIPV)
# income
IncAnyIPV <- glm(I(peranyipv==1) ~ inc_cat,
data = anyipvcase,
family = binomial())
publish(IncAnyIPV)
# Model using "inrelationship"
InRelAnyIPV <- glm(I(peranyipv==1) ~ inrelationship, data = anyipvcase, family = binomial())
publish(InRelAnyIPV)
# Model using "relationship"
InRel3AnyIPV <- glm(I(peranyipv==1) ~ relationship, data = anyipvcase, family = binomial())
publish(InRel3AnyIPV)
# Model using "anychild"
AnyChildAnyIPV <- glm(I(peranyipv==1) ~ anychild, data = anyipvcase, family = binomial())
publish(AnyChildAnyIPV)
# Model using "nb_children"
NbChildAnyIPV <- glm(I(peranyipv==1) ~ nb_children, data = anyipvcase, family = binomial())
publish(NbChildAnyIPV)
# Model using "nb_adults"
NbAdultsAnyIPV <- glm(I(peranyipv==1) ~ nb_adults, data = anyipvcase, family = binomial())
publish(NbAdultsAnyIPV)
# Model using "nb_seniors"
NbSeniorsAnyIPV <- glm(I(peranyipv==1) ~ nb_seniors, data = anyipvcase, family = binomial())
publish(NbSeniorsAnyIPV)
# Model using "HIV"
HIVAnyIPV <- glm(I(peranyipv==1) ~ HIV, data = anyipvcase, family = binomial())
publish(HIVAnyIPV)
# Model using "alcoholfreq"
AlcoholFreqAnyIPV <- glm(I(peranyipv==1) ~ alcoholfreq, data = anyipvcase, family = binomial())
publish(AlcoholFreqAnyIPV)
# Model using "cov_anxious"
CovAnxiousAnyIPV <- glm(I(peranyipv==1) ~ cov_anxious, data = anyipvcase, family = binomial())
publish(CovAnxiousAnyIPV)
# Model using "cov_worried"
CovWorriedAnyIPV <- glm(I(peranyipv==1) ~ cov_worried, data = anyipvcase, family = binomial())
publish(CovWorriedAnyIPV)
# Model using "cov_upset"
CovUpsetAnyIPV <- glm(I(peranyipv==1) ~ cov_upset, data = anyipvcase, family = binomial())
publish(CovUpsetAnyIPV)
# Model using "cov_nocope"
CovNoCopeAnyIPV <- glm(I(peranyipv==1) ~ cov_nocope, data = anyipvcase, family = binomial())
publish(CovNoCopeAnyIPV)
```
### Physical IPV
```{r}
##Model using "inc_cat"
IncPIPVPerc <- glm(I(perpipv==1) ~ inc_cat,
data = anyipvcase,
family = binomial())
publish(IncPIPVPerc)
summ(IncPIPVPerc)
# Model using "inrelationship"
InRelPIPVPerc <- glm(I(perpipv==1) ~ inrelationship, data = anyipvcase, family = binomial())
publish(InRelPIPVPerc)
# Model using "relationship"
InRel3PIPVPerc <- glm(I(perpipv==1) ~ relationship, data = anyipvcase, family = binomial())
publish(InRel3PIPVPerc)
# Model using "anychild"
AnyChildPIPVPerc <- glm(I(perpipv==1) ~ anychild, data = anyipvcase, family = binomial())
publish(AnyChildPIPVPerc)
# Model using "nb_children"
NbChildPIPVPerc <- glm(I(perpipv==1) ~ nb_children, data = anyipvcase, family = binomial())
publish(NbChildPIPVPerc)
# Model using "nb_adults"
NbAdultsPIPVPerc <- glm(I(perpipv==1) ~ nb_adults, data = anyipvcase, family = binomial())
publish(NbAdultsPIPVPerc)
# Model using "nb_seniors"
NbSeniorsPIPVPerc <- glm(I(perpipv==1) ~ nb_seniors, data = anyipvcase, family = binomial())
publish(NbSeniorsPIPVPerc)
# Model using "HIV"
HIVPIPVPerc <- glm(I(perpipv==1) ~ HIV, data = anyipvcase, family = binomial())
publish(HIVPIPVPerc)
# Model using "alcoholfreq"
AlcoholFreqPIPVPerc <- glm(I(perpipv==1) ~ alcoholfreq, data = anyipvcase, family = binomial())
publish(AlcoholFreqPIPVPerc)
# Model using "anyhardship"
AnyHardshipPIPVPerc <- glm(I(perpipv==1) ~ anyhardship, data = anyipvcase, family = binomial())
publish(AnyHardshipPIPVPerc)
# Model using "cov_anxious"
CovAnxiousPIPVPerc <- glm(I(perpipv==1) ~ cov_anxious, data = anyipvcase, family = binomial())
publish(CovAnxiousPIPVPerc)
# Model using "cov_worried"
CovWorriedPIPVPerc <- glm(I(perpipv==1) ~ cov_worried, data = anyipvcase, family = binomial())
publish(CovWorriedPIPVPerc)
# Model using "cov_upset"
CovUpsetPIPVPerc <- glm(I(perpipv==1) ~ cov_upset, data = anyipvcase, family = binomial())
publish(CovUpsetPIPVPerc)
# Model using "cov_nocope"
CovNoCopePIPVPerc <- glm(I(perpipv==1) ~ cov_nocope, data = anyipvcase, family = binomial())
publish(CovNoCopePIPVPerc)
```
### Sexual IPV
```{r}
##Model using "inc_cat"
IncSIPVPerc <- glm(I(persipv==1) ~ inc_cat,
data = anyipvcase,
family = binomial())
publish(IncSIPVPerc)
# Model using "inrelationship"
InRelSIPVPerc <- glm(I(persipv==1) ~ inrelationship, data = anyipvcase, family = binomial())
publish(InRelSIPVPerc)
# Model using "relationship"
InRel3SIPVPerc <- glm(I(persipv==1) ~ relationship, data = anyipvcase, family = binomial())
publish(InRel3SIPVPerc)
# Model using "anychild"
AnyChildSIPVPerc <- glm(I(persipv==1) ~ anychild, data = anyipvcase, family = binomial())
publish(AnyChildSIPVPerc)
# Model using "nb_children"
NbChildSIPVPerc <- glm(I(persipv==1) ~ nb_children, data = anyipvcase, family = binomial())
publish(NbChildSIPVPerc)
# Model using "nb_adults"
NbAdultsSIPVPerc <- glm(I(persipv==1) ~ nb_adults, data = anyipvcase, family = binomial())
publish(NbAdultsSIPVPerc)
# Model using "nb_seniors"
NbSeniorsSIPVPerc <- glm(I(persipv==1) ~ nb_seniors, data = anyipvcase, family = binomial())
publish(NbSeniorsSIPVPerc)
# Model using "HIV"
HIVSIPVPerc <- glm(I(persipv==1) ~ HIV, data = anyipvcase, family = binomial())
publish(HIVSIPVPerc)
# Model using "alcoholfreq"
AlcoholFreqSIPVPerc <- glm(I(persipv==1) ~ alcoholfreq, data = anyipvcase, family = binomial())
publish(AlcoholFreqSIPVPerc)
# Model using "cov_anxious"
CovAnxiousSIPVPerc <- glm(I(persipv==1) ~ cov_anxious, data = anyipvcase, family = binomial())
publish(CovAnxiousSIPVPerc)
# Model using "cov_worried"
CovWorriedSIPVPerc <- glm(I(persipv==1) ~ cov_worried, data = anyipvcase, family = binomial())
publish(CovWorriedSIPVPerc)
# Model using "cov_upset"
CovUpsetSIPVPerc <- glm(I(persipv==1) ~ cov_upset, data = anyipvcase, family = binomial())
publish(CovUpsetSIPVPerc)
# Model using "cov_nocope"
CovNoCopeSIPVPerc <- glm(I(persipv==1) ~ cov_nocope, data = anyipvcase, family = binomial())
publish(CovNoCopeSIPVPerc)
```
## Crude Models
### n/% IPV perp by econ hardship manually
```{r}
# check the n and % IPV perp by econ hardship for the whole sample manually
table(anyipvcase$peranyipv)
table(anyipvcase$anyhardship)
table(anyipvcase$peranyipv,anyipvcase$anyhardship)
# IPV/hardship
50/236 # = 21.2%
# IPV/no hardship
24/282 # = 8.5%
```
### Any IPV
```{r}
# crude analysis model
CrudeAnyIPV <- glm(I(peranyipv==1) ~ anyhardship,
data = anyipvcase,
family = binomial(logit))
nobs(CrudeAnyIPV)
publish(CrudeAnyIPV)
summ(CrudeAnyIPV, exp=T)
```
### Physical
```{r}
CrudePIPV <- glm(I(perpipv==1) ~ anyhardship,
data = anyipvcase,
family = binomial())
publish(CrudePIPV)
```
### Sexual
```{r}
CrudeSIPV <- glm(I(persipv==1) ~ anyhardship,
data = anyipvcase,
family = binomial())
publish(CrudeSIPV)
```
## Age adjusted
The second model will be an age-adjusted model, and the final model will be adjusted for the common set of covariates.
### Any IPV
```{r}
AgeAdjustedAnyIPV <- glm(I(peranyipv==1) ~ anyhardship + age,
data = anyipvcase,
family = binomial())
publish(AgeAdjustedAnyIPV)
summ(AgeAdjustedAnyIPV, exp=T)
```
### physical IPV
```{r}
AgeAdjustedPhysicalIPV <- glm(I(perpipv==1) ~ anyhardship + age,
data = anyipvcase,
family = binomial())
publish(AgeAdjustedPhysicalIPV)
summ(AgeAdjustedPhysicalIPV, exp=T)
table(anyipvcase$peranyipv)
```
### Sexual IPV
```{r}
AgeAdjustedSexualIPV <- glm(I(persipv==1) ~ anyhardship + age,
data = anyipvcase,
family = binomial())
publish(AgeAdjustedSexualIPV)
summ(AgeAdjustedSexualIPV,exp=T)
```
## Covariate Adjusted Analyses
A covariate set will be adjusted for in all analyses, as outlined in the directed acyclic graphs (DAG) (appendix).
Table 2 of the manuscript will present the results of each of these statistical analyses.
Statistical significance for the effect of economic hardship on IPV perpetration will be set at alpha=0.05. However, clinical, and public health significance, evaluated by the magnitude of the point estimates (ORs), and their precision (represented by confidence interval estimates), will guide our interpretation of the statistical analysis results, rather than null hypothesis significance testing (Greenland et al. 2016). Only the effect of the exposure of interest will be reported from our adjusted analyses (Westreich and Greenland 2013).
### Any IPV
```{r}
##all adjusted
PeranyipvAllAjusted <- glm(I(peranyipv==1) ~ anyhardship + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
summ(PeranyipvAllAjusted, exp=T)
#publish(PeranyipvAllAjusted)
```
### Physical IPV
```{r}
PerpipvAllAjusted <- glm(I(perpipv==1) ~ anyhardship + age + inc_cat + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
summ(PerpipvAllAjusted, exp=T)
#publish(PerpipvAllAjusted)
```
### Sexual IPV
```{r}
PersipvAllAjusted <- glm(I(persipv==1) ~ anyhardship + age + inc_cat + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
#publish(PersipvAllAjusted)
summ(PersipvAllAjusted, exp=T)
```
# Effect modification analyses
We will test whether the effect of economic hardship on IPV perpetration differs by alcohol #usage, race, size of household. These will be adjusted for all baseline covariates with interaction terms by the economic hardship exposure variable for each effect modifier fit in separate logistic regressions that include interaction terms for the exposure by the hypothesized effect modifier in question.
KC: Here it doesn't seem like any of the effect modifications are showing up significant let's discuss these results at our meeting next week
NEED TO FIX
```{r}
####anyipv
hardalcperp <- glm(I(peranyipv==1) ~ anyhardship*alcoholfreq + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardalcperp)
##physical ipv
hardalcpperp <- glm(I(perpipv==1) ~ anyhardship*alcoholfreq + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardalcpperp)
##sexual IPV
hardalcsperp <- glm(I(persipv==1) ~ anyhardship*alcoholfreq + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardalcsperp)
###again we see that the effect is stronger in the sexual IPV perpetration and among those that drink where the never group the effect is stronger in the any group
##won't report this
hardraceperp <- glm(I(peranyipv==1) ~ anyhardship*blk + age + inc_cat + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardraceperp)
##won't report this
hardchildperp <- glm(I(peranyipv==1) ~ anyhardship*anychild + inc_cat+ blk + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardchildperp)
##in relationship any ipv
hardrelperp <- glm(I(peranyipv==1) ~ anyhardship*relationship + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardrelperp)
summ(hardrelperp, exp=T)
# combined relation yes/no
hardrelperp1 <- glm(I(peranyipv==1) ~ anyhardship*inrelationship + inc_cat + age + sex_orient2 + schoolemploy + blk + inrelationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardrelperp1)
##in relationship physical ipv
hardrelpperp <- glm(I(perpipv==1) ~ anyhardship*relationship + blk + inc_cat + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardrelpperp)
###in relationship sexual IPV
table(anyipvcase$inc_cat)
table(anyipvcase$inc_cat2)
hardrelsperp <- glm(I(persipv==1) ~ anyhardship*relationship + blk + age + sex_orient2 + schoolemploy + inc_cat + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardrelsperp)
tab_model(hardrelperp,hardrelsperp, hardrelpperp)
###income any IPV
hardincperp <- glm(I(peranyipv==1) ~ anyhardship*inc_cat2 + relationship + inc_cat2 + blk + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardincperp)
##income physical IPV
hardincpperp <- glm(I(perpipv==1) ~ anyhardship*inc_cat2 + relationship + blk + inc_cat2 + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardincpperp)
##income sexual IPV
hardincsperp <- glm(I(persipv==1) ~ anyhardship*inc_cat2 + relationship + blk + inc_cat2 + age + sex_orient2 + schoolemploy + blk + relationship + anychild + nb_adults + nb_seniors+ nb_children + HIV + alcoholfreq + cov_anxious + cov_worried + cov_upset + cov_nocope,
data = anyipvcase,
family = binomial())
publish(hardincsperp)
tab_model(hardincperp, hardincpperp, hardincsperp)
### Combining the models into a single table
#Creating Table
EMAlcoholTable <- tab_model(hardalcperp, hardalcpperp,hardalcsperp, p.style = "stars", digits.p=3)
EMAlcoholTable
EMALCTABLE <- print(EMAlcoholTable)
summ(hardalcperp, exp = T)
#write.xlsx(EMALCTABLE, "C:/Users/risha/OneDrive/Documents/Aya Data/ Econ_hardship_EMtable.xlsx")
# Create interaction terms
#anyipvcase$alcohol_hardship <- anyipvcase$anyhardship * anyipvcase$alcoholfreq
#anyipvcase$race_hardship <- anyipvcase$anyhardship * anyipvcase$blk
#anyipvcase$size_hardship <- anyipvcase$anyhardship * anyipvcase$nb_adults
# Fit logistic regression models
#model1 <- glm(peranyipv ~ anyhardship + alcoholfreq + alcohol_hardship + age + sex_orient2 + schoolemploy + blk + inrelationship + anychild + nb_children + nb_seniors + HIV + cov_anxious + cov_worried + cov_upset + cov_nocope, data = anyipvcase, family = binomial)
#model2 <- glm(peranyipv ~ anyhardship + blk + race_hardship + age + sex_orient2 + schoolemploy + alcoholfreq + inrelationship + anychild + nb_children + nb_seniors + HIV + cov_anxious + cov_worried + cov_upset + cov_nocope, data = anyipvcase, family = binomial)