############# National Sexual Violence Stigma Study ########## ############# Reproducible Code ########## ############# Author: Emily Mellen, PhD. ########## ############# Updated August 2025 ########## ### Set Working Directory setwd("") ### Add your working directory ### Load Packages library("glmmTMB") library("effects") library("ggplot2") library("MASS") library("glmmTMB") library("survey") library("sjstats") library("readxl") library("httr") library("ggcorrplot") ### Load Data finaldata <- read_xlsx("Mellen&HatzenbuehlerNSVSSData.xlsx") ### Cleaning finaldata$Edu_4 <- as.factor(finaldata$Edu_4) finaldata$xppracem <- as.factor(finaldata$xppracem) finaldata$xppracem[finaldata$xppracem == 5] <- 3 ### Combining Native Hawaiian and American Indian Alaska Native into single ### factor level due to small sample size finaldata$xppracem <- droplevels(finaldata$xppracem) finaldata$xhispan <- as.factor(finaldata$xhispan) finaldata$sexual_orientation <- as.factor(finaldata$sexual_orientation) ##### Weighted Models using svyglm ##### # create survey design des <- svydesign( id = ~CASEID, strat = NULL, weights = ~qualify_wt, nest = FALSE, data = finaldata ) # fit negative binomial regressions ### Anxiety fit <- svyglm.nb(GAD_7_total ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan , des) fit ### Depression fit_dep <- svyglm.nb(CESD_total ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, des) fit_dep ### PTSD fit_PTSD <- svyglm.nb(PCL_total ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4 + LEC_total, des) fit_PTSD ### Alcohol Misuse fit_alc <- svyglm.nb(AUDIT_total ~ SVRSS_total, des) fit_alc ### Healthcare stereotype threat fit_HST <- svyglm.nb(HealthcareStereotype ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, des) fit_HST ### Physical Health # Headaches fit_headaches <- svyglm(Headaches ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, design = des, family = "binomial" (link="logit")) summary(fit_headaches) exp(coef(fit_headaches)) confint(fit_headaches) # Chronic Pain fit_chronicpain <- svyglm(ChronicPain ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, design = des, family = "binomial" (link="logit")) summary(fit_chronicpain) exp(coef(fit_chronicpain)) confint(fit_chronicpain) # Difficulty Sleeping fit_sleep <- svyglm(DiffSleeping ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, design = des, family = "binomial" (link="logit")) summary(fit_sleep) exp(coef(fit_sleep)) confint(fit_sleep) # Treatment Use fit_treatment <- svyglm(PastYearTx ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4, design = des, family = "binomial" (link="logit")) summary(fit_treatment) exp(coef(fit_treatment)) confint(fit_treatment) fit_treatment <- svyglm(PastYearTx ~ SVRSS_total + sexual_orientation + Age + Sex + xppracem + xhispan + Edu_4 + GAD_7_total + CESD_total + PCL_total, design = des, family = "binomial" (link="logit")) summary(fit_treatment) exp(coef(fit_treatment)) confint(fit_treatment) # Correlation Matrix vars <- c("SVRSS_total", "GAD_7_total", "CESD_total", "PCL_total", "AUDIT_total", "HealthcareStereotype") cor_mat <- cor( finaldata[, vars], use = "pairwise.complete.obs", method = "pearson" ) round(cor_mat, 2) cor_mat <- cor( finaldata[, vars], use = "pairwise.complete.obs" ) ggcorrplot( cor_mat, type = "lower", lab = TRUE, lab_size = 3, show.legend = TRUE, title ="Supplement E: Correlation Matrix of Continuous Variables " ) + theme( panel.grid = element_blank() )