Analysis prepared by Wesley J.B. Vaught | data analysis of women in Wesley’s independent project.

1 Preparation

All participants in this sample were chosen from a larger self-report study on how gendered concepts impact mental health indicators and outcomes. This sample is all women with varying degrees of age, race, and sexualities.

1.1 Packages

library(dplyr) # for creating tibbles and matrices for correlation matrices
library(corrr) # for calculating Pearson/Spearman correlations
library(corrplot) # for visualizing correlational matrices
library(ggplot2) # for data visualization (e.g., scatterplots)
library(qqplotr) # for QQ plots
library(car) # for calculating VIF (variance inflation factor)
library(boot.pval) # for bootstrapping mulitple linear regressions and moderations
library(psych) # for descriptive statistics
library(gmodels) # for frequency statistics
library(stringr) # for replacing phrases/scoring measures

1.2 Setting working directory & reading in dataframes

setwd("~/00. Arkansas/Studies/genderProtectiveFactors/01. R for analysis")
df<-read.csv("df_genderProtectiveFactorsCondensedWomanOnly.csv",header=TRUE)
df$sexualityRecod<-str_replace_all(df$sexuality, c("heterosexual"="straight","bisexual"="LGBTQ","homosexual"="LGBTQ","pansexual"="LGBTQ","asexual"="LGBTQ"))
dfNonWhite<-df %>%
  filter(race != "White")
dfWhite<-df %>%
  filter(race == "White")
dfHetero<-df %>%
  filter(sexualityRecod =="straight")
dfGay<-df %>%
  filter(sexualityRecod == "LGBTQ")