I. Setup

II. Datasets

# Full Sample (N = 292)
remir_all <- read_csv("/Users/sarahcoffin/Desktop/Blueprints/FredCode/REMIR1_REMIR2_all.csv")
## New names:
## Rows: 293 Columns: 263
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (143): Timestamp.Subgroups, Reviewer.Subgroups, Program.Name, Full.Citat... dbl
## (90): Program.ID, Study.Number, Study.ID, Citation.ID, Round, Citation.... lgl
## (30): Which.group.contrasts.for.LOCATION.were.examined..Check.all.that....
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `Provide.the.key.example.supporting.your.decision..including.page.number...1`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...20`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...2`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...25`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...3`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...29`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...4`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...33`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...5`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...38`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...6`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...43`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...7`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...48`
## • `Which.of.the.groups.were.the.models.estimated.for..Check.all.that.apply...1`
##   -> `Which.of.the.groups.were.the.models.estimated.for..Check.all.that.apply`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...8`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...52`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...9`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...56`
## • `Which.of.the.groups.showed.significant.beneficial.effects..Any.significant.effect.is.sufficient.to.demonstrate.a.subgroup.effect..That.is..if.any.single.subgroup.effect.is.significant..that.group.gets.coded.affirmatively..Check.all.that.apply...1`
##   ->
##   `Which.of.the.groups.showed.significant.beneficial.effects..Any.significant.effect.is.sufficient.to.demonstrate.a.subgroup.effect..That.is..if.any.single.subgroup.effect.is.significant..that.group.gets.coded.affirmatively..Check.all.that.apply`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...10`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...60`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...11`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...64`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...12`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...68`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...13`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...72`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...14`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...78`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...15`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...81`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...16`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...86`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...17`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...89`
## • `Were.any.group.contrasts.for.GENDER.GENDER.IDENTITY.examined...1` ->
##   `Were.any.group.contrasts.for.GENDER.GENDER.IDENTITY.examined`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...18`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...94`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...19`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...97`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...20`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...102`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...21`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...105`
## • `Were.any.group.contrasts.for.SES.examined..Proxies.for.low.income.status.and.or.families.living.in.poverty..i.e...economic.disadvantage..include..FRL..Medicaid..Pell.Eligible..CHIP..etc..Do.not.rely.on.income.distribution...1`
##   ->
##   `Were.any.group.contrasts.for.SES.examined..Proxies.for.low.income.status.and.or.families.living.in.poverty..i.e...economic.disadvantage..include..FRL..Medicaid..Pell.Eligible..CHIP..etc..Do.not.rely.on.income.distribution`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...22`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...110`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...23`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...113`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...24`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...118`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...25`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...121`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...26`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...126`
## • `Provide.the.key.example.supporting.your.decision..including.page.number...27`
##   ->
##   `Provide.the.key.example.supporting.your.decision..including.page.number...129`
#Check length of dataset  
dim(remir_all)
## [1] 293 263
length(unique(remir_all$Citation.ID))
## [1] 292
# Clean Data
## One citation, number 4258 is listed twice, once for each of two programs
remir_all %>% filter(Citation.ID == 4258) %>% select(Study.Number, Program.Name)
## To avoid counting the same citation twice, drop one for Project Personality
remir_all$drop <- ifelse(remir_all$Citation.ID == 4258 & remir_all$Study.Number == 2, 1,0)
tabyl(remir_all$drop)
remir_all <- remir_all %>% filter(drop == 0)
dim(remir_all)
## [1] 292 264
## Look at main effect
tabyl(remir_all$main_effect)
## Look at method
tabyl(remir_all$method)
################## SELECT US SAMPLE ###################

tabyl(remir_all$country)
remir_us <- remir_all %>% filter(country == "USA")
dim(remir_us)
## [1] 240 264
## Rename Main effect
remir_us$main_effect <- remir_us$REGSSLN
tabyl(remir_us$main_effect)
# Create subgroup dataset (N = 100)
remir_us_subgroup <- remir_all %>% filter(country == "USA" & ! is.na(method))
dim(remir_us_subgroup)
## [1] 100 264

III. Dummy Codes

################ CREATE CULTURALLY TAILORED VARIABLES ################

## Dummy Variable for Any Culturally Tailored Program
remir_all$target_any <- ifelse(remir_all$target == 
    'No group explicitly targeted', 1, 
    ifelse(remir_all$target == 'Families/individuals in foster care or the child welfare system', 1, 0))
tabyl(remir_all, target, target_any)
## Create Dummy Variable for Targeted Race Group
remir_all$target_race <- ifelse( 
  remir_all$target == 'Black or African American' |
  remir_all$target == 'Black or African American, Hispanic or Latino' |
  remir_all$target == 'Black or African American, Youth in rural communities',
  1,0)
tabyl(remir_all, target, target_race)
## Create Dummy Variable for Targeted Ethnicity Group
remir_all$target_ethnic <- ifelse(
  remir_all$target == 'Hispanic or Latino' |
  remir_all$target == 'Black or African American, Hispanic or Latino',
  1,0)
tabyl(remir_all, target, target_ethnic)
## Create Dummy Variable for Targeted Gender Group
remir_all$target_gender <- ifelse(
  remir_all$target == 'Gender' |
  remir_all$target == 'Gender, Families/individuals in foster care or the child welfare system' |
  remir_all$target == 'Gender, Low-income youth/families',
  1,0)
tabyl(remir_all, target, target_gender)
## No Culturally Tailored Program for Sex

## Create Dummy Variable for Targeted SES Group
remir_all$target_ses <- ifelse(
  remir_all$target == 'Gender, Low-income youth/families' |
  remir_all$target == 'Low-income youth/families' ,
  1,0)
tabyl(remir_all, target, target_ses)
## Create Dummy Variable for Targeted Location Group
remir_all$target_loc <- ifelse(
  remir_all$target == 'Black or African American, Youth in rural communities' |
  remir_all$target == 'Youth in rural communities' |
  remir_all$target == 'Youth in urban communities',
  1,0)
tabyl(remir_all, target, target_loc)
## No culturally tailored programs for nativity

IV. Table 1: Prevalence of Culturally Tailored EBPIs

## About Table 1 
# Table 1. Ns and Proportions for Culturally Tailored EBPIs by Subgroup 

# Subgroups: Culturally Tailored EBPI; Target Population of Culturally Tailored EBPI; Race (Asian or Asian American, Black or African American, Native American, American Indian, Alaska Native, Native Hawaiian or Pacific Islander, White), Ethnicity – Hispanic or Latino; Gender (dichotomy of male or female); Economic disadvantage; Location – Urban; Location – Rural   

# Notes: EBPIs – Evidence-Based Preventive Interventions 

# a EBPIs may target multiple groups so that the proportions for the targeted groups sum to more than the total of culturally tailored EBPIs in the first row. 

# b Reports conducted in both within and outside of the United States. 

# c Reports conducted in the United States. 

# d Reports conducted in the United States that tested for one or more of the following subgroups: race, ethnicity, gender, sexual identify, economic disadvantage, location (rural, urban, suburban), nativity status (foreign-born – yes/no). 

Column 1. Full Sample (N = 292; Table 1)

# Culturally Tailored EBPI
tabyl(remir_all, target_any)
# Target Population of Culturally Tailored EBPI: Race
## Note: Culturally-tailored programs were designed for Black or African American subgroups only, so the output of this variable represents column I, row III for Table 1. 
tabyl(remir_all, target_race)
# Ethnicity – Hispanic or Latino
tabyl(remir_all, target_ethnic)
# Gender (dichotomy of male or female)
tabyl(remir_all, target_gender)
# Economic disadvantage 
tabyl(remir_all, target_ses)
#Location – Urban and Rural
tabyl(remir_all, target_loc)
#Frequency by category
tabyl(remir_all, target, target_loc)
tabyl(remir_all, target, target_loc) %>% 
  adorn_percentages("all") %>% 
  adorn_pct_formatting(rounding = "half up", digits = 1)

Column 2. Analysis Sample (N = 240; Table 1)

# Culturally Tailored EBPI
remir_all %>% filter(country == "USA") %>% tabyl(target_any)
# Target Population of Culturally Tailored EBPI: Race
## Note: Culturally-tailored programs were designed for Black or African American subgroups only, so the output of this variable represents column II, row III for Table 1. 
remir_all %>% filter(country == "USA") %>% tabyl(target_race)
# Ethnicity – Hispanic or Latino
remir_all %>% filter(country == "USA") %>% tabyl(target_ethnic)
# Gender (dichotomy of male or female)
remir_all %>% filter(country == "USA") %>% tabyl(target_gender)
# Economic disadvantage 
remir_all %>% filter(country == "USA") %>% tabyl(target_ses)
#Location – Urban and Rural
remir_all %>% filter(country == "USA") %>% tabyl(target_loc)
#Frequency by category
remir_all %>% filter(country == "USA") %>% tabyl(target, target_loc)

Column 3. Sub-analysis Sample (N = 240; Table 1)

# Culturally Tailored EBPI
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_any)
# Target Population of Culturally Tailored EBPI: Race
## Note: Culturally-tailored programs were designed for Black or African American subgroups only, so the output of this variable represents column II, row III for Table 1. 
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_race)
# Ethnicity – Hispanic or Latino
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_ethnic)
# Gender (dichotomy of male or female)
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_gender)
# Economic disadvantage 
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_ses)
#Location – Urban and Rural
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target_loc)
#Frequency by category
remir_all %>% filter(country == "USA" & !is.na(method)) %>% tabyl(target, target_loc)

V. Table 2: Proportions Testing for Subgroup Effects in U.S. Sample (n = 240 reports) by Nine Subgroups

############## What Race Interaction Were Examined #################

## ## Change Interaction Examined Variable Names 
names(remir_us)[13] <- "inter_examine1_race"
names(remir_us)[76] <- "inter_examine2_race"
table(remir_us$inter_examine1_race, useNA = "always")
## 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Black/Not Black 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/Majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            W/B (White/African American or Black) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                          W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
## W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan);White/Multiracial; Black/Multiracial; Asian or Pacific Islander/Multiracial; Native American/Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 W/B (White/African American or Black);White/Other or Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   White/Minority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Non-White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Not White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <NA> 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              221
table(remir_us$inter_examine2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          5 
##                                                          Minority/Majority 
##                                                                          5 
##                                                                       None 
##                                                                          1 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          6 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          3 
##                                                                White/Other 
##                                                                          1 
##                                                                       <NA> 
##                                                                        217
## Combine Two Tnteractions Examined
remir_us$inter_examine12_race <- ifelse(is.na(remir_us$inter_examine1_race),
  remir_us$inter_examine2_race, remir_us$inter_examine1_race)
tabyl(remir_us$inter_examine12_race)
############## What Race Interactions Were Significant ################

## Change Interaction Significant Variable Names 
names(remir_us)[14] <- "inter_signif1_race"
names(remir_us)[77] <- "inter_signif2_race"
table(remir_us$inter_signif1_race, useNA = "always")
## 
##                                                             None 
##                                                               14 
##                            W/B (White/African American or Black) 
##                                                                1 
## W/B (White/African American or Black);White/Other or Multiracial 
##                                                                1 
##                                                   White/Minority 
##                                                                3 
##                                                             <NA> 
##                                                              221
table(remir_us$inter_signif2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          3 
##                                                          Minority/Majority 
##                                                                          2 
##                                                                       None 
##                                                                         14 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          1 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          1 
##                                                                       <NA> 
##                                                                        217
## Combine Two Tnteractions Significant
remir_us$inter_signif12_race <- ifelse(is.na(remir_us$inter_signif1_race),
  remir_us$inter_signif2_race, remir_us$inter_signif1_race)
tabyl(remir_us$inter_signif12_race)
############## What Race Interaction Groups Benefitted More ##############

## Change Interaction Benefitted Variable Names
names(remir_us)[16] <- "inter_benefit1_race"
names(remir_us)[79] <- "inter_benefit2_race"
table(remir_us$inter_benefit1_race, useNA = "always")
## 
## Black or African American;Other or Multiracial 
##                                              1 
##                                       Minority 
##                                              3 
##                                           None 
##                                             14 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            221
table(remir_us$inter_benefit2_race, useNA = "always")
## 
## Asian or Asian American;Minority        Black or African American 
##                                1                                2 
##  Black or African American;White                         Majority 
##                                1                                2 
##                             None                        Not Black 
##                               14                                2 
##             White + Another Race                             <NA> 
##                                1                              217
## Combine Two Tnteractions Benefitted
remir_us$inter_benefit12_race <- ifelse(is.na(remir_us$inter_benefit1_race),
  remir_us$inter_benefit2_race, remir_us$inter_benefit1_race)
tabyl(remir_us$inter_benefit12_race)
############# What Race Subgroup Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_us)[47] <- "subg_examine1_race"
names(remir_us)[80] <- "subg_examine2_race"
table(remir_us$subg_examine1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 3 
##                   Black or African American;White 
##                                                 3 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               231
table(remir_us$subg_examine2_race, useNA = "always")
## 
## Asian or Asian American;Black or African American;White 
##                                                       1 
##                  Asian or Asian American;White;Minority 
##                                                       1 
##                               Black or African American 
##                                                       3 
##                     Black or African American;Not Black 
##                                                       1 
##                         Black or African American;White 
##                                                       4 
##          Black or African American;White + Another Race 
##                                                       3 
##             Black or African American;White;Multiracial 
##                                                       1 
##                                                Minority 
##                                                       1 
##                                      Minority; Majority 
##                                                       2 
##                                                    None 
##                                                       5 
##                                                   White 
##                                                       1 
##                                                    <NA> 
##                                                     217
## Combine Two Subgroups Examined
remir_us$subg_examine12_race <- ifelse(is.na(remir_us$subg_examine1_race),
  remir_us$subg_examine2_race, remir_us$subg_examine1_race)
tabyl(remir_us$subg_examine12_race)
############## What Race Subgroups Were Significant ######################

## Change Subgroup Significant Variable Names 
names(remir_us)[49] <- "subg_signif1_race"
names(remir_us)[82] <- "subg_signif2_race"
table(remir_us$subg_signif1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 5 
##                                              None 
##                                                 1 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               231
table(remir_us$subg_signif2_race, useNA = "always")
## 
##               Asian or Asian American;Minority 
##                                              1 
##                      Black or African American 
##                                              5 
##            Black or African American;Not Black 
##                                              1 
##                Black or African American;White 
##                                              3 
## Black or African American;White + Another Race 
##                                              3 
##    Black or African American;White;Multiracial 
##                                              1 
##                                       Minority 
##                                              1 
##                             Minority; Majority 
##                                              2 
##                                           None 
##                                              5 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            217
## Combine Two Subgroup Significant
remir_us$subg_signif12_race <- ifelse(is.na(remir_us$subg_signif1_race),
  remir_us$subg_signif2_race, remir_us$subg_signif1_race)
tabyl(remir_us$subg_signif12_race)

Column 1: Measured race according to one or more of the U.S. Census categories of Asian or Asian American, Black or African American, Native American or American Indian or Alaska Native, Native Hawaiian or Pacific Islander, or Multiracial

# Define Variables 

## What Race Interaction Were Examined #################

## ## Change Interaction Examined Variable Names 
names(remir_all)[13] <- "inter_examine1_race"
names(remir_all)[76] <- "inter_examine2_race"
table(remir_all$inter_examine1_race, useNA = "always")
## 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Black/Not Black 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/Majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            W/B (White/African American or Black) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                          W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
## W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan);White/Multiracial; Black/Multiracial; Asian or Pacific Islander/Multiracial; Native American/Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 W/B (White/African American or Black);White/Other or Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   White/Minority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Non-White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Not White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <NA> 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              273
table(remir_all$inter_examine2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          5 
##                                                          Minority/Majority 
##                                                                          5 
##                                                                       None 
##                                                                          1 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          6 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          3 
##                                                                White/Other 
##                                                                          1 
##                                                                       <NA> 
##                                                                        269
## Combine Two Tnteractions Examined
remir_all$inter_examine12_race <- ifelse(is.na(remir_all$inter_examine1_race),
  remir_all$inter_examine2_race, remir_all$inter_examine1_race)
tabyl(remir_all$inter_examine12_race)
############## What Race Interactions Were Significant ################

## Change Interaction Significant Variable Names 
names(remir_all)[14] <- "inter_signif1_race"
names(remir_all)[77] <- "inter_signif2_race"
table(remir_all$inter_signif1_race, useNA = "always")
## 
##                                                             None 
##                                                               14 
##                            W/B (White/African American or Black) 
##                                                                1 
## W/B (White/African American or Black);White/Other or Multiracial 
##                                                                1 
##                                                   White/Minority 
##                                                                3 
##                                                             <NA> 
##                                                              273
table(remir_all$inter_signif2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          3 
##                                                          Minority/Majority 
##                                                                          2 
##                                                                       None 
##                                                                         14 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          1 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          1 
##                                                                       <NA> 
##                                                                        269
## Combine Two Tnteractions Significant
remir_all$inter_signif12_race <- ifelse(is.na(remir_all$inter_signif1_race),
  remir_all$inter_signif2_race, remir_all$inter_signif1_race)
tabyl(remir_all$inter_signif12_race)
############## What Race Interaction Groups Benefitted More ##############

## Change Interaction Benefitted Variable Names
names(remir_all)[16] <- "inter_benefit1_race"
names(remir_all)[79] <- "inter_benefit2_race"
table(remir_all$inter_benefit1_race, useNA = "always")
## 
## Black or African American;Other or Multiracial 
##                                              1 
##                                       Minority 
##                                              3 
##                                           None 
##                                             14 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            273
table(remir_all$inter_benefit2_race, useNA = "always")
## 
## Asian or Asian American;Minority        Black or African American 
##                                1                                2 
##  Black or African American;White                         Majority 
##                                1                                2 
##                             None                        Not Black 
##                               14                                2 
##             White + Another Race                             <NA> 
##                                1                              269
## Combine Two Tnteractions Benefitted
remir_all$inter_benefit12_race <- ifelse(is.na(remir_all$inter_benefit1_race),
  remir_all$inter_benefit2_race, remir_all$inter_benefit1_race)
tabyl(remir_all$inter_benefit12_race)
############# What Race Subgroup Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[47] <- "subg_examine1_race"
names(remir_all)[80] <- "subg_examine2_race"
table(remir_all$subg_examine1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 3 
##                   Black or African American;White 
##                                                 3 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               283
table(remir_all$subg_examine2_race, useNA = "always")
## 
## Asian or Asian American;Black or African American;White 
##                                                       1 
##                  Asian or Asian American;White;Minority 
##                                                       1 
##                               Black or African American 
##                                                       3 
##                     Black or African American;Not Black 
##                                                       1 
##                         Black or African American;White 
##                                                       4 
##          Black or African American;White + Another Race 
##                                                       3 
##             Black or African American;White;Multiracial 
##                                                       1 
##                                                Minority 
##                                                       1 
##                                      Minority; Majority 
##                                                       2 
##                                                    None 
##                                                       5 
##                                                   White 
##                                                       1 
##                                                    <NA> 
##                                                     269
## Combine Two Subgroups Examined
remir_all$subg_examine12_race <- ifelse(is.na(remir_all$subg_examine1_race),
  remir_all$subg_examine2_race, remir_all$subg_examine1_race)
tabyl(remir_all$subg_examine12_race)
############## What Race Subgroups Were Significant ######################

## Change Subgroup Significant Variable Names 
names(remir_all)[49] <- "subg_signif1_race"
names(remir_all)[82] <- "subg_signif2_race"
table(remir_all$subg_signif1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 5 
##                                              None 
##                                                 1 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               283
table(remir_all$subg_signif2_race, useNA = "always")
## 
##               Asian or Asian American;Minority 
##                                              1 
##                      Black or African American 
##                                              5 
##            Black or African American;Not Black 
##                                              1 
##                Black or African American;White 
##                                              3 
## Black or African American;White + Another Race 
##                                              3 
##    Black or African American;White;Multiracial 
##                                              1 
##                                       Minority 
##                                              1 
##                             Minority; Majority 
##                                              2 
##                                           None 
##                                              5 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            269
## Combine Two Subgroup Significant
remir_all$subg_signif12_race <- ifelse(is.na(remir_all$subg_signif1_race),
  remir_all$subg_signif2_race, remir_all$subg_signif1_race)
tabyl(remir_all$subg_signif12_race)
## INTERACTION RACE EXAMINED
tabyl(remir_all$inter_examine12_race)
## Simplify Codes
## Define as mixed if combined Black, Asian, etc into broad category
## Define as exact if referred specifically to Black, Asian, etc
## None = NA, as it means that race subgroups not examined
## Recode to Mixed and None
remir_all$inter_examine12_race_cat <-
  car::recode(remir_all$inter_examine12_race, "
    'Minority/Majority' = 'Mixed';
    'Minority/majority' = 'Mixed';
    'White/Minority' = 'Mixed'; 
    'White/Not White' = 'Mixed';
    'White/Non-White' = 'Mixed';  
    'White/Other' = 'Mixed';
    'None' = NA ")
## Code remaining to Exact
remir_all$inter_examine12_race_cat <-
  ifelse(remir_all$inter_examine12_race_cat != "Mixed", "Exact",
     remir_all$inter_examine12_race_cat)
## Check -- Looks OK
tabyl(remir_all$inter_examine12_race_cat)
tabyl(remir_all, inter_examine12_race, inter_examine12_race_cat)
## SUBGROUP RACE EXAMINED
tabyl(remir_all$subg_examine12_race)
## Simplify codes
## Define as mixed if combined Black, Asian, etcs into broad category
## Define as exact if referred specifically to Black, Asian, etc
## None = NA, as it means that race subgroups not examined
remir_all$subg_examine12_race_cat <- 
  ifelse(remir_all$subg_examine12_race == "White;Non-White" |
         remir_all$subg_examine12_race == "Minority" |
         remir_all$subg_examine12_race == "Minority; Majority", "Mixed",
  ifelse(remir_all$subg_examine12_race == "None", NA,"Exact"))
## Check -- Looks OK
tabyl(remir_all, subg_examine12_race, subg_examine12_race_cat)
tabyl(remir_all$subg_examine12_race_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE -- define over .75 as Homogeneous
tabyl(remir_all$inter_examine12_race_cat)
remir_all$inter_examine12_race_cat <- ifelse(
                        (remir_all$black_all > .75 |
                         remir_all$asian_all > .75 |
                         remir_all$native_all > .75 |
                         remir_all$pacif_all > .75 ) &
                         is.na(remir_all$inter_examine12_race_cat) &
                         is.na(remir_all$subg_examine12_race_cat), 
      "Homog", remir_all$inter_examine12_race_cat)
tabyl(remir_all$inter_examine12_race_cat)
## Check -- Mixed and Exact unchanged but many NAs now homogeneous
remir_all %>% filter(remir_all$inter_examine12_race_cat == 'Homog') %>% 
  select(black_all, asian_all, native_all, pacif_all, white_all) %>% 
  print(n=26)
## # A tibble: 26 × 5
##    black_all asian_all native_all pacif_all white_all
##        <dbl>     <dbl>      <dbl>     <dbl>     <dbl>
##  1      0.8       0             0         0      0   
##  2      0.8       0             0         0      0   
##  3      0.87      0             0         0      0   
##  4      0.84      0             0         0      0   
##  5      0.9       0.01          0         0      0.07
##  6      0.83      0             0         0      0.01
##  7      0.83      0             0         0      0.01
##  8      0.85      0.05          0         0      0.02
##  9      0.95      0             0         0      0   
## 10      1         0             0         0      0   
## 11      1         0             0         0      0   
## 12      1         0             0         0      0   
## 13      1         0             0         0      0   
## 14      1         0             0         0      0   
## 15      0.85      0             0         0      0   
## 16      0.85      0             0         0      0   
## 17      0.85      0             0         0      0   
## 18      0.82      0             0         0      0.15
## 19      0.82      0             0         0      0.15
## 20      0.8       0             0         0      0   
## 21      0.8       0             0         0      0   
## 22      1         0             0         0      0   
## 23      1         0             0         0      0   
## 24      1         0             0         0      0   
## 25      1         0             0         0      0   
## 26      0.87      0             0         0      0
## All Homogeneous samples are African American

## INTERACTION RACE BENEFIT
tabyl(remir_all$inter_benefit12_race)
## Simplify Codes
## Need to Use Three Variables to Simplify (benefit, examine, main effect)
tabyl(remir_all, inter_benefit12_race, inter_examine12_race_cat)
tabyl(remir_all, inter_benefit12_race, main_effect)
## Code as Exact if benefit any specific group of Blacks, Asians, etc
## Code as Mixed if benefit a combined group of Blacks, Asians, etc
## Code as Other if benefit whites only or no group 
## If None (i.e., equal effects), count as Exact or Mixed benefit if main effect
## If None (i.e., equal effects), count as no benefit or other if No main effect
## If None (i.e., equal effects) but examined is NA, then None means NA 
remir_all$inter_benefit12_race_cat <-
  ifelse(remir_all$inter_benefit12_race == 'Asian or Asian American;Minority' |
         remir_all$inter_benefit12_race == 'Black or African American;Other or Multiracial' |
         remir_all$inter_benefit12_race == 'Black or African American' |
         remir_all$inter_benefit12_race == 'Black or African American;White', 'Exact',
  ifelse(remir_all$inter_benefit12_race == 'Minority' |
         remir_all$inter_benefit12_race == 'White + Another Race', 'Mixed',
  ifelse(remir_all$inter_benefit12_race == 'Not Black' |
         remir_all$inter_benefit12_race == 'White' |
         remir_all$inter_benefit12_race == 'Majority', 'Other',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'Yes' &
         remir_all$inter_examine12_race_cat == 'Exact', 'Exact',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'Yes' &
         remir_all$inter_examine12_race_cat == 'Mixed', 'Mixed',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'No' &
         !is.na(remir_all$inter_examine12_race_cat), 'Other', NA))))))
## Check -- Looks OK
tabyl(remir_all$inter_benefit12_race_cat)
tabyl(remir_all, inter_benefit12_race, inter_benefit12_race_cat)
## SUBGROUP RACE BENEFIT
tabyl(remir_all$subg_signif12_race)
## Simplify codes
## None is NA if examined subgroups is NA
## None means no subgroup effects if examined is not NA (i.e., other or no benefit)
remir_all$subg_signif12_race_cat <- 
  ifelse(is.na(remir_all$subg_examine12_race_cat), NA,
  ifelse(remir_all$subg_signif12_race == "White;Non-White" |
         remir_all$subg_signif12_race == 'Minority' |
         remir_all$subg_signif12_race == 'Minority; Majority', "Mixed",
  ifelse(remir_all$subg_signif12_race == "None" |
         remir_all$subg_signif12_race == "White", "Other", "Exact")))
tabyl(remir_all$subg_signif12_race_cat)
## Check Looks OK
tabyl(remir_all$subg_signif12_race_cat)
tabyl(remir_all, subg_signif12_race, subg_signif12_race_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_benefit12_race_cat <- ifelse(
                       (remir_all$black_all > .75 |
                        remir_all$asian_all > .75 |
                        remir_all$native_all > .75 |
                        remir_all$pacif_all > .75 ) &
                        is.na(remir_all$inter_benefit12_race_cat) &
                        is.na(remir_all$subg_signif12_race_cat), 
      "Homog", remir_all$inter_benefit12_race_cat)
tabyl(remir_all$inter_benefit12_race_cat)
tabyl(remir_all, inter_examine12_race_cat, subg_examine12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_race_short <-
  ifelse(is.na(remir_all$inter_examine12_race_cat) & 
         is.na(remir_all$subg_examine12_race_cat), 'None',
  ifelse(remir_all$inter_examine12_race_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_race_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_race_short <- ifelse(
  is.na(remir_all$examine12_race_short), 'Yes', remir_all$examine12_race_short)
tabyl(remir_all$examine12_race_short)
remir_all$subg_signif12_race_cat <- 
  ifelse(is.na(remir_all$subg_examine12_race_cat), NA,
  ifelse(remir_all$subg_signif12_race == "White;Non-White" |
         remir_all$subg_signif12_race == 'Minority' |
         remir_all$subg_signif12_race == 'Minority; Majority', "Mixed",
  ifelse(remir_all$subg_signif12_race == "None" |
         remir_all$subg_signif12_race == "White", "Other", "Exact")))
tabyl(remir_all$subg_signif12_race_cat)
## Check Looks OK
tabyl(remir_all$subg_signif12_race_cat)
tabyl(remir_all, subg_signif12_race, subg_signif12_race_cat)
remir_us <- remir_all %>% filter(country == "USA")
# Simplify codes for Subgroup Race Benefit
remir_us$subg_signif12_race_cat <- 
  ifelse(is.na(remir_us$subg_examine12_race_cat), NA,
  ifelse(remir_us$subg_signif12_race == "White;Non-White" |
         remir_us$subg_signif12_race == 'Minority' |
         remir_us$subg_signif12_race == 'Minority; Majority', "Mixed",
  ifelse(remir_us$subg_signif12_race == "None" |
         remir_us$subg_signif12_race == "White", "Other", "Exact")))

# Check the simplified codes
tabyl(remir_us$subg_signif12_race_cat)
# Check the counts and proportions of each category
tabyl(remir_us$subg_signif12_race_cat)
tabyl(remir_us, subg_signif12_race, subg_signif12_race_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_benefit12_race_cat <- ifelse(
                       (remir_all$black_all > .75 |
                        remir_all$asian_all > .75 |
                        remir_all$native_all > .75 |
                        remir_all$pacif_all > .75 ) &
                        is.na(remir_all$inter_benefit12_race_cat) &
                        is.na(remir_all$subg_signif12_race_cat), 
      "Homog", remir_all$inter_benefit12_race_cat)
tabyl(remir_all$inter_benefit12_race_cat)
remir_us <- remir_all %>% filter(country == "USA")
remir_us$inter_benefit12_race_cat <- ifelse(
                       (remir_us$black_all > .75 |
                        remir_us$asian_all > .75 |
                        remir_us$native_all > .75 |
                        remir_us$pacif_all > .75 ) &
                        is.na(remir_us$inter_benefit12_race_cat) &
                        is.na(remir_us$subg_signif12_race_cat), 
      "Homog", remir_all$inter_benefit12_race_cat)
tabyl(remir_us$inter_benefit12_race_cat)

###I. Tested Subgroups

table(remir_us$inter_examine12_race_cat, remir_us$subg_examine12_race_cat,
  useNA = "always")
##        
##         Exact Mixed <NA>
##   Exact    13     0   11
##   Homog     0     0   26
##   Mixed     1     3   13
##   <NA>      8     2  163
tabyl(remir_us, inter_examine12_race_cat, subg_examine12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
# No - did not test subgroups
## All of these outputs were added to sum to .754, the proportion of programs that did NOT test for subgroup effects. 
1.3+5.4+0.8+67.9 ## Did Not Examine Exact, including NA 
## [1] 75.4
## Did Not Examine Benefit, including NA and Mixed
remir_us %>% filter(
                    (is.na(subg_signif12_race_cat) &
                     is.na(inter_benefit12_race_cat)) |
                    (subg_signif12_race_cat == 'Mixed' &
                     inter_benefit12_race_cat == 'Mixed') |
                    (is.na(subg_signif12_race_cat) &
                     inter_benefit12_race_cat == 'Mixed') | 
                    (subg_signif12_race_cat == 'Mixed' &
                     is.na(inter_benefit12_race_cat) | 
                    (subg_signif12_race_cat == 'Other' &
                      inter_benefit12_race_cat == 'Mixed') |
                    (subg_signif12_race_cat == 'Mixed' &
                      inter_benefit12_race_cat == 'Other')  )) %>% count()/240
# Yes - tested subgroups
## All of these outputs were added to sum to .246, the proportion of programs that tested for subgroup effects. 
4.6       ## Examined Exact Interaction only (NA for Subgroup)
## [1] 4.6
3.3       ## Examined Exact Subgroup only (NA for Interaction)
## [1] 3.3
5.4+0.4   ## Examined Exact Interaction and Subgroup (Include Mixed&Exact)
## [1] 5.8
10.8      ## No Tests but Homogeneous Sample
## [1] 10.8

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

#### a. Examined Interaction 
remir_us %>% filter(inter_examine12_race_cat == 'Exact' &
    is.na(subg_examine12_race_cat)) %>% count()/240
#### b. Examined Subgroup
remir_us %>% filter(subg_examine12_race_cat == 'Exact' &
    is.na(inter_examine12_race_cat)) %>% count()/240
## c. Examined Both 
remir_us %>% filter((subg_examine12_race_cat == 'Exact' &
                     inter_examine12_race_cat == 'Exact') |
                    (subg_examine12_race_cat == 'Exact' &
                     inter_examine12_race_cat == 'Mixed') |
                    (subg_examine12_race_cat == 'Mixed' &
                     inter_examine12_race_cat == 'Exact')) %>% count()/240
#### d. Homogeneous Sample
remir_us %>% filter(inter_examine12_race_cat == 'Homog') %>% count()/240
## Did Not Examine Exact, including NA 
remir_us %>% filter(
                    (is.na(subg_examine12_race_cat) &
                     is.na(inter_examine12_race_cat)) |
                    (subg_examine12_race_cat == 'Mixed' &
                     inter_examine12_race_cat == 'Mixed') |
                    (is.na(subg_examine12_race_cat) &
                     inter_examine12_race_cat == 'Mixed') | 
                    (subg_examine12_race_cat == 'Mixed' &
                     is.na(inter_examine12_race_cat))) %>% count()/240

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

##### e. Relative Benefit in Interaction
table(remir_us$inter_benefit12_race_cat, remir_us$subg_signif12_race_cat,
  useNA = 'always') 
##        
##         Exact Mixed Other <NA>
##   Exact     2     0     0   15
##   Homog     0     0     0   21
##   Mixed     3     0     0   11
##   Other     1     0     0    6
##   <NA>     14     5     2  160
tabyl(remir_us, inter_benefit12_race_cat, subg_signif12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Benefitted Exact Interaction only (NA for Subgroup)
remir_us %>% filter(inter_benefit12_race_cat == 'Exact' &
    is.na(subg_signif12_race_cat)) %>% count()/240
##### f. Absolute Benefit in Subgroup

## Benefitted Exact Subgroup only (NA for Interaction)
remir_us %>% filter(subg_signif12_race_cat == 'Exact' &
    is.na(inter_benefit12_race_cat)) %>% count()/240
##### g. Benefit in Interaction and Subgroup
## Benefitted Exact Interaction and Subgroup (Include if one Exact)
remir_us %>% filter((subg_signif12_race_cat == 'Exact' &
                     inter_benefit12_race_cat == 'Exact') |
                    (subg_signif12_race_cat == 'Exact' &
                     inter_benefit12_race_cat == 'Mixed') |
                    (subg_signif12_race_cat == 'Mixed' &
                     inter_examine12_race_cat == 'Exact')) %>% count()/240
##### h. Homogenous Sample

## No Tests but Homogeneous Sample
remir_us %>% filter(inter_benefit12_race_cat == 'Homog') %>% count()/240
##### i. No Benefit Interaction or Subgroup

## Other: Benefit for Whites or No Benefit Overall 
remir_us %>% filter((subg_signif12_race_cat == 'Other' &
                     inter_benefit12_race_cat == 'Other') |
                    (subg_signif12_race_cat == 'Other' &
                     is.na(inter_benefit12_race_cat)) |
                    (is.na(subg_signif12_race_cat) &
                     inter_benefit12_race_cat == 'Other')) %>% count()/240
## Check Exact Benefit Results Manually
2.9 ## Benefit Exact Interaction only
## [1] 2.9
2.9 ## Benefit Exact Subgroup only
## [1] 2.9
5.0+0.4 ## Benefit Exact Interaction and Subgroup
## [1] 5.4
10.8 ## No Tests but Homogeneous Sample
## [1] 10.8
2.1+0.4 ## Did Not Benefit Exact Group -- Benefit for Other 
## [1] 2.5
0.4+0.4+5.0+0.8+0.8+67.9 ## Not Examined -- Include Mixed Only, Mixed Other
## [1] 75.3
2.9+2.9+5.4+10.8+2.5+75.3 ## Sums of 99.8
## [1] 99.8

Column 2: Measured race according to one or more of the U.S. Census categories (see #1) or to collapsed categories

I. Tested Subgroups

table(remir_us$inter_examine12_race_cat, remir_us$subg_examine12_race_cat,
  useNA = "always")
##        
##         Exact Mixed <NA>
##   Exact    13     0   11
##   Homog     0     0   26
##   Mixed     1     3   13
##   <NA>      8     2  163
tabyl(remir_us, inter_examine12_race_cat, subg_examine12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
# No - did not test subgroups
## All of these outputs were added to sum to .679, the proportion of programs that did NOT test for subgroup effects. 
67.9 ## Examined Neither 
## [1] 67.9
remir_us %>% filter(
                    (is.na(subg_examine12_race_cat) &
                     is.na(inter_examine12_race_cat))) %>% count()/240
# Yes - tested subgroups
## All of these outputs were added to sum to .321, the proportion of programs that tested for subgroup effects.
4.6+5.4 ## Examined Exact or Mixed Interaction only (NA for Subgroup)
## [1] 10
3.3+0.8  ## Examined Mixed Subgroup only (NA for Interaction)
## [1] 4.1
5.4+0.4+1.3 ## Examined Exact Interaction and Subgroup
## [1] 7.1
10.8  ## No Tests but Homogeneous Sample
## [1] 10.8

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

#### a. Examined Interaction
remir_us %>% filter(
   (inter_examine12_race_cat == 'Exact' |
    inter_examine12_race_cat == 'Mixed')  &
    is.na(subg_examine12_race_cat)) %>% count()/240
#### b. Examined Subgroup
remir_us %>% filter(
   (subg_examine12_race_cat == 'Exact' |
    subg_examine12_race_cat == 'Mixed')  &
    is.na(inter_examine12_race_cat)) %>% count()/240
#### c. Examined Both
remir_us %>% filter((subg_examine12_race_cat == 'Exact' &
                     inter_examine12_race_cat == 'Exact') |
                    (subg_examine12_race_cat == 'Exact' &
                     inter_examine12_race_cat == 'Mixed') |
                    (subg_examine12_race_cat == 'Mixed' &
                     inter_examine12_race_cat == 'Exact') |
                    (subg_examine12_race_cat == 'Mixed' &
                     inter_examine12_race_cat == 'Mixed') ) %>% count()/240
#### d. Homogeneous Sample
remir_us %>% filter(inter_examine12_race_cat == 'Homog') %>% count()/240

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

#### e. Relative Benefit in Interaction 

table(remir_us$inter_benefit12_race_cat, remir_us$subg_signif12_race_cat,
  useNA = 'always') 
##        
##         Exact Mixed Other <NA>
##   Exact     2     0     0   15
##   Homog     0     0     0   21
##   Mixed     3     0     0   11
##   Other     1     0     0    6
##   <NA>     14     5     2  160
tabyl(remir_us, inter_benefit12_race_cat, subg_signif12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Benefitted Exact or Mixed Interaction only (NA for Subgroup)
remir_us %>% filter(
   (inter_benefit12_race_cat == 'Exact' |
    inter_benefit12_race_cat == 'Mixed')  &
    is.na(subg_signif12_race_cat)) %>% count()/240
#### f. Absolute Benefit in Subgroup 

## Benefitted Exact or Mixed Subgroup only (NA for Interaction)
remir_us %>% filter(
   (subg_signif12_race_cat == 'Exact' |
    subg_signif12_race_cat == 'Mixed')  &
    is.na(inter_benefit12_race_cat)) %>% count()/240
#### g. Benefit in Interaction & Subgroup 

## Benefitted Exact or Mixed Interaction and Subgroup (Include Mixed&Exact)
remir_us %>% filter((subg_signif12_race_cat == 'Exact' &
                     inter_benefit12_race_cat == 'Exact') |
                    (subg_signif12_race_cat == 'Exact' &
                     inter_benefit12_race_cat == 'Mixed') |
                    (subg_signif12_race_cat == 'Mixed' &
                     inter_benefit12_race_cat == 'Exact') |
                    (subg_signif12_race_cat == 'Mixed' &
                     inter_benefit12_race_cat == 'Mixed') ) %>% count()/240
#### h. Homogeneous Sample 

## No Tests but Homogeneous Sample
remir_us %>% filter(inter_benefit12_race_cat == 'Homog') %>% count()/240
## Other: Benefit for Whites or No Benefit Overall
remir_us %>% filter((subg_signif12_race_cat == 'Other' &
                     inter_benefit12_race_cat == 'Other') |
                    (subg_signif12_race_cat == 'Other' &
                     is.na(inter_benefit12_race_cat)) |
                    (is.na(subg_signif12_race_cat) &
                     inter_benefit12_race_cat == 'Other') |
                    (subg_signif12_race_cat == 'Other' &
                     inter_benefit12_race_cat == 'Mixed') |
                    (subg_signif12_race_cat == 'Mixed' &
                     inter_benefit12_race_cat == 'Other') ) %>% count()/240
#### i. No Benefit Interaction or Subgroup

## Did Not Examine Exact or Mixed
remir_us %>% filter(
                    (is.na(subg_examine12_race_cat) &
                     is.na(inter_examine12_race_cat))) %>% count()/240
## Manually Check Benefit Percentages for Exact or Mixed 
2.9+5.0 ## Benefit Exact and Mixed Interaction only
## [1] 7.9
2.9+0.8 ## Benefit exact and Mixed Subgroup only
## [1] 3.7
5.0+0.4+0.4 ## Benefit Exact and Mixed Both Tests
## [1] 5.8
10.8 ## No tests but Homogeneous
## [1] 10.8
0.8+2.1+0.4+0.4 ## Benefit Other, including Mixed/Other
## [1] 3.7
67.9 ## Did not Benefit Group
## [1] 67.9
7.9+3.7+5.8+3.7+10.8+67.9 ## Sums to 99.8
## [1] 99.8

Column 3 & 4: Measured ethnicity according to one or more of the U.S. Census categories of Hispanic or Latino; 4) Measured ethnicity according to the U.S. Census categories (see #3) or mixed categories with racial groups

############## What Ethnic Interaction Groups Examined ################

## Change Inteaction Examined Variable Names 
names(remir_us)[18] <- "inter_examine1_ethnic"
names(remir_us)[84] <- "inter_examine2_ethnic"
table(remir_us$inter_examine1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/majority     Minority/Majority 
##                     5                     2                     1 
##        White/Minority       White/Non-White                  <NA> 
##                     3                     1                   228
table(remir_us$inter_examine2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                    14                     5                     2 
##        White/Minority           White/Other                  <NA> 
##                     1                     1                   217
## Combine Two Tnteractions Examined
remir_us$inter_examine12_ethnic <- ifelse(is.na(remir_us$inter_examine1_ethnic),
  remir_us$inter_examine2_ethnic, remir_us$inter_examine1_ethnic)
tabyl(remir_us$inter_examine12_ethnic)
############## What Ethnic Interactions Were Significant ###############

## Change Interaction Significant Variable Names 
names(remir_us)[19] <- "inter_signif1_ethnic"
names(remir_us)[85] <- "inter_signif2_ethnic"
table(remir_us$inter_signif1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic                  None        White/Minority 
##                     2                    11                     3 
##                  <NA> 
##                   224
table(remir_us$inter_signif2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                     6                     2                    14 
##        White/Minority                  <NA> 
##                     1                   217
## Combine Two Tnteractions Significant
remir_us$inter_signif12_ethnic <- ifelse(is.na(remir_us$inter_signif1_ethnic),
  remir_us$inter_signif2_ethnic, remir_us$inter_signif1_ethnic)
tabyl(remir_us$inter_signif12_ethnic)
############## What Ethnic Interaction Groups Benefited More ############

## Change Interaction Benefitted Variable Names
names(remir_us)[21] <- "inter_benefit1_ethnic"
names(remir_us)[87] <- "inter_benefit2_ethnic"
table(remir_us$inter_benefit1_ethnic, useNA = "always")
## 
## Hispanic Minority     None     <NA> 
##        2        3       11      224
table(remir_us$inter_benefit2_ethnic, useNA = "always")
## 
##     Hispanic     Majority     Minority Non-Hispanic         None         <NA> 
##            3            2            1            3           14          217
## Combine Two Tnteractions Benefitted
remir_us$inter_benefit12_ethnic <- ifelse(is.na(remir_us$inter_benefit1_ethnic),
  remir_us$inter_benefit2_ethnic, remir_us$inter_benefit1_ethnic)
tabyl(remir_us$inter_benefit12_ethnic)
############# What Ethnic Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_us)[51] <- "subg_examine1_ethnic"
names(remir_us)[88] <- "subg_examine2_ethnic"
table(remir_us$subg_examine1_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic                  <NA> 
##                     6                     1                   233
table(remir_us$subg_examine2_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic              Minority 
##                    12                     3                     2 
##    Minority; Majority                  None                  <NA> 
##                     2                     4                   217
## Combine Two Subgroups Examined
remir_us$subg_examine12_ethnic <- ifelse(is.na(remir_us$subg_examine1_ethnic),
  remir_us$subg_examine2_ethnic, remir_us$subg_examine1_ethnic)
tabyl(remir_us$subg_examine12_ethnic)
############## What Ethnic Subgroups Were Significant ##################

## Change Subgroup Significant Variable Names 
names(remir_us)[53] <- "subg_signif1_ethnic"
names(remir_us)[90] <- "subg_signif2_ethnic"
table(remir_us$subg_signif1_ethnic, useNA = "always")
## 
## Hispanic     None     <NA> 
##        5        2      233
table(remir_us$subg_signif2_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic              Minority 
##                    10                     3                     2 
##    Minority; Majority                  None                  <NA> 
##                     2                     6                   217
## Combine Two Tnteractions Significant
remir_us$subg_signif12_ethnic <- ifelse(is.na(remir_us$subg_signif1_ethnic),
  remir_us$subg_signif2_ethnic, remir_us$subg_signif1_ethnic)
tabyl(remir_us$subg_signif12_ethnic)
## INTERACTION ETHNIC EXAMINED
tabyl(remir_us$inter_examine12_ethnic)
## Simplify Codes
## Define as mixed if combined Hispanics into broad category
## Define as exact if referred specifically to Hispanic, Non-Hispanic
## None = NA for examined, as it means that Hispanic subgroups not examined
## First, assign exact and none
remir_us$inter_examine12_ethnic_cat <-
  car::recode(remir_us$inter_examine12_ethnic, "
  'Hispanic/Non-Hispanic' = 'Exact';
  'None' = NA ")
tabyl(remir_us$inter_examine12_ethnic_cat)
## Second, remaining categores are assigned as mixed
remir_us$inter_examine12_ethnic_cat <-
  ifelse(remir_us$inter_examine12_ethnic_cat != "Exact", "Mixed",
     remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us$inter_examine12_ethnic_cat)
## Check -- Looks OK
tabyl(remir_us, inter_examine12_ethnic, inter_examine12_ethnic_cat)
## SUBGROUP ETHNIC EXAMINED
tabyl(remir_us$subg_examine12_ethnic)
## Simplify Codes
## Define as mixed if combined Hispanics into broad category
## Define as exact if referred specifically to Hispanic, Non-HispaniceBlack, Asian, etc
## None = NA for examined, as it means that Hispanic subgroups not examined
remir_us$subg_examine12_ethnic_cat <-
  ifelse(remir_us$subg_examine12_ethnic == 'Minority'|
          remir_us$subg_examine12_ethnic == 'Minority; Majority',
    'Mixed', 
  ifelse(remir_us$subg_examine12_ethnic == 'None', NA,
    'Exact'))
## Check -- Looks OK
tabyl(remir_us$subg_examine12_ethnic_cat)
tabyl(remir_us, subg_examine12_ethnic, subg_examine12_ethnic_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE OF HISPANICS
tabyl(remir_us$inter_examine12_ethnic_cat)
remir_us$inter_examine12_ethnic_cat <- ifelse(
                        (remir_us$hisp_all > .75) &
                        is.na(remir_us$inter_examine12_ethnic_cat) &
                        is.na(remir_us$subg_examine12_ethnic_cat), 
      "Homog", remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us, inter_examine12_ethnic, inter_examine12_ethnic_cat)
I. Tested Subgroups
tabyl(remir_us, inter_examine12_ethnic_cat, subg_examine12_ethnic_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
1.7+4.2+79.6 ## Examined Neither Test or Mixed
## [1] 85.5
II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?
## COMBINE ETHNIC INTERACTION AND SUBGROUP EXAMINED
table(remir_us$inter_examine12_ethnic_cat, remir_us$subg_examine12_ethnic_cat,
  useNA = "always")
##        
##         Exact Mixed <NA>
##   Exact    13     0    6
##   Homog     0     0    7
##   Mixed     0     4   10
##   <NA>      9     0  191
tabyl(remir_us, inter_examine12_ethnic_cat, subg_examine12_ethnic_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Compute Percentages for Exact Four Categories
2.5   ## Examined Exact Hispanic Interaction only
## [1] 2.5
3.8 ## Examined Exact Hispanic Subgroup only
## [1] 3.8
5.4 ## Examined Hispanic Interaction and Subgroup
## [1] 5.4
2.9 ## No Tests but Homogeneous Subgroup
## [1] 2.9
1.7+4.2+79.6 ## Examined Neither Test or Mixed
## [1] 85.5
2.5+3.8+5.4+2.9+85.5 ## Sums to 100.1
## [1] 100.1
## Compute Percentages for Exact and Mixed Categories
2.5+4.2  ## Examined Interaction only
## [1] 6.7
3.8+0.0  ## Examined Subgroup only
## [1] 3.8
5.4+1.7  ## Examined Interaction and Subgroup
## [1] 7.1
2.9     ## No Test but Homogeneous Sample
## [1] 2.9
79.6 ## Examined Neither 
## [1] 79.6
6.7+3.8+7.1+2.9+79.6 ## Sum to 100.1
## [1] 100.1
III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?
## INTERACTION ETHNIC BENEFIT
tabyl(remir_us$inter_benefit12_ethnic)
## Simplify Codes
## Code as Exact Benefit if Hispanic 
## Code as Other if Non-Hispanic or Majority
## Code as Mixed if Minority
## If None (i.e., equal effects) count as benefit if main effect
## If None (i.e., equal effects) count as other if if no main effect
## If None and ethnic not examined, code as NA as meaning of None for interaction is unclear
## Code Unclear as NA
remir_us$inter_benefit12_ethnic_cat <-
  ifelse(remir_us$inter_benefit12_ethnic == 'Hispanic', 'Exact',
  ifelse(remir_us$inter_benefit12_ethnic == 'Minority', 'Mixed',
  ifelse(remir_us$inter_benefit12_ethnic == 'Non-Hispanic' |
         remir_us$inter_benefit12_ethnic == 'Majority', 'Other',
  ifelse(remir_us$inter_benefit12_ethnic == 'None' &
         remir_us$main_effect           == 'Yes' &
         remir_us$inter_examine12_ethnic_cat == 'Exact', 'Exact',
  ifelse(remir_us$inter_benefit12_ethnic == 'None' &
         remir_us$main_effect          == 'Yes' &
         remir_us$inter_examine12_ethnic_cat == 'Mixed', 'Mixed',
  ifelse(remir_us$inter_benefit12_ethnic == 'None' &
         remir_us$main_effect          == 'No' &
         !is.na(remir_us$inter_examine12_ethnic_cat), 'Other', NA))))))
## Check -- Looks OK
tabyl(remir_us$inter_benefit12_ethnic_cat)
tabyl(remir_us, inter_benefit12_ethnic, inter_benefit12_ethnic_cat)
## SUBGROUP ETHNIC BENEFIT
tabyl(remir_us$subg_signif12_ethnic)
## Simplify codes
## None here means no subgroup effects, should be other or no benefit
remir_us$subg_signif12_ethnic_cat <- 
  ifelse(remir_us$subg_signif12_ethnic == "Hispanic" |
         remir_us$subg_signif12_ethnic == "Hispanic;Non-Hispanic" , "Exact",
  ifelse(remir_us$subg_signif12_ethnic == "None", "Other", 
  ifelse(remir_us$subg_signif12_ethnic == "Minority" |
         remir_us$subg_signif12_ethnic == "Minority; Majority", "Mixed", 
  ifelse(is.na(remir_us$subg_examine12_ethnic), NA, 'Check'))))
## Check
tabyl(remir_us$subg_signif12_ethnic_cat)
tabyl(remir_us, subg_signif12_ethnic, subg_signif12_ethnic_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
tabyl(remir_us$inter_benefit12_ethnic_cat)
remir_us$inter_benefit12_ethnic_cat <- ifelse(
                        (remir_us$hisp_all > .75) &
                        is.na(remir_us$inter_benefit12_ethnic_cat) &
                        is.na(remir_us$subg_signif12_ethnic_cat), 
      "Homog", remir_us$inter_benefit12_ethnic_cat)
tabyl(remir_us$inter_benefit12_ethnic_cat)
## Problem NA n = 200 for examined n = 198 for benefited
## How can cases that don't examine ethicity show a benefit

remir_us %>% filter(is.na(inter_examine12_ethnic_cat) &
                    is.na(subg_examine12_ethnic_cat) &
                   !is.na(inter_benefit12_ethnic_cat) &
                   is.na(subg_signif12_ethnic_cat)) %>% 
  select(Citation.ID, Program.Name, inter_examine12_ethnic_cat, 
    subg_examine12_ethnic_cat) 
remir_us %>% filter(is.na(inter_examine12_ethnic_cat) &
                    is.na(subg_examine12_ethnic_cat) &
                   !is.na(inter_benefit12_ethnic_cat) &
                   is.na(subg_signif12_ethnic_cat)) %>% 
  select(Citation.ID, Program.Name, inter_benefit12_ethnic_cat, 
    subg_signif12_ethnic_cat)
## Change 3980 and 3981 to NA so that examined and benefit are consistent
tabyl(remir_us$inter_benefit12_ethnic_cat)
remir_us$inter_benefit12_ethnic_cat <- 
  ifelse(remir_us$Citation.ID == 3980, NA, remir_us$inter_benefit12_ethnic_cat)
tabyl(remir_us$inter_benefit12_ethnic_cat)
remir_us$inter_benefit12_ethnic_cat <- 
  ifelse(remir_us$Citation.ID == 3981, NA, remir_us$inter_benefit12_ethnic_cat)
tabyl(remir_us$inter_benefit12_ethnic_cat)
## COMBINE ETHNIC INTERACTION AND SUBGROUP BENEFIT
## Other category is problematic -- compute as residual

table(remir_us$inter_benefit12_ethnic_cat, remir_us$subg_signif12_ethnic_cat,
  useNA = 'always') 
##        
##         Exact Mixed Other <NA>
##   Exact     8     0     3    5
##   Homog     0     0     0    7
##   Mixed     0     2     2    7
##   Other     3     2     1    0
##   <NA>      7     0     2  191
tabyl(remir_us, inter_benefit12_ethnic_cat, subg_signif12_ethnic_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Compute Percentages for Exact Categories
2.1 ## Benefitted Exact Hispanic Interaction only
## [1] 2.1
2.9 ## Benefitted Exact Hispanic Subgroup only
## [1] 2.9
3.3 ## Benefitted Hispanic Interaction and Subgroup
## [1] 3.3
1.3+0.4+1.3+0.8 ## Benefitted Other
## [1] 3.8
2.9 ## No tests but Homogeneous Sample
## [1] 2.9
0.8+0.8+2.9+0.8+79.6 ## No tests -- use same percentage of no tests for examined
## [1] 84.9
100-2.1-2.9-3.3-2.9-79.6 ## Residual = Did Not Benefit Hispanic Exact 
## [1] 9.2
2.1+2.9+3.3+44.2+44.2+3.3 ## Sums to 100
## [1] 100
## Compute Percentages for Mixed Categories
2.1+2.9 ## Benefitted Mixed Hispanic Interaction only
## [1] 5
2.9+0.0 ## Benefitted Mixed Hispanic Subgroup only
## [1] 2.9
3.3+0.8 ## Benefitted Hispanic Interaction and Subgroup
## [1] 4.1
2.9 ## No Tests but Homogeneous Sample
## [1] 2.9
79.6 ## Did Not Examine Ethnic Mixed
## [1] 79.6
1.3+0.8+0.4+1.3+0.8+0.8 ## Residual = Did Not Benefit Hispanic Exact 
## [1] 5.4
5.0+2.9+4.1+2.9+5.4+79.6 ## Sums to 99.9
## [1] 99.9

Column 5: Measured gender according to a binary category of female

## Column 5: Measured gender according to a binary category of female 

# Combine Interaction Examined Gender Variables
names(remir_us)[23] <- "inter_examine1_gender"
names(remir_us)[92] <- "inter_examine2_gender"
remir_us$inter_examine12_gender <- ifelse(is.na(remir_us$inter_examine1_gender),
  remir_us$inter_examine2_gender, remir_us$inter_examine1_gender)
tabyl(remir_us$inter_examine12_gender)
# Combine Subgroup Examined Gender Variables
names(remir_us)[55] <- "subg_examine1_gender"
names(remir_us)[96] <- "subg_examine2_gender"
remir_us$subg_examine12_gender <- ifelse(is.na(remir_us$subg_examine1_gender),
  remir_us$subg_examine2_gender, remir_us$subg_examine1_gender)
tabyl(remir_us$subg_examine12_gender)
# Create a combined variable for examined gender subgroups
remir_us$examine12_gender_short <-
  ifelse(is.na(remir_us$inter_examine12_gender) & 
         is.na(remir_us$subg_examine12_gender), 'None',
  ifelse(remir_us$inter_examine12_gender == 'Homog', 'Homog', 'Yes'))

# Fix remaining NAs for examined gender subgroups
remir_us$examine12_gender_short <- ifelse(
  is.na(remir_us$examine12_gender_short), 'Yes', remir_us$examine12_gender_short)
tabyl(remir_us$examine12_gender_short)
# Combine Interaction Significant Gender Variables
names(remir_us)[24] <- "inter_signif1_gender"
names(remir_us)[93] <- "inter_signif2_gender"
remir_us$inter_signif12_gender <- ifelse(is.na(remir_us$inter_signif1_gender),
  remir_us$inter_signif2_gender, remir_us$inter_signif1_gender)
tabyl(remir_us$inter_signif12_gender)
# Combine Interaction Benefitted Gender Variables
names(remir_us)[26] <- "inter_benefit1_gender"
names(remir_us)[95] <- "inter_benefit2_gender"
remir_us$inter_benefit12_gender <- ifelse(is.na(remir_us$inter_benefit1_gender),
  remir_us$inter_benefit2_gender, remir_us$inter_benefit1_gender)
tabyl(remir_us$inter_benefit12_gender)
# Combine Subgroup Significant Gender Variables
names(remir_us)[57] <- "subg_signif1_gender"
names(remir_us)[98] <- "subg_signif2_gender"
remir_us$subg_signif12_gender <- ifelse(is.na(remir_us$subg_signif1_gender),
  remir_us$subg_signif2_gender, remir_us$subg_signif1_gender)
tabyl(remir_us$subg_signif12_gender)
# Generate summary tables
tabyl(remir_us, inter_examine12_gender, subg_examine12_gender) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
tabyl(remir_us$examine12_gender_short)
tabyl(remir_us$inter_examine12_gender)
tabyl(remir_us$inter_signif12_gender)
tabyl(remir_us$inter_benefit12_gender)
tabyl(remir_us$subg_examine12_gender)
tabyl(remir_us$subg_signif12_gender)
############## What Gender Interactions Were Examined 

## Change Interaction Examined Gender Variable Names
names(remir_all)[23] <- "inter_examine1_gender"
names(remir_all)[92] <- "inter_examine2_gender"
table(remir_all$inter_examine1_gender, useNA = "always")
## 
## Male/Female        <NA> 
##          41         251
table(remir_all$inter_examine2_gender, useNA = "always")
## 
## Male/Female        <NA> 
##          37         255
## Combine Two Gender Tnteractions Examined
remir_all$inter_examine12_gender <- ifelse(is.na(remir_all$inter_examine1_gender),
  remir_all$inter_examine2_gender, remir_all$inter_examine1_gender)
tabyl(remir_all$inter_examine12_gender)
############## What Gender interactions Were Significant ###############

## Change Interaction Significant Variable Names 
names(remir_all)[24] <- "inter_signif1_gender"
names(remir_all)[93] <- "inter_signif2_gender"
table(remir_all$inter_signif1_gender, useNA = "always")
## 
## Male/Female        None        <NA> 
##           6          35         251
table(remir_all$inter_signif2_gender, useNA = "always")
## 
## Male/Female        None        <NA> 
##          18          19         255
## Combine Two Tnteractions Significant
remir_all$inter_signif12_gender <- ifelse(is.na(remir_all$inter_signif1_gender),
  remir_all$inter_signif2_gender, remir_all$inter_signif1_gender)
tabyl(remir_all$inter_signif12_gender)
########## What Gender Interaction Groups Benefited More ##################

## Change Interaction Benefitted Variable Names
names(remir_all)[26] <- "inter_benefit1_gender"
names(remir_all)[95] <- "inter_benefit2_gender"
table(remir_all$inter_benefit1_gender, useNA = "always")
## 
##  Female    Male    None Unclear    <NA> 
##       4       1      35       1     251
table(remir_all$inter_benefit2_gender, useNA = "always")
## 
##  Female    Male    None Unclear    <NA> 
##       7       7      19       4     255
## Combine Two Tnteractions
remir_all$inter_benefit12_gender <- ifelse(is.na(remir_all$inter_benefit1_gender),
  remir_all$inter_benefit2_gender, remir_all$inter_benefit1_gender)
tabyl(remir_all$inter_benefit12_gender)
############# What Gender Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[55] <- "subg_examine1_gender"
names(remir_all)[96] <- "subg_examine2_gender"
table(remir_all$subg_examine1_gender, useNA = "always")
## 
## Male;Female        <NA> 
##          13         279
table(remir_all$subg_examine2_gender, useNA = "always")
## 
##      Female Male;Female        None        <NA> 
##           1          34           2         255
## Combine Two Subgroups Examined
remir_all$subg_examine12_gender <- ifelse(is.na(remir_all$subg_examine1_gender),
  remir_all$subg_examine2_gender, remir_all$subg_examine1_gender)
tabyl(remir_all$subg_examine12_gender)
############## What Gender Subgroups Were Significant #####################

## Change Subgroup Significant Variable Names 
names(remir_all)[57] <- "subg_signif1_gender"
names(remir_all)[98] <- "subg_signif2_gender"
table(remir_all$subg_signif1_gender, useNA = "always")
## 
##      Female        Male Male;Female        None        <NA> 
##           2           3           6           2         279
table(remir_all$subg_signif2_gender, useNA = "always")
## 
##      Female        Male Male;Female        None        <NA> 
##           3           2          25           7         255
## Combine Two Tnteractions Significant
remir_all$subg_signif12_gender <- ifelse(is.na(remir_all$subg_signif1_gender),
  remir_all$subg_signif2_gender, remir_all$subg_signif1_gender)
tabyl(remir_all$subg_signif12_gender)
## INTERACTION GENDER EXAMINED
tabyl(remir_all$inter_examine12_gender)
## SUBGROUP GENDER EXAMINED
tabyl(remir_all$subg_examine12_gender)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_examine12_gender <- ifelse(
                        (remir_all$female_all > .75 ) &
                        is.na(remir_all$inter_examine12_gender) &
                        is.na(remir_all$subg_examine12_gender), 
      "Homog", remir_all$inter_examine12_gender)
tabyl(remir_all$inter_examine12_gender)
## INTERACTION GENDER BENEFITTTED
tabyl(remir_all$inter_benefit12_gender)
## Simplify Codes
remir_all$inter_benefit12_gender_cat <-
  ifelse(remir_all$inter_benefit12_gender == 'None' &
         remir_all$main_effect           == 'Yes', 'Both',
  ifelse(remir_all$inter_benefit12_gender == 'None' &
         remir_all$main_effect          == 'No', 'Neither', 
         remir_all$inter_benefit12_gender))
## Check -- Look OK
tabyl(remir_all, inter_benefit12_gender, inter_benefit12_gender_cat)
tabyl(remir_all$inter_benefit12_gender_cat)
## SUBGROUP GENDER BENEFITTED
tabyl(remir_all$subg_signif12_gender)
## SEPARATE OUT HOMOGENOUS SAMPLE
remir_all$inter_benefit12_gender_cat <- ifelse(
                        (remir_all$female_all > .75) &
                        is.na(remir_all$inter_benefit12_gender_cat) &
                        is.na(remir_all$subg_signif12_gender), 
      "Homog", remir_all$inter_benefit12_gender_cat)
tabyl(remir_all$inter_benefit12_gender_cat)
## More Simplification
remir_all$inter_benefit12_gender_cat2 <-
  ifelse(remir_all$inter_benefit12_gender_cat == 'Male' |
         remir_all$inter_benefit12_gender_cat == 'Neither', 'Other',
  ifelse(remir_all$inter_benefit12_gender_cat == 'Both' |
         remir_all$inter_benefit12_gender_cat == 'Female', 'Female', 
  ifelse(remir_all$inter_benefit12_gender_cat == 'Unclear', NA,
    remir_all$inter_benefit12_gender_cat))) 
tabyl(remir_all, inter_benefit12_gender_cat, inter_benefit12_gender_cat2)
tabyl(remir_all, inter_benefit12_gender_cat2)
remir_all$subg_signif12_gender_cat <-
  ifelse(remir_all$subg_signif12_gender == 'Female' |
         remir_all$subg_signif12_gender == 'Male;Female', 'Female',
    ifelse(remir_all$subg_signif12_gender == 'Male' |
         remir_all$subg_signif12_gender == 'None', 'Other', 
    remir_all$subg_signif12_gender))
tabyl(remir_all, subg_signif12_gender, subg_signif12_gender_cat)
tabyl(remir_all, subg_signif12_gender_cat)

I. Tested Subgroups

## Did Not Examine Gender 
remir_us %>% filter(
                    (is.na(subg_examine12_gender) &
                     is.na(inter_examine12_gender))) %>% count()/240

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?*

##### a. Examined Interaction
remir_us %>% filter(inter_examine12_gender == 'Male/Female' &
    (is.na(subg_examine12_gender) | subg_examine12_gender == 'None')) %>% count()/240
##### b. Examined Subgroup
remir_us %>% filter((subg_examine12_gender == 'Male;Female' |
    subg_examine12_gender == 'Female') &
    is.na(inter_examine12_gender)) %>% count()/240
##### c. Examined Both
remir_us %>% filter((subg_examine12_gender == 'Male;Female' &
                     inter_examine12_gender == 'Male/Female') |
                    (subg_examine12_gender == 'Female' &
                     inter_examine12_gender == 'Male/Female')) %>% count()/240
##### d. Homogenous Sample
remir_us %>% filter(inter_examine12_gender == 'Homog') %>% count()/240
## Manually Check Percentages 
12.9+0.8 ## Examined Interaction only
## [1] 13.7
0.0+4.2 ## Examined Subgroup only
## [1] 4.2
0.4+13.3 ## Examined Interaction and Subgroup
## [1] 13.7
15.0 ## No tests but Homogeneous Sample
## [1] 15
53.3 ## Examined Neither
## [1] 53.3
13.7+4.2+13.7+15.0+53.3 ## Sums to 99.9
## [1] 99.9

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

##### e. Relative Benefit in Interaction

remir_us <- remir_all %>% filter(country == "USA")
## COMBINED INTERACTION AND SUBGROUP GENDER BENEFITTED
table(remir_us$inter_benefit12_gender_cat2, remir_us$subg_signif12_gender_cat,
  useNA = "always")
##         
##          Female Other <NA>
##   Female     23     2   30
##   Homog       0     0   36
##   Other       4     2    0
##   <NA>        6     8  129
tabyl(remir_us, inter_benefit12_gender_cat2, subg_signif12_gender_cat) %>% 
  adorn_percentages("all") %>% 
  adorn_pct_formatting(rounding = "half up", digits = 1)  
## Benefit Interaction only (NA for Subgroup)
remir_us %>% filter(inter_benefit12_gender_cat2 == 'Female' &
                    is.na(subg_signif12_gender_cat))  %>% count()/240
##### f. Absolute Benefit in Subgroup
remir_us %>% filter(subg_signif12_gender_cat == 'Female' &
    is.na(inter_benefit12_gender_cat2)) %>% count()/240
##### g. Benefit in Interaction & Subgroup
remir_us %>% filter( (subg_signif12_gender_cat == 'Female' & 
                      inter_benefit12_gender_cat2 == 'Female') |
                      (subg_signif12_gender_cat == 'Female' & 
                      inter_benefit12_gender_cat2 == 'Other') |
                      (inter_benefit12_gender_cat2 == 'Female' &
                      subg_signif12_gender_cat == 'Other') ) %>% count()/240
##### h. Homogenous Sample 
remir_us %>% filter(inter_benefit12_gender_cat2 == 'Homog') %>% count()/240
##### i. No Benefit Interaction or Subgroup
remir_us %>% filter(
                     (subg_signif12_gender_cat == 'Other'   &
                     inter_benefit12_gender_cat2 == 'Other') |
                     (subg_signif12_gender_cat == 'Other'   &
                      is.na(inter_benefit12_gender_cat2)) |
                    (inter_benefit12_gender_cat2 == 'Other' &
                        is.na(subg_signif12_gender_cat))) %>% count()/240
## Manually Check Percentages
12.5  ## Benefitted Females Interaction only
## [1] 12.5
2.5   ## Benefitted Females Subgroup only
## [1] 2.5
9.6+0.8+1.7   ## Benefitted Females in Interaction or Subgroup
## [1] 12.1
15.0    ## No Tests But Homogeneous Subgroup
## [1] 15
0.8+3.3 ## Benefitted Other
## [1] 4.1
53.8 ## Unclear and Did Not Examine 
## [1] 53.8
12.5+2.5+12.1+15.0+4.1+53.8 ## Sums to 100
## [1] 100

Column 6: Measured LGBTQIA+, an abbreviation for lesbian, gay, bisexual, transgender, queer or questioning, intersex, asexual, and more (terms are used to describe sexual identity)

remir_us <- remir_all %>% filter(country == "USA")

## Change Interaction Examined Variable Names
names(remir_us)[27] <- "inter_examine1_sex"
names(remir_us)[100] <- "inter_examine2_sex"
table(remir_us$inter_examine1_sex, useNA = "always")
## 
##   No  Yes <NA> 
##   40    2  198
table(remir_us$inter_examine2_sex, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Examined
remir_us$inter_examine12_sex <- ifelse(is.na(remir_us$inter_examine1_sex),
  remir_us$inter_examine2_sex, remir_us$inter_examine1_sex)
tabyl(remir_us$inter_examine12_sex)
############## What Sex interactions Were Significant ###################

## Change Interaction Significant Variable Names
names(remir_us)[28] <- "inter_signif1_sex"
names(remir_us)[101] <- "inter_signif2_sex"
table(remir_us$inter_signif1_sex, useNA = "always")
## 
## None <NA> 
##    2  238
table(remir_us$inter_signif2_sex, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Significant
remir_us$inter_signif12_sex <- ifelse(is.na(remir_us$inter_signif1_sex),
  remir_us$inter_signif2_sex, remir_us$inter_signif1_sex)
tabyl(remir_us$inter_signif12_sex)
############ What Sex Interaction Groups Benefited More ####################

## Change Interactions Benefitted Variable Names
names(remir_us)[30] <- "inter_benefit1_sex"
names(remir_us)[103] <- "inter_benefit2_sex"
table(remir_us$inter_benefit1_sex, useNA = "always")
## 
## None <NA> 
##    2  238
table(remir_us$inter_benefit2_sex, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Benefitted
remir_us$inter_benefit12_sex <- ifelse(is.na(remir_us$inter_benefit1_sex),
  remir_us$inter_benefit2_sex, remir_us$inter_benefit1_sex)
tabyl(remir_us$inter_benefit12_sex)
############# What Sex Subgroup Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_us)[59] <- "subg_examine1_sex"
names(remir_us)[104] <- "subg_examine2_sex"
table(remir_us$subg_examine1_sex, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$subg_examine2_sex, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Subgroups Examined
remir_us$subg_examine12_sex <- ifelse(is.na(remir_us$subg_examine1_sex),
  remir_us$subg_examine2_sex, remir_us$subg_examine1_sex)
tabyl(remir_us$subg_examine12_sex)
############## What Sex Subgroups Were Significant #######################

## Change Subgroup Significant Variable Names 
names(remir_us)[61] <- "subg_signif1_sex"
names(remir_us)[106] <- "subg_signif2_sex"
table(remir_us$subg_signif1_sex, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$subg_signif2_sex, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Significant
remir_us$subg_signif12_sex <- ifelse(is.na(remir_us$subg_signif1_sex),
  remir_us$subg_signif2_sex, remir_us$subg_signif1_sex)
tabyl(remir_us$subg_signif12_sex)
tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_us$examine12_sex_short <-
  ifelse(is.na(remir_us$inter_examine12_sex), 'No', 
    remir_us$inter_examine12_sex)
tabyl(remir_us$examine12_sex_short)
remir_us$inter_benefit12_sex <- ifelse(is.na(remir_us$inter_benefit1_sex),
  remir_us$inter_benefit2_sex, remir_us$inter_benefit1_sex)
tabyl(remir_us$inter_benefit12_sex)
remir_us$inter_benefit12_sex_cat <-
  ifelse(remir_us$inter_benefit12_sex == 'None' &
         remir_us$main_effect == 'Yes', 'Yes', remir_us$inter_benefit12_sex)
tabyl(remir_us$inter_benefit12_sex_cat)

I. Tested Subgroups

## COMBINED INTERACTION SUBGROUP SEX EXAMINED
table(remir_us$inter_examine12_sex, remir_us$subg_examine12_sex,
  useNA = "always")
##       
##        <NA>
##   No     40
##   Yes     2
##   <NA>  198
tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

##### a. Examined Interaction 
tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Examined Interaction only
0.8 
## [1] 0.8
##### b. Examined Subgroup
tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
.00 
## [1] 0
##### c. Examined Both

tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
.00 
## [1] 0
##### d. Homogenous Sample
tabyl(remir_us, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Examined Neither (Sums to 0.008, "Yes" to tested subgroups)
16.7+82.5 
## [1] 99.2

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

##### e. Relative Benefit in Interaction
tabyl(remir_us, inter_benefit12_sex_cat, subg_signif12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
0.8 ## Benefitted LGPT Interaction only
## [1] 0.8
##### f. Absolute Benefit in Subgroup
tabyl(remir_us, inter_benefit12_sex_cat, subg_signif12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
0 ## Benefitted LGPT Subgroup only
## [1] 0
##### g. Benefit in Interaction & Subgroup 

tabyl(remir_us, inter_benefit12_sex_cat, subg_signif12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
0 ## Benefitted LGPT Interaction and Subgroup
## [1] 0
##### h. Homogenous Sample
tabyl(remir_us, inter_benefit12_sex_cat, subg_signif12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
0 ## Benefitted non-LGPT or Neither
## [1] 0
##### i. No Benefit Interaction or Subgroup
tabyl(remir_us, inter_benefit12_sex_cat, subg_signif12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
0 ## No Homogeneous sample measure
## [1] 0
99.2 ## Did Not Examine Sex
## [1] 99.2

Column 7: Measured economic disadvantage categorized as youth that fell within the government’s poverty level as measured by different metrics, such as the percentage of students that qualified for free or reduced-price lunch (a proxy in education research for families in the U.S. that are low-income)

I. Tested Subgroups

#### REMIR ALL(N = 292) ###
############## What SES Interaction Group Were Examined ########################

## Change Interaction SES Varialbe Names 
names(remir_all)[31] <- "inter_examine1_ses"
names(remir_all)[108] <- "inter_examine2_ses"
table(remir_all$inter_examine1_ses, useNA = "always")
## 
##   No  Yes <NA> 
##   40   13  239
table(remir_all$inter_examine2_ses, useNA = "always")
## 
## Low/High     <NA> 
##       13      279
## Combine Two Tnteractions Examined
remir_all$inter_examine12_ses <- ifelse(is.na(remir_all$inter_examine1_ses),
  remir_all$inter_examine2_ses, remir_all$inter_examine1_ses)
tabyl(remir_all$inter_examine12_ses)
############## What SES Interactions Were Significant ####################

## Change Interaction Significant Variable Names
names(remir_all)[32] <- "inter_signif1_ses"
names(remir_all)[109] <- "inter_signif2_ses"
table(remir_all$inter_signif1_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        5        8      279
table(remir_all$inter_signif2_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        4        9      279
## Combine Two Tnteractions Significant
remir_all$inter_signif12_ses <- ifelse(is.na(remir_all$inter_signif1_ses),
  remir_all$inter_signif2_ses, remir_all$inter_signif1_ses)
tabyl(remir_all$inter_signif12_ses)
############ What SES Interaction Groups Benefited More ##################

## Change Interaction Benefitted Variable Names
names(remir_all)[34] <- "inter_benefit1_ses"
names(remir_all)[111] <- "inter_benefit2_ses"
table(remir_all$inter_benefit1_ses, useNA = "always")
## 
## High  Low None <NA> 
##    1    4    8  279
table(remir_all$inter_benefit2_ses, useNA = "always")
## 
##    High     Low    None Unclear    <NA> 
##       1       2       9       1     279
## Combine Two Tnteractions
remir_all$inter_benefit12_ses <- ifelse(is.na(remir_all$inter_benefit1_ses),
  remir_all$inter_benefit2_ses, remir_all$inter_benefit1_ses)
tabyl(remir_all$inter_benefit12_ses)
############# What SES Subgroups Were Examined ####################

## Change Subgroups Examined Variable Names
names(remir_all)[63] <- "subg_examine1_ses"
names(remir_all)[112] <- "subg_examine2_ses"
table(remir_all$subg_examine1_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        3        6      283
table(remir_all$subg_examine2_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        4        9      279
## Combine Two Subgroups Examined
remir_all$subg_examine12_ses <- ifelse(is.na(remir_all$subg_examine1_ses),
  remir_all$subg_examine2_ses, remir_all$subg_examine1_ses)
tabyl(remir_all$subg_examine12_ses)
############## What SES Subgroups Were Significant #########################

## Change Subgroups Significant Variable Names 
names(remir_all)[65] <- "subg_signif1_ses"
names(remir_all)[114] <- "subg_signif2_ses"
table(remir_all$subg_signif1_ses, useNA = "always")
## 
##      Low Low;High     None     <NA> 
##        5        2        2      283
table(remir_all$subg_signif2_ses, useNA = "always")
## 
##     High      Low Low;High     <NA> 
##        1        5        7      279
## Combine Two Tnteractions Significant
remir_all$subg_signif12_ses <- ifelse(is.na(remir_all$subg_signif1_ses),
  remir_all$subg_signif2_ses, remir_all$subg_signif1_ses)
tabyl(remir_all$subg_signif12_ses)
## INTERACTION SES EXAMINED
tabyl(remir_all$inter_examine12_ses)
## Change No to NA
remir_all$inter_examine12_ses_cat <- ifelse(
  remir_all$inter_examine12_ses == 'No', NA, remir_all$inter_examine12_ses)
tabyl(remir_all$inter_examine12_ses_cat)
## SUBGROUP SES EXAMINED
tabyl(remir_all$subg_examine12_ses)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_examine12_ses_cat <- ifelse(
                        (remir_all$econ_all > .75) &
                        is.na(remir_all$inter_examine12_ses_cat) & 
                        is.na(remir_all$subg_examine12_ses), 
      "Homog", remir_all$inter_examine12_ses_cat)
tabyl(remir_all$inter_examine12_ses_cat)
## INTERACTION SES BENEFITTED
tabyl(remir_all$inter_benefit12_ses)
## Simplify Codes
tabyl(remir_all, inter_benefit12_ses, inter_examine12_ses)
remir_all$inter_benefit12_ses_cat <-
  ifelse(remir_all$inter_benefit12_ses == 'None' &
         remir_all$main_effect           == 'Yes', 'Both',
  ifelse(remir_all$inter_benefit12_ses == 'None' &
         remir_all$main_effect          == 'No', 'Neither', 
          remir_all$inter_benefit12_ses))
tabyl(remir_all, inter_benefit12_ses, inter_benefit12_ses_cat)
tabyl(remir_all, inter_benefit12_ses_cat)
## Simplify further
remir_all$inter_benefit12_ses_cat2 <-
  ifelse(remir_all$inter_benefit12_ses_cat == 'Unclear', NA,
    ifelse(remir_all$inter_benefit12_ses_cat == 'Both' |
        remir_all$inter_benefit12_ses_cat == 'Low', 'Low', 
        remir_all$inter_benefit12_ses_cat))
tabyl(remir_all, inter_benefit12_ses_cat, inter_benefit12_ses_cat2)
tabyl(remir_all, inter_benefit12_ses_cat2)
## SUBGROUP SES BENEFITTED
tabyl(remir_all$subg_signif12_ses)
## Simplify
remir_all$subg_signif12_ses_cat <-
  ifelse(remir_all$subg_signif12_ses == 'High' |
      remir_all$subg_signif12_ses == 'None', 'Other',
    ifelse(remir_all$subg_signif12_ses == 'Low' |
        remir_all$subg_signif12_ses == 'Low;High', 'Low',
      remir_all$subg_signif12_ses))
tabyl(remir_all, subg_signif12_ses, subg_signif12_ses_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_benefit12_ses_cat2 <- ifelse(
                        (remir_all$econ_all > .75) &
                        is.na(remir_all$inter_benefit12_ses_cat2) &
                        is.na(remir_all$subg_signif12_ses_cat), 
      "Homog", remir_all$inter_benefit12_ses_cat2)
tabyl(remir_all$inter_benefit12_ses_cat2)
## Change Interaction SES Variable Names 
names(remir_us)[31] <- "inter_examine1_ses"
names(remir_us)[108] <- "inter_examine2_ses"
table(remir_us$inter_examine1_ses, useNA = "always")
## 
##   No  Yes <NA> 
##   32   10  198
table(remir_us$inter_examine2_ses, useNA = "always")
## 
## Low/High     <NA> 
##       10      230
## Combine Two Interactions Examined
remir_us$inter_examine12_ses <- ifelse(is.na(remir_us$inter_examine1_ses),
  remir_us$inter_examine2_ses, remir_us$inter_examine1_ses)
print(tabyl(remir_us$inter_examine12_ses))
##  remir_us$inter_examine12_ses   n    percent valid_percent
##                      Low/High  10 0.04166667     0.1923077
##                            No  32 0.13333333     0.6153846
##                           Yes  10 0.04166667     0.1923077
##                          <NA> 188 0.78333333            NA
## Change Interaction Significant Variable Names
names(remir_us)[32] <- "inter_signif1_ses"
names(remir_us)[109] <- "inter_signif2_ses"
table(remir_us$inter_signif1_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        5        5      230
table(remir_us$inter_signif2_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        4        6      230
## Change Subgroups Significant Variable Names 
names(remir_us)[65] <- "subg_signif1_ses"
names(remir_us)[114] <- "subg_signif2_ses"
table(remir_us$subg_signif1_ses, useNA = "always")
## 
##      Low Low;High     None     <NA> 
##        5        2        1      232
table(remir_us$subg_signif2_ses, useNA = "always")
## 
##     High      Low Low;High     <NA> 
##        1        3        6      230
## Combine Two Interactions Significant
remir_us$inter_signif12_ses <- ifelse(is.na(remir_us$inter_signif1_ses),
  remir_us$inter_signif2_ses, remir_us$inter_signif1_ses)
print(tabyl(remir_us$inter_signif12_ses))
##  remir_us$inter_signif12_ses   n    percent valid_percent
##                     Low/High   9 0.03750000          0.45
##                         None  11 0.04583333          0.55
##                         <NA> 220 0.91666667            NA
## Combine Two Interactions Significant
remir_us$subg_signif12_ses <- ifelse(is.na(remir_us$subg_signif1_ses),
  remir_us$subg_signif2_ses, remir_us$subg_signif1_ses)
print(tabyl(remir_us$subg_signif12_ses))
##  remir_us$subg_signif12_ses   n     percent valid_percent
##                        High   1 0.004166667    0.05555556
##                         Low   8 0.033333333    0.44444444
##                    Low;High   8 0.033333333    0.44444444
##                        None   1 0.004166667    0.05555556
##                        <NA> 222 0.925000000            NA
## Simplify subg_signif12_ses
remir_us$subg_signif12_ses_cat <- ifelse(remir_us$subg_signif12_ses == 'High' | 
  remir_us$subg_signif12_ses == 'None', 'Other', 
  ifelse(remir_us$subg_signif12_ses == 'Low' | 
    remir_us$subg_signif12_ses == 'Low;High', 'Low', 
    remir_us$subg_signif12_ses))
print(tabyl(remir_us, subg_signif12_ses, subg_signif12_ses_cat))
##  subg_signif12_ses Low Other NA_
##               High   0     1   0
##                Low   8     0   0
##           Low;High   8     0   0
##               None   0     1   0
##               <NA>   0     0 222
## Change Interaction Benefitted Variable Names
names(remir_us)[34] <- "inter_benefit1_ses"
names(remir_us)[111] <- "inter_benefit2_ses"
table(remir_us$inter_benefit1_ses, useNA = "always")
## 
## High  Low None <NA> 
##    1    4    5  230
table(remir_us$inter_benefit2_ses, useNA = "always")
## 
##    High     Low    None Unclear    <NA> 
##       1       2       6       1     230
## Combine Two Interactions Benefitted
remir_us$inter_benefit12_ses <- ifelse(is.na(remir_us$inter_benefit1_ses),
  remir_us$inter_benefit2_ses, remir_us$inter_benefit1_ses)
print(tabyl(remir_us$inter_benefit12_ses))
##  remir_us$inter_benefit12_ses   n     percent valid_percent
##                          High   2 0.008333333          0.10
##                           Low   6 0.025000000          0.30
##                          None  11 0.045833333          0.55
##                       Unclear   1 0.004166667          0.05
##                          <NA> 220 0.916666667            NA
## Change Subgroups Examined Variable Names
names(remir_us)[63] <- "subg_examine1_ses"
names(remir_us)[112] <- "subg_examine2_ses"
table(remir_us$subg_examine1_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        2        6      232
table(remir_us$subg_examine2_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        2        8      230
## Combine Two Subgroups Examined
remir_us$subg_examine12_ses <- ifelse(is.na(remir_us$subg_examine1_ses),
  remir_us$subg_examine2_ses, remir_us$subg_examine1_ses)
print(tabyl(remir_us$subg_examine12_ses))
##  remir_us$subg_examine12_ses   n    percent valid_percent
##                          Low   4 0.01666667     0.2222222
##                     Low;High  14 0.05833333     0.7777778
##                         <NA> 222 0.92500000            NA
## Change Subgroups Significant Variable Names 
names(remir_us)[65] <- "subg_signif1_ses"
names(remir_us)[114] <- "subg_signif2_ses"
table(remir_us$subg_signif1_ses, useNA = "always")
## 
##      Low Low;High     None     <NA> 
##        5        2        1      232
table(remir_us$subg_signif2_ses, useNA = "always")
## 
##     High      Low Low;High     <NA> 
##        1        3        6      230
## Interactions Examined SES Category
remir_us$inter_examine12_ses_cat <- ifelse(
  remir_us$inter_examine12_ses == 'No', NA, remir_us$inter_examine12_ses)
print(tabyl(remir_us$inter_examine12_ses_cat))
##  remir_us$inter_examine12_ses_cat   n    percent valid_percent
##                          Low/High  10 0.04166667           0.5
##                               Yes  10 0.04166667           0.5
##                              <NA> 220 0.91666667            NA
## Combine Interaction and Subgroup SES
print(tabyl(remir_us, inter_examine12_ses_cat, subg_examine12_ses) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1))
##  inter_examine12_ses_cat  Low Low;High   NA_
##                 Low/High 0.8%     3.3%  0.0%
##                      Yes 0.0%     0.0%  4.2%
##                     <NA> 0.8%     2.5% 88.3%
## Simplify examine12_ses
remir_us$examine12_ses_short <- ifelse(
  is.na(remir_us$inter_examine12_ses_cat) & is.na(remir_us$subg_examine12_ses), 'None',
  ifelse(remir_us$inter_examine12_ses_cat == 'Homog', 'Homog', 'Yes'))
print(tabyl(remir_us$examine12_ses_short))
##  remir_us$examine12_ses_short   n    percent valid_percent
##                          None 212 0.88333333     0.9137931
##                           Yes  20 0.08333333     0.0862069
##                          <NA>   8 0.03333333            NA
## Fix remaining NAs
remir_us$examine12_ses_short <- ifelse(
  is.na(remir_us$examine12_ses_short), 'Yes', remir_us$examine12_ses_short)
print(tabyl(remir_us$examine12_ses_short))
##  remir_us$examine12_ses_short   n   percent
##                          None 212 0.8833333
##                           Yes  28 0.1166667
## Interactions Benefitted SES
print(tabyl(remir_us, inter_benefit12_ses, inter_examine12_ses))
##  inter_benefit12_ses Low/High No Yes NA_
##                 High        1  0   1   0
##                  Low        2  0   4   0
##                 None        6  0   5   0
##              Unclear        1  0   0   0
##                 <NA>        0 32   0 188
remir_us$inter_benefit12_ses_cat <- ifelse(remir_us$inter_benefit12_ses == 'None' & 
  remir_us$main_effect == 'Yes', 'Both', 
  ifelse(remir_us$inter_benefit12_ses == 'None' & 
    remir_us$main_effect == 'No', 'Neither', 
    remir_us$inter_benefit12_ses))
print(tabyl(remir_us, inter_benefit12_ses, inter_benefit12_ses_cat))
##  inter_benefit12_ses Both High Low Unclear NA_
##                 High    0    2   0       0   0
##                  Low    0    0   6       0   0
##                 None   11    0   0       0   0
##              Unclear    0    0   0       1   0
##                 <NA>    0    0   0       0 220
## Subgroup SES Benefitted
print(tabyl(remir_us$subg_signif12_ses))
##  remir_us$subg_signif12_ses   n     percent valid_percent
##                        High   1 0.004166667    0.05555556
##                         Low   8 0.033333333    0.44444444
##                    Low;High   8 0.033333333    0.44444444
##                        None   1 0.004166667    0.05555556
##                        <NA> 222 0.925000000            NA
## Separate Out Homogeneous Sample
remir_us$inter_benefit12_ses_cat <- ifelse(
  (remir_us$econ_all > .75) & is.na(remir_us$inter_benefit12_ses_cat) & 
  is.na(remir_us$subg_signif12_ses), "Homog", remir_us$inter_benefit12_ses_cat)
print(tabyl(remir_us$inter_benefit12_ses_cat))
##  remir_us$inter_benefit12_ses_cat   n     percent valid_percent
##                              Both  11 0.045833333    0.18644068
##                              High   2 0.008333333    0.03389831
##                             Homog  39 0.162500000    0.66101695
##                               Low   6 0.025000000    0.10169492
##                           Unclear   1 0.004166667    0.01694915
##                              <NA> 181 0.754166667            NA

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

## INTERACTION SES EXAMINED
tabyl(remir_us$inter_examine12_ses)
## Change No to NA
remir_us$inter_examine12_ses_cat <- ifelse(
  remir_us$inter_examine12_ses == 'No', NA, remir_us$inter_examine12_ses)
tabyl(remir_us$inter_examine12_ses_cat)
## SUBGROUP SES EXAMINED
tabyl(remir_us$subg_examine12_ses)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_us$inter_examine12_ses_cat <- ifelse(
                        (remir_us$econ_all > .75) &
                        is.na(remir_us$inter_examine12_ses_cat) & 
                        is.na(remir_us$subg_examine12_ses), 
      "Homog", remir_us$inter_examine12_ses_cat)
tabyl(remir_us$inter_examine12_ses_cat)
########  COMPUTE EXAMINED PROPORTIONS FOR LOW SES ######

## COMBINED INTERACTION AND SUBGROUP SES EXAMINED
table(remir_us$inter_examine12_ses_cat, remir_us$subg_examine12_ses,
  useNA = "always")
##           
##            Low Low;High <NA>
##   Homog      0        0   39
##   Low/High   2        8    0
##   Yes        0        0   10
##   <NA>       2        6  173
tabyl(remir_us, inter_examine12_ses_cat, subg_examine12_ses) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

## Examined SES Interaction only (NA for Subgroup)
remir_us %>% filter( (inter_examine12_ses_cat == 'Low/High' |
               inter_examine12_ses_cat == 'Yes') &
                (is.na(subg_examine12_ses))) %>% count()/240
## Examined SES Subgroup only (NA for Interaction)
remir_us %>% filter( (subg_examine12_ses == 'Low;High' |
               subg_examine12_ses == 'Low') &
                (is.na(inter_examine12_ses_cat))) %>% count()/240
## Examined SES Interaction and Subgroup
remir_us %>% filter( (subg_examine12_ses == 'Low;High' |
               subg_examine12_ses == 'Low') &
              (inter_examine12_ses_cat == 'Low/High' |
               inter_examine12_ses_cat == 'Yes')) %>% count()/240
## No Tests but Homogeneous Sample
remir_us %>% filter(inter_examine12_ses_cat == 'Homog') %>% count()/240
## Did Not Examine SES, including NA 
remir_us %>% filter(
                    (is.na(subg_examine12_ses) &
                     is.na(inter_examine12_ses_cat))) %>% count()/240
## Manually Check SES Percentages 
0.0+4.2 ## Examined Interaction only
## [1] 4.2
0.8+2.5 ## Examined Subgroup only
## [1] 3.3
0.8+3.3 ## Examined Interaction and Subgroup
## [1] 4.1
16.3 ## No Tests but Homogeneous Sample
## [1] 16.3
72.1 ## Examined Neither
## [1] 72.1
4.2+3.3+4.1+16.3+72.1 ## Sums to 100
## [1] 100
######   COMPUTE BENEFITED  PROPORTIONS FOR LOW SES ######

## COMBINE INTERACTION AND SUBGROUP SES BENEFITTED
tabyl(remir_us, inter_benefit12_ses_cat, subg_signif12_ses_cat)
tabyl(remir_us, inter_benefit12_ses_cat, subg_signif12_ses_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
##  PANEL III, COLUMN 7, TABLE 2: BENEFITTED LOW SES

remir_us <- remir_all %>% filter(country == "USA")
## Benefit Interaction only (NA for Subgroup)
remir_us %>% filter(inter_benefit12_ses_cat2 == 'Low' &
                    is.na(subg_signif12_ses_cat))  %>% count()/240
## Benefit Subgroup only (NA for Interaction)
remir_us %>% filter(subg_signif12_ses_cat == 'Low' &
    is.na(inter_benefit12_ses_cat2)) %>% count()/240
## Benefit Interaction and Subgroup 
remir_us %>% filter( (subg_signif12_ses_cat == 'Low' & 
                      inter_benefit12_ses_cat2 == 'Low') |
                      (subg_signif12_ses_cat == 'Low' & 
                      inter_benefit12_ses_cat2 == 'High') |
                      (inter_benefit12_ses_cat2 == 'Low' &
                      subg_signif12_ses_cat == 'Other') ) %>% count()/240
## No Tests but Homogeneous Sample
remir_us %>% filter(inter_benefit12_ses_cat2 == 'Homog') %>% count()/240
## Benefit Other
remir_us %>% filter(
                     (subg_signif12_ses_cat == 'Other'   &
                     inter_benefit12_ses_cat2 == 'High') |
                     (subg_signif12_ses_cat == 'Other'   &
                      is.na(inter_benefit12_ses_cat2)) |
                    (inter_benefit12_ses_cat2 == 'High' &
                        is.na(subg_signif12_ses_cat))) %>% count()/240
## Did Not Examine SES 
remir_us %>% filter(is.na(subg_signif12_ses_cat) &
                     is.na(inter_benefit12_ses_cat2)) %>% count()/240
## Manually check Percentages
3.8 ## Benefitted Low SES Interaction only
## [1] 3.8
3.3 ## Benefitted Low SES Subgroup only
## [1] 3.3
2.9+0.4+0.4## Benefitted Low SES Interaction and Subgroup
## [1] 3.7
16.3  ## No tests But Homogeneous Sample
## [1] 16.3
0.4+0.4 ## Did Not Benefit Low SES 
## [1] 0.8
72.1 ## Did Not Examine Low SES 
## [1] 72.1
3.8+3.3+3.7+16.3+0.8+72.1 ## Sums to 100
## [1] 100
#######################################################################
############## PREPARE SES CODES FOR TABLE 2 ########################
#######################################################################

############## What SES Interaction Group Were Examined ########################

## COMBINED INTERACTION AND SUBGROUP SES EXAMINED
table(remir_us$inter_examine12_ses_cat, remir_us$subg_examine12_ses,
  useNA = "always")
##           
##            Low Low;High <NA>
##   Homog      0        0   39
##   Low/High   2        8    0
##   Yes        0        0   10
##   <NA>       2        6  173
tabyl(remir_us, inter_examine12_ses_cat, subg_examine12_ses) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Compute Percentages for Four Categories
0.0+4.2 ## Examined Interaction only
## [1] 4.2
0.8+2.5 ## Examined Subgroup only
## [1] 3.3
0.8+3.3 ## Examined Interaction and Subgroup
## [1] 4.1
16.3 ## No Tests but Homogeneous Sample
## [1] 16.3
72.1 ## Examined Neither
## [1] 72.1
4.2+3.3+4.1+16.3+72.1 ## Sums to 100
## [1] 100
####################### Table 2. Which Groups Benefitted ###############

## INTERACTION SES BENEFITTED
tabyl(remir_us$inter_benefit12_ses)
## Simplify Codes
tabyl(remir_us, inter_benefit12_ses, inter_examine12_ses)
remir_us$inter_benefit12_ses_cat <-
  ifelse(remir_us$inter_benefit12_ses == 'None' &
         remir_us$main_effect           == 'Yes', 'Both',
  ifelse(remir_us$inter_benefit12_ses == 'None' &
         remir_us$main_effect          == 'No', 'Neither', 
          remir_us$inter_benefit12_ses))
tabyl(remir_us, inter_benefit12_ses, inter_benefit12_ses_cat)
## SUBGROUP SES BENEFITTED
tabyl(remir_us$subg_signif12_ses)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_us$inter_benefit12_ses_cat <- ifelse(
                        (remir_us$econ_all > .75) &
                        is.na(remir_us$inter_benefit12_ses_cat) &
                        is.na(remir_us$subg_signif12_ses), 
      "Homog", remir_us$inter_benefit12_ses_cat)
tabyl(remir_us$inter_benefit12_ses_cat)
## COMBINE INTERACTION AND SUBGROUP SES BENEFITTED
tabyl(remir_us, inter_benefit12_ses_cat, subg_signif12_ses)
tabyl(remir_us, inter_benefit12_ses_cat, subg_signif12_ses) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
2.1+1.7 ## Benefitted Low SES Interaction only
## [1] 3.8
2.1+0.8+0.4 ## Benefitted Low SES Subgroup only
## [1] 3.3
0.4+0.8+1.7 ## Benefitted Low SES Interaction and Subgroup
## [1] 2.9
16.3  ## No tests But Homogeneous Sample
## [1] 16.3
0.4+0.4+0.4+0.4 ## Did Not Benefit Low SES 
## [1] 1.6
72.1 ## Did Not Examine Low SES 
## [1] 72.1
3.8+2.9+3.3+16.3+1.6+72.1 ## Sums to 100
## [1] 100

Column 8: Measured location (urban or rural)

I. Tested Subgroups

## Change Interaction Examined Variable Names
names(remir_all)[36] <- "inter_examine1_loc"
names(remir_all)[116] <- "inter_examine2_loc"
table(remir_all$inter_examine1_loc, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$inter_examine2_loc, useNA = "always")
## 
## Urban/Non-Urban            <NA> 
##               2             290
## Combine Two Tnteractions Examined
remir_all$inter_examine12_loc <- ifelse(is.na(remir_all$inter_examine1_loc),
  remir_all$inter_examine2_loc, remir_all$inter_examine1_loc)
tabyl(remir_all$inter_examine12_loc)
## Change Interaction Examined Variable Names
names(remir_all)[36] <- "inter_examine1_loc"
names(remir_all)[116] <- "inter_examine2_loc"
table(remir_all$inter_examine1_loc, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$inter_examine2_loc, useNA = "always")
## 
## Urban/Non-Urban            <NA> 
##               2             290
## Combine Two Tnteractions Examined
remir_all$inter_examine12_loc <- ifelse(is.na(remir_all$inter_examine1_loc),
  remir_all$inter_examine2_loc, remir_all$inter_examine1_loc)
tabyl(remir_all$inter_examine12_loc)
## Change Interaction Examined Variable Names
names(remir_us)[36] <- "inter_examine1_loc"
names(remir_us)[116] <- "inter_examine2_loc"
table(remir_us$inter_examine1_loc, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$inter_examine2_loc, useNA = "always")
## 
## Urban/Non-Urban            <NA> 
##               2             238
## Combine Two Tnteractions Examined
remir_us$inter_examine12_loc <- ifelse(is.na(remir_us$inter_examine1_loc),
  remir_us$inter_examine2_loc, remir_us$inter_examine1_loc)
tabyl(remir_us$inter_examine12_loc)
############ What Location Interactions Were Significant ################

## Change Interaction Significant Variable Names
names(remir_us)[37] <- "inter_signif1_loc"
names(remir_us)[117] <- "inter_signif2_loc"
table(remir_us$inter_signif1_loc, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$inter_signif2_loc, useNA = "always")
## 
## None <NA> 
##    2  238
## Combine Two Tnteractions Significant
remir_us$inter_signif12_loc <- ifelse(is.na(remir_us$inter_signif1_loc),
  remir_us$inter_signif2_loc, remir_us$inter_signif1_loc)
tabyl(remir_us$inter_signif12_loc)
############ What Location Interaction Groups Benefited More #############

## Change Interaction Benefitted Variable Names
names(remir_us)[39] <- "inter_benefit1_loc"
names(remir_us)[119] <- "inter_benefit2_loc"
table(remir_us$inter_benefit1_loc, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$inter_benefit2_loc, useNA = "always")
## 
## None <NA> 
##    2  238
remir_us$inter_benefit12_loc <- ifelse(is.na(remir_us$inter_benefit1_loc),
  remir_us$inter_benefit2_loc, remir_us$inter_benefit1_loc)
tabyl(remir_us$inter_benefit12_loc)
############# What Location Subgroups Were Examined ####################
## Change Subgroup Examined Variable Names
names(remir_all)[67] <- "subg_examine1_loc"
names(remir_all)[120] <- "subg_examine2_loc"
table(remir_all$subg_examine1_loc, useNA = "always")
## 
## Rural  <NA> 
##     2   290
table(remir_all$subg_examine2_loc, useNA = "always")
## 
## Urban;Non-Urban            <NA> 
##               2             290
## Combine Two Subgroups Examined
remir_all$subg_examine12_loc <- ifelse(is.na(remir_all$subg_examine1_loc),
  remir_all$subg_examine2_loc, remir_all$subg_examine1_loc)
tabyl(remir_all$subg_examine12_loc)
## Change Subgroup Examined Variable Names
names(remir_us)[67] <- "subg_examine1_loc"
names(remir_us)[120] <- "subg_examine2_loc"
table(remir_us$subg_examine1_loc, useNA = "always")
## 
## Rural  <NA> 
##     2   238
table(remir_us$subg_examine2_loc, useNA = "always")
## 
## Urban;Non-Urban            <NA> 
##               2             238
## Combine Two Subgroups Examined
remir_us$subg_examine12_loc <- ifelse(is.na(remir_us$subg_examine1_loc),
  remir_us$subg_examine2_loc, remir_us$subg_examine1_loc)
tabyl(remir_us$subg_examine12_loc)
############## What Location Subgroups Were Significant ####################

## Change Subgroup Significant Variable Names 
names(remir_us)[69] <- "subg_signif1_loc"
names(remir_us)[122] <- "subg_signif2_loc"
table(remir_us$subg_signif1_loc, useNA = "always")
## 
## Rural  <NA> 
##     2   238
table(remir_us$subg_signif2_loc, useNA = "always")
## 
##            None Urban;Non-Urban            <NA> 
##               1               1             238
## Combine Two Tnteractions Significant
remir_us$subg_signif12_loc <- ifelse(is.na(remir_us$subg_signif1_loc),
  remir_us$subg_signif2_loc, remir_us$subg_signif1_loc)
tabyl(remir_us$subg_signif12_loc)
tabyl(remir_all, inter_examine12_loc, subg_examine12_loc) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_loc_short <-
  ifelse(is.na(remir_all$inter_examine12_loc) & 
         is.na(remir_all$subg_examine12_loc), 'None',
  ifelse(remir_all$inter_examine12_loc == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_loc_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_loc_short <- ifelse(
  is.na(remir_all$examine12_loc_short), 'Yes', remir_all$examine12_loc_short)
tabyl(remir_all$examine12_loc_short)
# US
tabyl(remir_us, inter_examine12_loc, subg_examine12_loc) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_us$examine12_loc_short <-
  ifelse(is.na(remir_us$inter_examine12_loc) & 
         is.na(remir_us$subg_examine12_loc), 'None',
  ifelse(remir_us$inter_examine12_loc == 'Homog', 'Homog', 'Yes'))
tabyl(remir_us$examine12_loc_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_us$examine12_loc_short <- ifelse(
  is.na(remir_us$examine12_loc_short), 'Yes', remir_us$examine12_loc_short)
tabyl(remir_us$examine12_loc_short)

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?*

## INTERACTION LOCATION EXAMINED
tabyl(remir_us$inter_examine12_loc)
## SUBGROUP LOCATION EXAMINED
tabyl(remir_us$subg_examine12_loc)
## SEPARATE OUT HOMOGENEOUS SAMPLE
## No measure of sample proportion for urban or rural

## COMBINE INTERACTION AND SUBGROUP LOCATION EXAMINED
table(remir_us$inter_examine12_loc, remir_us$subg_examine12_loc,
  useNA = "always")
##                  
##                   Rural Urban;Non-Urban <NA>
##   Urban/Non-Urban     0               2    0
##   <NA>                2               0  236
tabyl(remir_us, inter_examine12_loc, subg_examine12_loc) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Compute Percentages for Four Categories
0 ## Examined Interaction only
## [1] 0
0.8 ## Examined Subgroup only
## [1] 0.8
0.8 ## Examined Interaction and Subgroup
## [1] 0.8
98.3 ## Examined Neither
## [1] 98.3
0.8+0.8+98.3 ## Sums to 99.9
## [1] 99.9

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

## INTERACTION LOCATION BENEFITTED
tabyl(remir_us$inter_benefit12_loc)
## SUBGROUP LOCATION BENEFITTED
tabyl(remir_us$subg_signif12_loc)
## COMBINE INTERACTION AND SUBGROUP LOCATION BENEFITTED
tabyl(remir_us, inter_benefit12_loc, subg_signif12_loc) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
## Compute Percentages Benefit Rural or Urban
0.0 ## Interaction only
## [1] 0
0.8 ## Subgroup Only
## [1] 0.8
0.4 ## Interaction and Subgroup
## [1] 0.4
0.4  ## Neither
## [1] 0.4
98.3  ## Not examained
## [1] 98.3

Column 9: Measured nativity status (i.e., foreign-born in the country where the study was conducted).

I. Tested Subgroups

#What Nativity Interaction Groups Were Examined

## Change Interaction Nativity Variable Names
names(remir_us)[41] <- "inter_examine1_nat"
names(remir_us)[124] <- "inter_examine2_nat"
table(remir_us$inter_examine1_nat, useNA = "always")
## 
## Immigrant/Nonimmigrant                   <NA> 
##                      1                    239
table(remir_us$inter_examine2_nat, useNA = "always")
## 
## <NA> 
##  240
## Change Interaction Nativity Variable Names
names(remir_all)[41] <- "inter_examine1_nat"
names(remir_all)[124] <- "inter_examine2_nat"
table(remir_all$inter_examine1_nat, useNA = "always")
## 
## Immigrant/Nonimmigrant                   <NA> 
##                      1                    291
table(remir_all$inter_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Examined

remir_all$inter_examine12_nat <- ifelse(is.na(remir_all$inter_examine1_nat),
  remir_all$inter_examine2_nat, remir_all$inter_examine1_nat)
tabyl(remir_all$inter_examine12_nat)
remir_us$inter_examine12_nat <- ifelse(is.na(remir_us$inter_examine1_nat),
  remir_us$inter_examine2_nat, remir_us$inter_examine1_nat)
tabyl(remir_us$inter_examine12_nat)
############## What Nativity Interactions Were Significant ##############################

## Change Interaction Significant Variable Names 
names(remir_us)[42] <- "inter_signif1_nat"
names(remir_us)[125] <- "inter_signif2_nat"
table(remir_us$inter_signif1_nat, useNA = "always")
## 
## None <NA> 
##    1  239
table(remir_us$inter_signif2_nat, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Significant
remir_us$inter_signif12_nat <- ifelse(is.na(remir_us$inter_signif1_nat),
  remir_us$inter_signif2_nat, remir_us$inter_signif1_nat)
tabyl(remir_us$inter_signif12_nat)
############## What Nativity Interaction Groups Benefited More ##############################

## Change Interaction Benfitted Variable Names
names(remir_us)[44] <- "inter_benefit1_nat"
names(remir_us)[127] <- "inter_benefit2_nat"
table(remir_us$inter_benefit1_nat, useNA = "always")
## 
## None <NA> 
##    1  239
table(remir_us$inter_benefit2_nat, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions
remir_us$inter_benefit12_nat <- ifelse(is.na(remir_us$inter_benefit1_nat),
  remir_us$inter_benefit2_nat, remir_us$inter_benefit1_nat)
tabyl(remir_us$inter_benefit12_nat)
############# What Nativity Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_us)[71] <- "subg_examine1_nat"
names(remir_us)[128] <- "subg_examine2_nat"
table(remir_us$subg_examine1_nat, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$subg_examine2_nat, useNA = "always")
## 
## <NA> 
##  240
names(remir_all)[71] <- "subg_examine1_nat"
names(remir_all)[128] <- "subg_examine2_nat"
table(remir_all$subg_examine1_nat, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Subgroups Examined
remir_us$subg_examine12_nat <- ifelse(is.na(remir_us$subg_examine1_nat),
  remir_us$subg_examine2_nat, remir_us$subg_examine1_nat)
tabyl(remir_us$subg_examine12_nat)
remir_all$subg_examine12_nat <- ifelse(is.na(remir_all$subg_examine1_nat),
  remir_all$subg_examine2_nat, remir_all$subg_examine1_nat)
tabyl(remir_all$subg_examine12_nat)
############## What Nativity Subgroups Were Significant ##############################

## Change Subgroup Significant Variable Names 
names(remir_us)[73] <- "subg_signif1_nat"
names(remir_us)[130] <- "subg_signif2_nat"
table(remir_us$subg_signif1_nat, useNA = "always")
## 
## <NA> 
##  240
table(remir_us$subg_signif2_nat, useNA = "always")
## 
## <NA> 
##  240
## Combine Two Tnteractions Significant
remir_us$subg_signif12_nat <- ifelse(is.na(remir_us$subg_signif1_nat),
  remir_us$subg_signif2_nat, remir_us$subg_signif1_nat)
tabyl(remir_us$subg_signif12_nat)
tabyl(remir_all, inter_examine12_nat, subg_examine12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_nat_short <-
  ifelse(is.na(remir_all$inter_examine12_nat) & 
         is.na(remir_all$subg_examine12_nat), 'None',
  ifelse(remir_all$inter_examine12_nat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_nat_short)

II. RQ 2: How often did evaluation studies of EBPIs test for differences in program effects by race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

## INTERACTION NATIVITY EXAMINED
tabyl(remir_us$inter_examine12_nat)
## SUBGROUP NATIVITY EXAMINED
tabyl(remir_us$subg_examine12_nat)
## COMBINE INTERACTION AND SUBGROUP NATIVITY EXAMINED
table(remir_us$inter_examine12_nat, remir_us$subg_examine12_nat,
  useNA = "always")
##                         
##                          <NA>
##   Immigrant/Nonimmigrant    1
##   <NA>                    239
tabyl(remir_us, inter_examine12_nat, subg_examine12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 0)
## Compute Percentages for Four Categories
0 ## Examined Interaction only
## [1] 0
0 ## Examined Subgroup only
## [1] 0
0 ## Examined Interaction and Subgroup
## [1] 0
100 ## Examined Neither
## [1] 100

III. RQ 3: How prevalent were evaluation studies of EBPIs showing beneficial effects for race, ethnicity, gender, sexual identity, economic disadvantages, location (urban, rural, suburban) and nativity subgroups?

## INTERACTION NATIVITY BENEFITTED
tabyl(remir_us$inter_benefit12_nat)
## SUBGROUP NATIVITY BENEFITTED
tabyl(remir_us$subg_signif12_nat)
## COMBINE INTERACTION AND SUBGROUP NATIVITY BENEFITTED
tabyl(remir_us, inter_benefit12_nat, subg_signif12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 0)
## No culturally tailored programs

## Create Short Variable for Examined with Three categories
tabyl(remir_us, inter_examine12_nat, subg_examine12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_us$examine12_nat_short <-
  ifelse(is.na(remir_us$inter_examine12_nat) & 
         is.na(remir_us$subg_examine12_nat), 'None',
  ifelse(remir_us$inter_examine12_nat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_us$examine12_nat_short)

VI. Online Supplemental Table 1: Ns and Proportions for Characteristics of Sample EBPI Evaluation Reports

# About Online Supplemental Table 1: Ns and Proportions for Characteristics of Sample EBPI Evaluation Reports 

## Note: EBPI – Evidence-Based Preventive Intervention 

## a Tested for one or more of the following subgroups: race, ethnicity, gender, sexual identity, economic disadvantage, location (rural, urban, suburban), nativity status (foreign-born – yes/no). 

## b Proportions add to more than 1.0, as EBPIs may target multiple groups and multiple outcomes.

Column 1. Full: U.S. and non-U.S. reports (N = 292, Online Supplement Table 1)

# Design (1 = Cluster randomized control trial (c-RCT), 2 = Quasi-experimental design (QED), 3 = Randomized control trial (RCT))
remir_all$design <- factor(remir_all$design, levels = c(1, 2, 3), 
                           labels = c("Cluster randomized control trial (c-RCT)", 
                                      "Quasi-experimental design (QED)", 
                                      "Randomized control trial (RCT)"))
tabyl(remir_all, design)
# Article published in an academic journal
tabyl(remir_all, "published") 
# Is this program certified by Blueprints Healthy Youth Development?
tabyl(remir_all, "Certified.")
# Primary age group targeted
age_group_table <- data.frame(
  Age_Group = c(
    "Infant (ages 0-2 years)",
    "Preschool (ages 3-4 years)",
    "Elementary school (ages 5-11 years)",
    "Middle school (ages 12-14 years)",
    "High school (ages 15-18 years)",
    "Young adult (ages 19-24 years)",
    "Adult"
  ),
  Frequency = c(
    sum(remir_all$age_infant, na.rm = TRUE),
    sum(remir_all$age_preschool, na.rm = TRUE),
    sum(remir_all$age_elementary, na.rm = TRUE),
    sum(remir_all$age_middle, na.rm = TRUE),
    sum(remir_all$age_high, na.rm = TRUE),
    sum(remir_all$age_youngadult, na.rm = TRUE),
    sum(remir_all$age_adult, na.rm = TRUE)
  )
)
total_participants <- sum(age_group_table$Frequency)
age_group_table <- age_group_table %>%
  mutate(Proportion = round(Frequency / 292, 2))
print(age_group_table)
##                             Age_Group Frequency Proportion
## 1             Infant (ages 0-2 years)        12       0.04
## 2          Preschool (ages 3-4 years)        35       0.12
## 3 Elementary school (ages 5-11 years)        98       0.34
## 4    Middle school (ages 12-14 years)       114       0.39
## 5      High school (ages 15-18 years)       138       0.47
## 6      Young adult (ages 19-24 years)        73       0.25
## 7                               Adult        15       0.05
## Place
place_table <- data.frame(
  Place = c(
    "Community",
    "Correctional facility",
    "Home",
    "Medical setting",
    "Online",
    "School",
    "Service setting"
  ),
  Frequency = c(
    sum(remir_all$pl_comm, na.rm = TRUE),
    sum(remir_all$pl_corr, na.rm = TRUE),
    sum(remir_all$pl_home, na.rm = TRUE),
    sum(remir_all$pl_med, na.rm = TRUE),
    sum(remir_all$pl_online, na.rm = TRUE),
    sum(remir_all$pl_school, na.rm = TRUE),
    sum(remir_all$pl_service, na.rm = TRUE)
  )
)
place_table <- place_table %>%
  mutate(Proportion = round(Frequency / 292, 2))
print(place_table)
##                   Place Frequency Proportion
## 1             Community        40       0.14
## 2 Correctional facility        12       0.04
## 3                  Home        27       0.09
## 4       Medical setting        19       0.07
## 5                Online        12       0.04
## 6                School       174       0.60
## 7       Service setting         8       0.03
## Outcome
outcome_table <- data.frame(
  Outcome = c(
    "Adult outcomes",
    "Educational outcomes",
    "Emotional outcomes",
    "Physical outcomes",
    "Positive relationship outcomes",
    "Problem behavior outcomes"
  ),
  Frequency = c(
    sum(remir_all$out_adult, na.rm = TRUE),
    sum(remir_all$out_educ, na.rm = TRUE),
    sum(remir_all$out_emot, na.rm = TRUE),
    sum(remir_all$out_phys, na.rm = TRUE),
    sum(remir_all$out_posrel, na.rm = TRUE),
    sum(remir_all$out_problem, na.rm = TRUE)
  )
)
outcome_table <- outcome_table %>%
  mutate(Proportion = round(Frequency / 292, 2))
print(outcome_table)
##                          Outcome Frequency Proportion
## 1                 Adult outcomes        12       0.04
## 2           Educational outcomes       105       0.36
## 3             Emotional outcomes        43       0.15
## 4              Physical outcomes         7       0.02
## 5 Positive relationship outcomes         7       0.02
## 6      Problem behavior outcomes       156       0.53

Column 2. Analysis: U.S. Reports (N = 240; Online Supplement Table 1)

# Design (1 = Cluster randomized control trial (c-RCT), 2 = Quasi-experimental design (QED), 3 = Randomized control trial (RCT))
remir_us$design <- factor(remir_us$design, levels = c(1, 2, 3), 
                           labels = c("Cluster randomized control trial (c-RCT)", 
                                      "Quasi-experimental design (QED)", 
                                      "Randomized control trial (RCT)"))
tabyl(remir_us, design)
# Article published in an academic journal
tabyl(remir_us, "published") 
# Is this program certified by Blueprints Healthy Youth Development?
tabyl(remir_us, "Certified.")
# Primary age group targeted
age_group_table_us <- data.frame(
  Age_Group = c(
    "Infant (ages 0-2 years)",
    "Preschool (ages 3-4 years)",
    "Elementary school (ages 5-11 years)",
    "Middle school (ages 12-14 years)",
    "High school (ages 15-18 years)",
    "Young adult (ages 19-24 years)",
    "Adult"
  ),
  Frequency = c(
    sum(remir_us$age_infant, na.rm = TRUE),
    sum(remir_us$age_preschool, na.rm = TRUE),
    sum(remir_us$age_elementary, na.rm = TRUE),
    sum(remir_us$age_middle, na.rm = TRUE),
    sum(remir_us$age_high, na.rm = TRUE),
    sum(remir_us$age_youngadult, na.rm = TRUE),
    sum(remir_us$age_adult, na.rm = TRUE)
  )
)
age_group_table_us <- age_group_table_us %>%
  mutate(Proportion = round(Frequency / 240, 2))
print(age_group_table_us)
##                             Age_Group Frequency Proportion
## 1             Infant (ages 0-2 years)        12       0.05
## 2          Preschool (ages 3-4 years)        20       0.08
## 3 Elementary school (ages 5-11 years)        72       0.30
## 4    Middle school (ages 12-14 years)        88       0.37
## 5      High school (ages 15-18 years)       124       0.52
## 6      Young adult (ages 19-24 years)        65       0.27
## 7                               Adult        13       0.05
# Place
place_table_us <- data.frame(
  Place = c(
    "Community",
    "Correctional facility",
    "Home",
    "Medical setting",
    "Online",
    "School",
    "Service setting"
  ),
  Frequency = c(
    sum(remir_us$pl_comm, na.rm = TRUE),
    sum(remir_us$pl_corr, na.rm = TRUE),
    sum(remir_us$pl_home, na.rm = TRUE),
    sum(remir_us$pl_med, na.rm = TRUE),
    sum(remir_us$pl_online, na.rm = TRUE),
    sum(remir_us$pl_school, na.rm = TRUE),
    sum(remir_us$pl_service, na.rm = TRUE)
  )
)
place_table_us <- place_table_us %>%
  mutate(Proportion = round(Frequency / 240, 2))
print(place_table_us)
##                   Place Frequency Proportion
## 1             Community        33       0.14
## 2 Correctional facility        10       0.04
## 3                  Home        17       0.07
## 4       Medical setting        19       0.08
## 5                Online        11       0.05
## 6                School       142       0.59
## 7       Service setting         8       0.03
# Outcome
outcome_table_us <- data.frame(
  Outcome = c(
    "Adult outcomes",
    "Educational outcomes",
    "Emotional outcomes",
    "Physical outcomes",
    "Positive relationship outcomes",
    "Problem behavior outcomes"
  ),
  Frequency = c(
    sum(remir_us$out_adult, na.rm = TRUE),
    sum(remir_us$out_educ, na.rm = TRUE),
    sum(remir_us$out_emot, na.rm = TRUE),
    sum(remir_us$out_phys, na.rm = TRUE),
    sum(remir_us$out_posrel, na.rm = TRUE),
    sum(remir_us$out_problem, na.rm = TRUE)
  )
)
outcome_table_us <- outcome_table_us %>%
  mutate(Proportion = round(Frequency / 240, 2))
print(outcome_table_us)
##                          Outcome Frequency Proportion
## 1                 Adult outcomes        10       0.04
## 2           Educational outcomes        98       0.41
## 3             Emotional outcomes        38       0.16
## 4              Physical outcomes         7       0.03
## 5 Positive relationship outcomes         6       0.03
## 6      Problem behavior outcomes       114       0.48

Column 3. Sub-Analysis: U.S. reports that conducted subgroup tests (N = 100; Online Supplement Table 1)

remir_us_subgroup <- remir_all %>% filter(country == "USA" & is.na(method))
dim(remir_us_subgroup)
## [1] 140 303
# Design (1 = Cluster randomized control trial (c-RCT), 2 = Quasi-experimental design (QED), 3 = Randomized control trial (RCT))
remir_us_subgroup$design <- factor(remir_us_subgroup$design, levels = c(1, 2, 3), 
                                   labels = c("Cluster randomized control trial (c-RCT)", 
                                              "Quasi-experimental design (QED)", 
                                              "Randomized control trial (RCT)"))
tabyl(remir_us_subgroup, design)
# Article published in an academic journal
tabyl(remir_us_subgroup, "published")
# Is this program certified by Blueprints Healthy Youth Development?
tabyl(remir_us_subgroup, "Certified.")
# Primary age group targeted
age_group_table_us_subgroup <- data.frame(
  Age_Group = c(
    "Infant (ages 0-2 years)",
    "Preschool (ages 3-4 years)",
    "Elementary school (ages 5-11 years)",
    "Middle school (ages 12-14 years)",
    "High school (ages 15-18 years)",
    "Young adult (ages 19-24 years)",
    "Adult"
  ),
  Frequency = c(
    sum(remir_us_subgroup$age_infant, na.rm = TRUE),
    sum(remir_us_subgroup$age_preschool, na.rm = TRUE),
    sum(remir_us_subgroup$age_elementary, na.rm = TRUE),
    sum(remir_us_subgroup$age_middle, na.rm = TRUE),
    sum(remir_us_subgroup$age_high, na.rm = TRUE),
    sum(remir_us_subgroup$age_youngadult, na.rm = TRUE),
    sum(remir_us_subgroup$age_adult, na.rm = TRUE)
  )
)
age_group_table_us_subgroup <- age_group_table_us_subgroup %>%
  mutate(Proportion = round(Frequency / 100, 2))
print(age_group_table_us_subgroup)
##                             Age_Group Frequency Proportion
## 1             Infant (ages 0-2 years)         6       0.06
## 2          Preschool (ages 3-4 years)        13       0.13
## 3 Elementary school (ages 5-11 years)        46       0.46
## 4    Middle school (ages 12-14 years)        55       0.55
## 5      High school (ages 15-18 years)        67       0.67
## 6      Young adult (ages 19-24 years)        32       0.32
## 7                               Adult        12       0.12
# Place
place_table_us_subgroup <- data.frame(
  Place = c(
    "Community",
    "Correctional facility",
    "Home",
    "Medical setting",
    "Online",
    "School",
    "Service setting"
  ),
  Frequency = c(
    sum(remir_us_subgroup$pl_comm, na.rm = TRUE),
    sum(remir_us_subgroup$pl_corr, na.rm = TRUE),
    sum(remir_us_subgroup$pl_home, na.rm = TRUE),
    sum(remir_us_subgroup$pl_med, na.rm = TRUE),
    sum(remir_us_subgroup$pl_online, na.rm = TRUE),
    sum(remir_us_subgroup$pl_school, na.rm = TRUE),
    sum(remir_us_subgroup$pl_service, na.rm = TRUE)
  )
)
place_table_us_subgroup <- place_table_us_subgroup %>%
  mutate(Proportion = round(Frequency / 100, 2))
print(place_table_us_subgroup)
##                   Place Frequency Proportion
## 1             Community        19       0.19
## 2 Correctional facility        10       0.10
## 3                  Home        13       0.13
## 4       Medical setting        12       0.12
## 5                Online         7       0.07
## 6                School        74       0.74
## 7       Service setting         5       0.05
# Outcome
outcome_table_us_subgroup <- data.frame(
  Outcome = c(
    "Adult outcomes",
    "Educational outcomes",
    "Emotional outcomes",
    "Physical outcomes",
    "Positive relationship outcomes",
    "Problem behavior outcomes"
  ),
  Frequency = c(
    sum(remir_us_subgroup$out_adult, na.rm = TRUE),
    sum(remir_us_subgroup$out_educ, na.rm = TRUE),
    sum(remir_us_subgroup$out_emot, na.rm = TRUE),
    sum(remir_us_subgroup$out_phys, na.rm = TRUE),
    sum(remir_us_subgroup$out_posrel, na.rm = TRUE),
    sum(remir_us_subgroup$out_problem, na.rm = TRUE)
  )
)
outcome_table_us_subgroup <- outcome_table_us_subgroup %>%
  mutate(Proportion = round(Frequency / 100, 2))
print(outcome_table_us_subgroup)
##                          Outcome Frequency Proportion
## 1                 Adult outcomes        10       0.10
## 2           Educational outcomes        39       0.39
## 3             Emotional outcomes        29       0.29
## 4              Physical outcomes         4       0.04
## 5 Positive relationship outcomes         2       0.02
## 6      Problem behavior outcomes        80       0.80

VII. Online Supplemental Table 2: Ns, Proportions, and Descriptive Statistics for Characteristics of Sample EBPI Evaluation Reports

# About Online Supplemental Table 2: Ns, Proportions, and Descriptive Statistics for Characteristics of Sample EBPI Evaluation Reports 

## Note. Remir 1.0 measured if program targeted location (rural and urban), but did not measure if sample distribution was reported, or percentage of sample in rural and urban locations. 

## Note: a Tested for one or more of the following subgroups: race, ethnicity, gender, sexual identity, economic disadvantage, location (rural, urban, suburban), nativity status (foreign-born – yes/no). 

 ## b No studies reported another category for persons of nonbinary gender.

Column 1. Full: U.S. and non-U.S. reports (N = 292; Online Supplement Table 2)

# Reported sample distribution of:

## Ethnicity ( 0 = did not report, 1 = reported)
tabyl(remir_all, ReportHisp)
## Gender ( 0 = did not report, 1 = reported)
tabyl(remir_all, ReportGend)
## Economic Disadvantage ( 0 = did not report, 1 = reported)
tabyl(remir_all, ReportEcon)
remir_all$ReportRace <- factor(remir_all$ReportRace, levels = c(0, 1), labels = c("No", "Yes"))
remir_all$ReportHisp <- factor(remir_all$ReportHisp, levels = c(0, 1), labels = c("No", "Yes"))
remir_all$ReportGend <- factor(remir_all$ReportGend, levels = c(0, 1), labels = c("No", "Yes"))
remir_all$ReportEcon <- factor(remir_all$ReportEcon, levels = c(0, 1), labels = c("No", "Yes"))

tab_race <- tabyl(remir_all, ReportRace) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_hisp <- tabyl(remir_all, ReportHisp) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_gend <- tabyl(remir_all, ReportGend) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_econ <- tabyl(remir_all, ReportEcon) %>%
  mutate(Proportion = round(n / sum(n), 2))

## Race 
print(tab_race)
##  ReportRace   n   percent Proportion
##          No  65 0.2226027       0.22
##         Yes 227 0.7773973       0.78
## Ethnicity 
print(tab_hisp)
##  ReportHisp   n  percent Proportion
##          No 114 0.390411       0.39
##         Yes 178 0.609589       0.61
## Gender
print(tab_gend)
##  ReportGend   n    percent Proportion
##          No  27 0.09246575       0.09
##         Yes 265 0.90753425       0.91
## Economic disadt
print(tab_econ)
##  ReportEcon   n   percent Proportion
##          No 192 0.6575342       0.66
##         Yes 100 0.3424658       0.34
# Sample statistics for reported Race (n = 227)
demographic_table <- data.frame(
  Demographic = c(
    "Asian or Asian American",
    "Black or African American",
    "Native American or American Indian or Alaska Native",
    "Native Hawaiian or Pacific Islander",
    "White",
    "Multi-racial/Biracial",
    "Not specified"
  ),
  Mean = c(
    mean(remir_all$asian_pc, na.rm = TRUE),
    mean(remir_all$black_pc, na.rm = TRUE),
    mean(remir_all$native_pc, na.rm = TRUE),
    mean(remir_all$pacif_pc, na.rm = TRUE),
    mean(remir_all$white_pc, na.rm = TRUE),
    mean(remir_all$multi_pc, na.rm = TRUE),
    mean(remir_all$none_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_all$asian_pc, na.rm = TRUE),
    sd(remir_all$black_pc, na.rm = TRUE),
    sd(remir_all$native_pc, na.rm = TRUE),
    sd(remir_all$pacif_pc, na.rm = TRUE),
    sd(remir_all$white_pc, na.rm = TRUE),
    sd(remir_all$multi_pc, na.rm = TRUE),
    sd(remir_all$none_pc, na.rm = TRUE)
  )
)
demographic_table <- demographic_table %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(demographic_table)
##                                           Demographic Mean   SD
## 1                             Asian or Asian American 0.03 0.08
## 2                           Black or African American 0.30 0.30
## 3 Native American or American Indian or Alaska Native 0.01 0.02
## 4                 Native Hawaiian or Pacific Islander 0.00 0.00
## 5                                               White 0.38 0.31
## 6                               Multi-racial/Biracial 0.02 0.04
## 7                                       Not specified 0.26 0.22
# Sample statistics for reported Ethnicity  (n = 178), Gender (n = 265), and Economic Disadvantage (n = 100)
statistics_table <- data.frame(
  Variable = c(
    "Ethnicity (n = 178)",
    "Gender (n = 265)",
    "Economic Disadvantage (n = 100)"
  ),
  Mean = c(
    mean(remir_all$hisp_pc, na.rm = TRUE),
    mean(remir_all$female_pc, na.rm = TRUE),
    mean(remir_all$econ_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_all$hisp_pc, na.rm = TRUE),
    sd(remir_all$female_pc, na.rm = TRUE),
    sd(remir_all$econ_pc, na.rm = TRUE)
  )
)
statistics_table <- statistics_table %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(statistics_table)
##                          Variable Mean   SD
## 1             Ethnicity (n = 178) 0.24 0.20
## 2                Gender (n = 265) 0.56 0.23
## 3 Economic Disadvantage (n = 100) 0.68 0.23

Column 2. Analysis: U.S. reports (N = 240; Online Supplement Table 2)

## Studies That Reported Sample Distribution
remir_us$ReportRace <- factor(remir_us$ReportRace, levels = c(0, 1), labels = c("No", "Yes"))
remir_us$ReportHisp <- factor(remir_us$ReportHisp, levels = c(0, 1), labels = c("No", "Yes"))
remir_us$ReportGend <- factor(remir_us$ReportGend, levels = c(0, 1), labels = c("No", "Yes"))
remir_us$ReportEcon <- factor(remir_us$ReportEcon, levels = c(0, 1), labels = c("No", "Yes"))

tab_race_us <- tabyl(remir_us, ReportRace) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_hisp_us <- tabyl(remir_us, ReportHisp) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_gend_us <- tabyl(remir_us, ReportGend) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_econ_us <- tabyl(remir_us, ReportEcon) %>%
  mutate(Proportion = round(n / sum(n), 2))

## Race 
print(tab_race_us)
##  ReportRace   n percent Proportion
##          No  30   0.125       0.12
##         Yes 210   0.875       0.88
## Ethnicity 
print(tab_hisp_us)
##  ReportHisp   n   percent Proportion
##          No  62 0.2583333       0.26
##         Yes 178 0.7416667       0.74
## Gender
print(tab_gend_us)
##  ReportGend   n    percent Proportion
##          No  23 0.09583333        0.1
##         Yes 217 0.90416667        0.9
## Economic disadvantage
print(tab_econ_us)
##  ReportEcon   n   percent Proportion
##          No 152 0.6333333       0.63
##         Yes  88 0.3666667       0.37
# Sample statistics for studies that report characteristic
demographic_table_us <- data.frame(
  Demographic = c(
    "Asian or Asian American",
    "Black or African American",
    "Native American or American Indian or Alaska Native",
    "Native Hawaiian or Pacific Islander",
    "White",
    "Multi-racial/Biracial",
    "Not specified"
  ),
  Mean = c(
    mean(remir_us$asian_pc, na.rm = TRUE),
    mean(remir_us$black_pc, na.rm = TRUE),
    mean(remir_us$native_pc, na.rm = TRUE),
    mean(remir_us$pacif_pc, na.rm = TRUE),
    mean(remir_us$white_pc, na.rm = TRUE),
    mean(remir_us$multi_pc, na.rm = TRUE),
    mean(remir_us$none_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_us$asian_pc, na.rm = TRUE),
    sd(remir_us$black_pc, na.rm = TRUE),
    sd(remir_us$native_pc, na.rm = TRUE),
    sd(remir_us$pacif_pc, na.rm = TRUE),
    sd(remir_us$white_pc, na.rm = TRUE),
    sd(remir_us$multi_pc, na.rm = TRUE),
    sd(remir_us$none_pc, na.rm = TRUE)
  )
)
demographic_table_us <- demographic_table_us %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(demographic_table_us)
##                                           Demographic Mean   SD
## 1                             Asian or Asian American 0.03 0.06
## 2                           Black or African American 0.31 0.30
## 3 Native American or American Indian or Alaska Native 0.01 0.02
## 4                 Native Hawaiian or Pacific Islander 0.00 0.00
## 5                                               White 0.36 0.31
## 6                               Multi-racial/Biracial 0.02 0.04
## 7                                       Not specified 0.27 0.22
# Sample statistics for reported Ethnicity, Gender, and Economic Disadvantage
statistics_table_us <- data.frame(
  Variable = c(
    "Ethnicity (n = 178)",
    "Gender (n = 265)",
    "Economic Disadvantage (n = 100)"
  ),
  Mean = c(
    mean(remir_us$hisp_pc, na.rm = TRUE),
    mean(remir_us$female_pc, na.rm = TRUE),
    mean(remir_us$econ_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_us$hisp_pc, na.rm = TRUE),
    sd(remir_us$female_pc, na.rm = TRUE),
    sd(remir_us$econ_pc, na.rm = TRUE)
  )
)
statistics_table_us <- statistics_table_us %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(statistics_table_us)
##                          Variable Mean   SD
## 1             Ethnicity (n = 178) 0.24 0.20
## 2                Gender (n = 265) 0.57 0.23
## 3 Economic Disadvantage (n = 100) 0.70 0.23

Column 3. Sub-Analysis: U.S. reports with subgroup tests (N = 240; Online Supplement Table 2)

########## SUB SAMPLE ##############################

## Studies That Reported Sample Distribution
tabyl(remir_us_subgroup, ReportRace)
tabyl(remir_us_subgroup, ReportHisp)
tabyl(remir_us_subgroup, ReportGend)
tabyl(remir_us_subgroup, ReportEcon)
## Sample statistics for studies that report characteristic: 
describe(remir_us_subgroup$asian_pc)
describe(remir_us_subgroup$black_pc)
describe(remir_us_subgroup$native_pc)
describe(remir_us_subgroup$pacif_pc)
describe(remir_us_subgroup$white_pc)
describe(remir_us_subgroup$multi_pc)
describe(remir_us_subgroup$none_pc)
describe(remir_us_subgroup$hisp_pc)
describe(remir_us_subgroup$female_pc)
describe(remir_us_subgroup$econ_pc)
## c. Sub-Analysis: U.S. reports with subgroup tests (N = 240; Column II, Online Supplement Table 2) 

########## SUB SAMPLE ##############################

## Studies That Reported Sample Distribution
remir_us_subgroup$ReportRace <- factor(remir_us_subgroup$ReportRace, levels = c(0, 1), labels = c("No", "Yes"))
remir_us_subgroup$ReportHisp <- factor(remir_us_subgroup$ReportHisp, levels = c(0, 1), labels = c("No", "Yes"))
remir_us_subgroup$ReportGend <- factor(remir_us_subgroup$ReportGend, levels = c(0, 1), labels = c("No", "Yes"))
remir_us_subgroup$ReportEcon <- factor(remir_us_subgroup$ReportEcon, levels = c(0, 1), labels = c("No", "Yes"))

tab_race_subgroup <- tabyl(remir_us_subgroup, ReportRace) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_hisp_subgroup <- tabyl(remir_us_subgroup, ReportHisp) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_gend_subgroup <- tabyl(remir_us_subgroup, ReportGend) %>%
  mutate(Proportion = round(n / sum(n), 2))

tab_econ_subgroup <- tabyl(remir_us_subgroup, ReportEcon) %>%
  mutate(Proportion = round(n / sum(n), 2))

## Race 
print(tab_race_subgroup)
##  ReportRace   n   percent Proportion
##          No  20 0.1428571       0.14
##         Yes 120 0.8571429       0.86
## Ethnicity 
print(tab_hisp_subgroup)
##  ReportHisp  n   percent Proportion
##          No 44 0.3142857       0.31
##         Yes 96 0.6857143       0.69
## Gender
print(tab_gend_subgroup)
##  ReportGend   n percent Proportion
##          No  14     0.1        0.1
##         Yes 126     0.9        0.9
## Economic disadvantage
print(tab_econ_subgroup)
##  ReportEcon  n   percent Proportion
##          No 96 0.6857143       0.69
##         Yes 44 0.3142857       0.31
# Sample statistics for studies that report characteristic
demographic_table_subgroup <- data.frame(
  Demographic = c(
    "Asian or Asian American",
    "Black or African American",
    "Native American or American Indian or Alaska Native",
    "Native Hawaiian or Pacific Islander",
    "White",
    "Multi-racial/Biracial",
    "Not specified"
  ),
  Mean = c(
    mean(remir_us_subgroup$asian_pc, na.rm = TRUE),
    mean(remir_us_subgroup$black_pc, na.rm = TRUE),
    mean(remir_us_subgroup$native_pc, na.rm = TRUE),
    mean(remir_us_subgroup$pacif_pc, na.rm = TRUE),
    mean(remir_us_subgroup$white_pc, na.rm = TRUE),
    mean(remir_us_subgroup$multi_pc, na.rm = TRUE),
    mean(remir_us_subgroup$none_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_us_subgroup$asian_pc, na.rm = TRUE),
    sd(remir_us_subgroup$black_pc, na.rm = TRUE),
    sd(remir_us_subgroup$native_pc, na.rm = TRUE),
    sd(remir_us_subgroup$pacif_pc, na.rm = TRUE),
    sd(remir_us_subgroup$white_pc, na.rm = TRUE),
    sd(remir_us_subgroup$multi_pc, na.rm = TRUE),
    sd(remir_us_subgroup$none_pc, na.rm = TRUE)
  )
)
demographic_table_subgroup <- demographic_table_subgroup %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(demographic_table_subgroup)
##                                           Demographic Mean   SD
## 1                             Asian or Asian American 0.04 0.07
## 2                           Black or African American 0.33 0.34
## 3 Native American or American Indian or Alaska Native 0.01 0.02
## 4                 Native Hawaiian or Pacific Islander 0.00 0.00
## 5                                               White 0.37 0.32
## 6                               Multi-racial/Biracial 0.02 0.05
## 7                                       Not specified 0.24 0.22
# Sample statistics for reported Ethnicity, Gender, and Economic Disadvantage
statistics_table_subgroup <- data.frame(
  Variable = c(
    "Ethnicity (n = 178)",
    "Gender (n = 265)",
    "Economic Disadvantage (n = 100)"
  ),
  Mean = c(
    mean(remir_us_subgroup$hisp_pc, na.rm = TRUE),
    mean(remir_us_subgroup$female_pc, na.rm = TRUE),
    mean(remir_us_subgroup$econ_pc, na.rm = TRUE)
  ),
  SD = c(
    sd(remir_us_subgroup$hisp_pc, na.rm = TRUE),
    sd(remir_us_subgroup$female_pc, na.rm = TRUE),
    sd(remir_us_subgroup$econ_pc, na.rm = TRUE)
  )
)
statistics_table_subgroup <- statistics_table_subgroup %>%
  mutate(Mean = round(Mean, 2), SD = round(SD, 2))
print(statistics_table_subgroup)
##                          Variable Mean   SD
## 1             Ethnicity (n = 178) 0.23 0.22
## 2                Gender (n = 265) 0.60 0.27
## 3 Economic Disadvantage (n = 100) 0.74 0.22

VIII. Online Supplemental Table 3: Proportions Testing for Subgroup Effects by Culturally Tailored Program (Yes or No) by Subgroup (see research questions 2 and 3)

# (4) Has the proportion of studies that examine differences in effects by these intersectional markers increased over time, and does the change differ for culturally-grounded vs. non-culturally-grounded EBPIs? 

  
## CREATE TWO CATEGORY MEASURE OF YEAR
tabyl(remir_all$Citation.Year)
remir_all$dyear <- ifelse(remir_all$Citation.Year <= 2016,0,1)
tabyl(remir_all, Citation.Year, dyear)
tabyl(remir_all, dyear)
tabyl(remir_us$Citation.Year)
remir_us$dyear <- ifelse(remir_us$Citation.Year <= 2016,0,1)
tabyl(remir_us, Citation.Year, dyear)
tabyl(remir_us, dyear)

Race

########### RECREATE LONG TEST VARIABLES FOR FULL SAMPLE ############
## What Race Interaction Were Examined #################

## ## Change Interaction Examined Variable Names 
names(remir_all)[13] <- "inter_examine1_race"
names(remir_all)[76] <- "inter_examine2_race"
table(remir_all$inter_examine1_race, useNA = "always")
## 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Black/Not Black 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Minority/Majority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            W/B (White/African American or Black) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                          W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan) 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
## W/B (White/African American or Black);W/As (White/Asian or Asian American);W/PI (White/Native Hawaiian or Pacific Islander);W/NA (White/Native American or American Indian or Native Alaskan);B/As (Black or African American/Asian or Asian American);B/PI (Black or African American/Native Hawaiian or Pacific Islander);B/NA (Black or African American/Native American or American Indian or Native Alaskan);As/NA (Asian or Asian American/Native American or American Indian or Native Alaskan);PI/NA (Native Hawaiian or Pacific Islander/Native American or American Indian or Native Alaskan);White/Multiracial; Black/Multiracial; Asian or Pacific Islander/Multiracial; Native American/Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 W/B (White/African American or Black);White/Other or Multiracial 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   White/Minority 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Non-White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  White/Not White 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <NA> 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              273
table(remir_all$inter_examine2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          5 
##                                                          Minority/Majority 
##                                                                          5 
##                                                                       None 
##                                                                          1 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          6 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          3 
##                                                                White/Other 
##                                                                          1 
##                                                                       <NA> 
##                                                                        269
## Combine Two Tnteractions Examined
remir_all$inter_examine12_race <- ifelse(is.na(remir_all$inter_examine1_race),
  remir_all$inter_examine2_race, remir_all$inter_examine1_race)
tabyl(remir_all$inter_examine12_race)
############## What Race Interactions Were Significant ################

## Change Interaction Significant Variable Names 
names(remir_all)[14] <- "inter_signif1_race"
names(remir_all)[77] <- "inter_signif2_race"
table(remir_all$inter_signif1_race, useNA = "always")
## 
##                                                             None 
##                                                               14 
##                            W/B (White/African American or Black) 
##                                                                1 
## W/B (White/African American or Black);White/Other or Multiracial 
##                                                                1 
##                                                   White/Minority 
##                                                                3 
##                                                             <NA> 
##                                                              273
table(remir_all$inter_signif2_race, useNA = "always")
## 
##                                                            Black/Not Black 
##                                                                          3 
##                                                          Minority/Majority 
##                                                                          2 
##                                                                       None 
##                                                                         14 
##                        W/As (White/Asian or Asian American);White/Minority 
##                                                                          1 
##                                      W/B (White/African American or Black) 
##                                                                          1 
## W/B (White/African American or Black);White/Multiracial; Black/Multiracial 
##                                                                          1 
##                                                 White + Another Race/Black 
##                                                                          1 
##                                                                       <NA> 
##                                                                        269
## Combine Two Tnteractions Significant
remir_all$inter_signif12_race <- ifelse(is.na(remir_all$inter_signif1_race),
  remir_all$inter_signif2_race, remir_all$inter_signif1_race)
tabyl(remir_all$inter_signif12_race)
############## What Race Interaction Groups Benefitted More ##############

## Change Interaction Benefitted Variable Names
names(remir_all)[16] <- "inter_benefit1_race"
names(remir_all)[79] <- "inter_benefit2_race"
table(remir_all$inter_benefit1_race, useNA = "always")
## 
## Black or African American;Other or Multiracial 
##                                              1 
##                                       Minority 
##                                              3 
##                                           None 
##                                             14 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            273
table(remir_all$inter_benefit2_race, useNA = "always")
## 
## Asian or Asian American;Minority        Black or African American 
##                                1                                2 
##  Black or African American;White                         Majority 
##                                1                                2 
##                             None                        Not Black 
##                               14                                2 
##             White + Another Race                             <NA> 
##                                1                              269
## Combine Two Tnteractions Benefitted
remir_all$inter_benefit12_race <- ifelse(is.na(remir_all$inter_benefit1_race),
  remir_all$inter_benefit2_race, remir_all$inter_benefit1_race)
tabyl(remir_all$inter_benefit12_race)
############# What Race Subgroup Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[47] <- "subg_examine1_race"
names(remir_all)[80] <- "subg_examine2_race"
table(remir_all$subg_examine1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 3 
##                   Black or African American;White 
##                                                 3 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               283
table(remir_all$subg_examine2_race, useNA = "always")
## 
## Asian or Asian American;Black or African American;White 
##                                                       1 
##                  Asian or Asian American;White;Minority 
##                                                       1 
##                               Black or African American 
##                                                       3 
##                     Black or African American;Not Black 
##                                                       1 
##                         Black or African American;White 
##                                                       4 
##          Black or African American;White + Another Race 
##                                                       3 
##             Black or African American;White;Multiracial 
##                                                       1 
##                                                Minority 
##                                                       1 
##                                      Minority; Majority 
##                                                       2 
##                                                    None 
##                                                       5 
##                                                   White 
##                                                       1 
##                                                    <NA> 
##                                                     269
## Combine Two Subgroups Examined
remir_all$subg_examine12_race <- ifelse(is.na(remir_all$subg_examine1_race),
  remir_all$subg_examine2_race, remir_all$subg_examine1_race)
tabyl(remir_all$subg_examine12_race)
############## What Race Subgroups Were Significant ######################

## Change Subgroup Significant Variable Names 
names(remir_all)[49] <- "subg_signif1_race"
names(remir_all)[82] <- "subg_signif2_race"
table(remir_all$subg_signif1_race, useNA = "always")
## 
## Asian or Asian American;Black or African American 
##                                                 1 
##                         Black or African American 
##                                                 5 
##                                              None 
##                                                 1 
##                                   White;Non-White 
##                                                 2 
##                                              <NA> 
##                                               283
table(remir_all$subg_signif2_race, useNA = "always")
## 
##               Asian or Asian American;Minority 
##                                              1 
##                      Black or African American 
##                                              5 
##            Black or African American;Not Black 
##                                              1 
##                Black or African American;White 
##                                              3 
## Black or African American;White + Another Race 
##                                              3 
##    Black or African American;White;Multiracial 
##                                              1 
##                                       Minority 
##                                              1 
##                             Minority; Majority 
##                                              2 
##                                           None 
##                                              5 
##                                          White 
##                                              1 
##                                           <NA> 
##                                            269
## Combine Two Subgroup Significant
remir_all$subg_signif12_race <- ifelse(is.na(remir_all$subg_signif1_race),
  remir_all$subg_signif2_race, remir_all$subg_signif1_race)
tabyl(remir_all$subg_signif12_race)
## INTERACTION RACE EXAMINED
tabyl(remir_all$inter_examine12_race)
## Simplify Codes
## Define as mixed if combined Black, Asian, etc into broad category
## Define as exact if referred specifically to Black, Asian, etc
## None = NA, as it means that race subgroups not examined
## Recode to Mixed and None
remir_all$inter_examine12_race_cat <-
  car::recode(remir_all$inter_examine12_race, "
    'Minority/Majority' = 'Mixed';
    'Minority/majority' = 'Mixed';
    'White/Minority' = 'Mixed'; 
    'White/Not White' = 'Mixed';
    'White/Non-White' = 'Mixed';  
    'White/Other' = 'Mixed';
    'None' = NA ")
## Code remaining to Exact
remir_all$inter_examine12_race_cat <-
  ifelse(remir_all$inter_examine12_race_cat != "Mixed", "Exact",
     remir_all$inter_examine12_race_cat)
## Check -- Looks OK
tabyl(remir_all$inter_examine12_race_cat)
tabyl(remir_all, inter_examine12_race, inter_examine12_race_cat)
## SUBGROUP RACE EXAMINED
tabyl(remir_all$subg_examine12_race)
## Simplify codes
## Define as mixed if combined Black, Asian, etcs into broad category
## Define as exact if referred specifically to Black, Asian, etc
## None = NA, as it means that race subgroups not examined
remir_all$subg_examine12_race_cat <- 
  ifelse(remir_all$subg_examine12_race == "White;Non-White" |
         remir_all$subg_examine12_race == "Minority" |
         remir_all$subg_examine12_race == "Minority; Majority", "Mixed",
  ifelse(remir_all$subg_examine12_race == "None", NA,"Exact"))
## Check -- Looks OK
tabyl(remir_all, subg_examine12_race, subg_examine12_race_cat)
tabyl(remir_all$subg_examine12_race_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE -- define over .75 as Homogeneous
tabyl(remir_all$inter_examine12_race_cat)
remir_all$inter_examine12_race_cat <- ifelse(
                        (remir_all$black_all > .75 |
                         remir_all$asian_all > .75 |
                         remir_all$native_all > .75 |
                         remir_all$pacif_all > .75 ) &
                         is.na(remir_all$inter_examine12_race_cat) &
                         is.na(remir_all$subg_examine12_race_cat), 
      "Homog", remir_all$inter_examine12_race_cat)
tabyl(remir_all$inter_examine12_race_cat)
## Check -- Mixed and Exact unchanged but many NAs now homogeneous
remir_all %>% filter(remir_all$inter_examine12_race_cat == 'Homog') %>% 
  select(black_all, asian_all, native_all, pacif_all, white_all) %>% 
  print(n=26)
## # A tibble: 26 × 5
##    black_all asian_all native_all pacif_all white_all
##        <dbl>     <dbl>      <dbl>     <dbl>     <dbl>
##  1      0.8       0             0         0      0   
##  2      0.8       0             0         0      0   
##  3      0.87      0             0         0      0   
##  4      0.84      0             0         0      0   
##  5      0.9       0.01          0         0      0.07
##  6      0.83      0             0         0      0.01
##  7      0.83      0             0         0      0.01
##  8      0.85      0.05          0         0      0.02
##  9      0.95      0             0         0      0   
## 10      1         0             0         0      0   
## 11      1         0             0         0      0   
## 12      1         0             0         0      0   
## 13      1         0             0         0      0   
## 14      1         0             0         0      0   
## 15      0.85      0             0         0      0   
## 16      0.85      0             0         0      0   
## 17      0.85      0             0         0      0   
## 18      0.82      0             0         0      0.15
## 19      0.82      0             0         0      0.15
## 20      0.8       0             0         0      0   
## 21      0.8       0             0         0      0   
## 22      1         0             0         0      0   
## 23      1         0             0         0      0   
## 24      1         0             0         0      0   
## 25      1         0             0         0      0   
## 26      0.87      0             0         0      0
## All Homogeneous samples are African American

## INTERACTION RACE BENEFIT
tabyl(remir_all$inter_benefit12_race)
## Simplify Codes
## Need to Use Three Variables to Simplify (benefit, examine, main effect)
tabyl(remir_all, inter_benefit12_race, inter_examine12_race_cat)
tabyl(remir_all, inter_benefit12_race, main_effect)
## Code as Exact if benefit any specific group of Blacks, Asians, etc
## Code as Mixed if benefit a combined group of Blacks, Asians, etc
## Code as Other if benefit whites only or no group 
## If None (i.e., equal effects), count as Exact or Mixed benefit if main effect
## If None (i.e., equal effects), count as no benefit or other if No main effect
## If None (i.e., equal effects) but examined is NA, then None means NA 
remir_all$inter_benefit12_race_cat <-
  ifelse(remir_all$inter_benefit12_race == 'Asian or Asian American;Minority' |
         remir_all$inter_benefit12_race == 'Black or African American;Other or Multiracial' |
         remir_all$inter_benefit12_race == 'Black or African American' |
         remir_all$inter_benefit12_race == 'Black or African American;White', 'Exact',
  ifelse(remir_all$inter_benefit12_race == 'Minority' |
         remir_all$inter_benefit12_race == 'White + Another Race', 'Mixed',
  ifelse(remir_all$inter_benefit12_race == 'Not Black' |
         remir_all$inter_benefit12_race == 'White' |
         remir_all$inter_benefit12_race == 'Majority', 'Other',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'Yes' &
         remir_all$inter_examine12_race_cat == 'Exact', 'Exact',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'Yes' &
         remir_all$inter_examine12_race_cat == 'Mixed', 'Mixed',
  ifelse(remir_all$inter_benefit12_race == 'None' &
         remir_all$main_effect          == 'No' &
         !is.na(remir_all$inter_examine12_race_cat), 'Other', NA))))))
## Check -- Looks OK
tabyl(remir_all$inter_benefit12_race_cat)
tabyl(remir_all, inter_benefit12_race, inter_benefit12_race_cat)
## SUBGROUP RACE BENEFIT
tabyl(remir_all$subg_signif12_race)
## Simplify codes
## None is NA if examined subgroups is NA
## None means no subgroup effects if examined is not NA (i.e., other or no benefit)
remir_all$subg_signif12_race_cat <- 
  ifelse(is.na(remir_all$subg_examine12_race_cat), NA,
  ifelse(remir_all$subg_signif12_race == "White;Non-White" |
         remir_all$subg_signif12_race == 'Minority' |
         remir_all$subg_signif12_race == 'Minority; Majority', "Mixed",
  ifelse(remir_all$subg_signif12_race == "None" |
         remir_all$subg_signif12_race == "White", "Other", "Exact")))
tabyl(remir_all$subg_signif12_race_cat)
## Check Looks OK
tabyl(remir_all$subg_signif12_race_cat)
tabyl(remir_all, subg_signif12_race, subg_signif12_race_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_benefit12_race_cat <- ifelse(
                       (remir_all$black_all > .75 |
                        remir_all$asian_all > .75 |
                        remir_all$native_all > .75 |
                        remir_all$pacif_all > .75 ) &
                        is.na(remir_all$inter_benefit12_race_cat) &
                        is.na(remir_all$subg_signif12_race_cat), 
      "Homog", remir_all$inter_benefit12_race_cat)
tabyl(remir_all$inter_benefit12_race_cat)

Ethnicity

## Change Inteaction Examined Variable Names 
names(remir_all)[18] <- "inter_examine1_ethnic"
names(remir_all)[84] <- "inter_examine2_ethnic"
table(remir_all$inter_examine1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/majority     Minority/Majority 
##                     5                     2                     1 
##        White/Minority       White/Non-White                  <NA> 
##                     3                     1                   280
table(remir_all$inter_examine2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                    14                     5                     2 
##        White/Minority           White/Other                  <NA> 
##                     1                     1                   269
## Combine Two Tnteractions Examined
remir_all$inter_examine12_ethnic <- ifelse(is.na(remir_all$inter_examine1_ethnic),
  remir_all$inter_examine2_ethnic, remir_all$inter_examine1_ethnic)
tabyl(remir_all$inter_examine12_ethnic)
############## What Ethnic Interactions Were Significant ###############

## Change Interaction Significant Variable Names 
names(remir_all)[19] <- "inter_signif1_ethnic"
names(remir_all)[85] <- "inter_signif2_ethnic"
table(remir_all$inter_signif1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic                  None        White/Minority 
##                     2                    11                     3 
##                  <NA> 
##                   276
table(remir_all$inter_signif2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                     6                     2                    14 
##        White/Minority                  <NA> 
##                     1                   269
## Combine Two Tnteractions Significant
remir_all$inter_signif12_ethnic <- ifelse(is.na(remir_all$inter_signif1_ethnic),
  remir_all$inter_signif2_ethnic, remir_all$inter_signif1_ethnic)
tabyl(remir_all$inter_signif12_ethnic)
############## What Ethnic Interaction Groups Benefited More ############

## Change Interaction Benefitted Variable Names
names(remir_all)[21] <- "inter_benefit1_ethnic"
names(remir_all)[87] <- "inter_benefit2_ethnic"
table(remir_all$inter_benefit1_ethnic, useNA = "always")
## 
## Hispanic Minority     None     <NA> 
##        2        3       11      276
table(remir_all$inter_benefit2_ethnic, useNA = "always")
## 
##     Hispanic     Majority     Minority Non-Hispanic         None         <NA> 
##            3            2            1            3           14          269
## Combine Two Tnteractions Benefitted
remir_all$inter_benefit12_ethnic <- ifelse(is.na(remir_all$inter_benefit1_ethnic),
  remir_all$inter_benefit2_ethnic, remir_all$inter_benefit1_ethnic)
tabyl(remir_all$inter_benefit12_ethnic)
############# What Ethnic Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[51] <- "subg_examine1_ethnic"
names(remir_all)[88] <- "subg_examine2_ethnic"
table(remir_all$subg_examine1_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic                  <NA> 
##                     6                     1                   285
table(remir_all$subg_examine2_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic              Minority 
##                    12                     3                     2 
##    Minority; Majority                  None                  <NA> 
##                     2                     4                   269
## Combine Two Subgroups Examined
remir_all$subg_examine12_ethnic <- ifelse(is.na(remir_all$subg_examine1_ethnic),
  remir_all$subg_examine2_ethnic, remir_all$subg_examine1_ethnic)
tabyl(remir_all$subg_examine12_ethnic)
############## What Ethnic Subgroups Were Significant ##################

## Change Subgroup Significant Variable Names 
names(remir_all)[53] <- "subg_signif1_ethnic"
names(remir_all)[90] <- "subg_signif2_ethnic"
table(remir_all$subg_signif1_ethnic, useNA = "always")
## 
## Hispanic     None     <NA> 
##        5        2      285
table(remir_all$subg_signif2_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic              Minority 
##                    10                     3                     2 
##    Minority; Majority                  None                  <NA> 
##                     2                     6                   269
## Combine Two Tnteractions Significant
remir_all$subg_signif12_ethnic <- ifelse(is.na(remir_all$subg_signif1_ethnic),
  remir_all$subg_signif2_ethnic, remir_all$subg_signif1_ethnic)
tabyl(remir_all$subg_signif12_ethnic)
## INTERACTION ETHNIC EXAMINED
tabyl(remir_all$inter_examine12_ethnic)
## Simplify Codes
## Define as mixed if combined Hispanics into broad category
## Define as exact if referred specifically to Hispanic, Non-Hispanic
## None = NA for examined, as it means that Hispanic subgroups not examined
## First, assign exact and none
remir_all$inter_examine12_ethnic_cat <-
  car::recode(remir_all$inter_examine12_ethnic, "
  'Hispanic/Non-Hispanic' = 'Exact';
  'None' = NA ")
tabyl(remir_all$inter_examine12_ethnic_cat)
## Second, remaining categores are assigned as mixed
remir_all$inter_examine12_ethnic_cat <-
  ifelse(remir_all$inter_examine12_ethnic_cat != "Exact", "Mixed",
     remir_all$inter_examine12_ethnic_cat)
tabyl(remir_all$inter_examine12_ethnic_cat)
## Check -- Looks OK
tabyl(remir_all, inter_examine12_ethnic, inter_examine12_ethnic_cat)
## SUBGROUP ETHNIC EXAMINED
tabyl(remir_all$subg_examine12_ethnic)
## Simplify Codes
## Define as mixed if combined Hispanics into broad category
## Define as exact if referred specifically to Hispanic, Non-HispaniceBlack, Asian, etc
## None = NA for examined, as it means that Hispanic subgroups not examined
remir_all$subg_examine12_ethnic_cat <-
  ifelse(remir_all$subg_examine12_ethnic == 'Minority'|
          remir_all$subg_examine12_ethnic == 'Minority; Majority',
    'Mixed', 
  ifelse(remir_all$subg_examine12_ethnic == 'None', NA,
    'Exact'))
## Check -- Looks OK
tabyl(remir_all$subg_examine12_ethnic_cat)
tabyl(remir_all, subg_examine12_ethnic, subg_examine12_ethnic_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE OF HISPANICS
tabyl(remir_all$inter_examine12_ethnic_cat)
remir_all$inter_examine12_ethnic_cat <- ifelse(
                        (remir_all$hisp_all > .75) &
                        is.na(remir_all$inter_examine12_ethnic_cat) &
                        is.na(remir_all$subg_examine12_ethnic_cat), 
      "Homog", remir_all$inter_examine12_ethnic_cat)
tabyl(remir_all$inter_examine12_ethnic_cat)
tabyl(remir_all, inter_examine12_ethnic, inter_examine12_ethnic_cat)
## INTERACTION ETHNIC BENEFIT
tabyl(remir_all$inter_benefit12_ethnic)
## Simplify Codes
## Code as Exact Benefit if Hispanic 
## Code as Other if Non-Hispanic or Majority
## Code as Mixed if Minority
## If None (i.e., equal effects) count as benefit if main effect
## If None (i.e., equal effects) count as other if if no main effect
## If None and ethnic not examined, code as NA as meaning of None for interaction is unclear
## Code Unclear as NA
remir_all$inter_benefit12_ethnic_cat <-
  ifelse(remir_all$inter_benefit12_ethnic == 'Hispanic', 'Exact',
  ifelse(remir_all$inter_benefit12_ethnic == 'Minority', 'Mixed',
  ifelse(remir_all$inter_benefit12_ethnic == 'Non-Hispanic' |
         remir_all$inter_benefit12_ethnic == 'Majority', 'Other',
  ifelse(remir_all$inter_benefit12_ethnic == 'None' &
         remir_all$main_effect           == 'Yes' &
         remir_all$inter_examine12_ethnic_cat == 'Exact', 'Exact',
  ifelse(remir_all$inter_benefit12_ethnic == 'None' &
         remir_all$main_effect          == 'Yes' &
         remir_all$inter_examine12_ethnic_cat == 'Mixed', 'Mixed',
  ifelse(remir_all$inter_benefit12_ethnic == 'None' &
         remir_all$main_effect          == 'No' &
         !is.na(remir_all$inter_examine12_ethnic_cat), 'Other', NA))))))
## Check -- Looks OK
tabyl(remir_all$inter_benefit12_ethnic_cat)
tabyl(remir_all, inter_benefit12_ethnic, inter_benefit12_ethnic_cat)
## SUBGROUP ETHNIC BENEFIT
tabyl(remir_all$subg_signif12_ethnic)
## Simplify codes
## None here means no subgroup effects, should be other or no benefit
remir_all$subg_signif12_ethnic_cat <- 
  ifelse(remir_all$subg_signif12_ethnic == "Hispanic" |
         remir_all$subg_signif12_ethnic == "Hispanic;Non-Hispanic" , "Exact",
  ifelse(remir_all$subg_signif12_ethnic == "None", "Other", 
  ifelse(remir_all$subg_signif12_ethnic == "Minority" |
         remir_all$subg_signif12_ethnic == "Minority; Majority", "Mixed", 
  ifelse(is.na(remir_all$subg_examine12_ethnic), NA, 'Check'))))
## Check
tabyl(remir_all$subg_signif12_ethnic_cat)
tabyl(remir_all, subg_signif12_ethnic, subg_signif12_ethnic_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
tabyl(remir_all$inter_benefit12_ethnic_cat)
remir_all$inter_benefit12_ethnic_cat <- ifelse(
                        (remir_all$hisp_all > .75) &
                        is.na(remir_all$inter_benefit12_ethnic_cat) &
                        is.na(remir_all$subg_signif12_ethnic_cat), 
      "Homog", remir_all$inter_benefit12_ethnic_cat)
tabyl(remir_all$inter_benefit12_ethnic_cat)
## Problem NA n = 200 for examined n = 198 for benefited
## How can cases that don't examine ethicity show a benefit

remir_all %>% filter(is.na(inter_examine12_ethnic_cat) &
                    is.na(subg_examine12_ethnic_cat) &
                   !is.na(inter_benefit12_ethnic_cat) &
                   is.na(subg_signif12_ethnic_cat)) %>% 
  select(Citation.ID, Program.Name, inter_examine12_ethnic_cat, 
    subg_examine12_ethnic_cat) 
remir_all %>% filter(is.na(inter_examine12_ethnic_cat) &
                    is.na(subg_examine12_ethnic_cat) &
                   !is.na(inter_benefit12_ethnic_cat) &
                   is.na(subg_signif12_ethnic_cat)) %>% 
  select(Citation.ID, Program.Name, inter_benefit12_ethnic_cat, 
    subg_signif12_ethnic_cat)
## Change 3980 and 3981 to NA so that examined and benefit are consistent
tabyl(remir_all$inter_benefit12_ethnic_cat)
remir_all$inter_benefit12_ethnic_cat <- 
  ifelse(remir_all$Citation.ID == 3980, NA, remir_all$inter_benefit12_ethnic_cat)
tabyl(remir_all$inter_benefit12_ethnic_cat)
remir_all$inter_benefit12_ethnic_cat <- 
  ifelse(remir_all$Citation.ID == 3981, NA, remir_all$inter_benefit12_ethnic_cat)
tabyl(remir_all$inter_benefit12_ethnic_cat)

Gender (dichotomous: male/female)

############## What Gender Interactions Were Examined 

## Change Interaction Examined Gender Variable Names
names(remir_all)[23] <- "inter_examine1_gender"
names(remir_all)[92] <- "inter_examine2_gender"
table(remir_all$inter_examine1_gender, useNA = "always")
## 
## Male/Female        <NA> 
##          41         251
table(remir_all$inter_examine2_gender, useNA = "always")
## 
## Male/Female        <NA> 
##          37         255
## Combine Two Gender Interactions Examined
remir_all$inter_examine12_gender <- ifelse(is.na(remir_all$inter_examine1_gender),
  remir_all$inter_examine2_gender, remir_all$inter_examine1_gender)
tabyl(remir_all$inter_examine12_gender)
############## What Gender interactions Were Significant ###############

## Change Interaction Significant Variable Names 
names(remir_all)[24] <- "inter_signif1_gender"
names(remir_all)[93] <- "inter_signif2_gender"
table(remir_all$inter_signif1_gender, useNA = "always")
## 
## Male/Female        None        <NA> 
##           6          35         251
table(remir_all$inter_signif2_gender, useNA = "always")
## 
## Male/Female        None        <NA> 
##          18          19         255
## Combine Two Tnteractions Significant
remir_all$inter_signif12_gender <- ifelse(is.na(remir_all$inter_signif1_gender),
  remir_all$inter_signif2_gender, remir_all$inter_signif1_gender)
tabyl(remir_all$inter_signif12_gender)
########## What Gender Interaction Groups Benefited More ##################

## Change Interaction Benefitted Variable Names
names(remir_all)[26] <- "inter_benefit1_gender"
names(remir_all)[95] <- "inter_benefit2_gender"
table(remir_all$inter_benefit1_gender, useNA = "always")
## 
##  Female    Male    None Unclear    <NA> 
##       4       1      35       1     251
table(remir_all$inter_benefit2_gender, useNA = "always")
## 
##  Female    Male    None Unclear    <NA> 
##       7       7      19       4     255
## Combine Two Tnteractions
remir_all$inter_benefit12_gender <- ifelse(is.na(remir_all$inter_benefit1_gender),
  remir_all$inter_benefit2_gender, remir_all$inter_benefit1_gender)
tabyl(remir_all$inter_benefit12_gender)
############# What Gender Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[55] <- "subg_examine1_gender"
names(remir_all)[96] <- "subg_examine2_gender"
table(remir_all$subg_examine1_gender, useNA = "always")
## 
## Male;Female        <NA> 
##          13         279
table(remir_all$subg_examine2_gender, useNA = "always")
## 
##      Female Male;Female        None        <NA> 
##           1          34           2         255
## Combine Two Subgroups Examined
remir_all$subg_examine12_gender <- ifelse(is.na(remir_all$subg_examine1_gender),
  remir_all$subg_examine2_gender, remir_all$subg_examine1_gender)
tabyl(remir_all$subg_examine12_gender)
############## What Gender Subgroups Were Significant #####################

## Change Subgroup Significant Variable Names 
names(remir_all)[57] <- "subg_signif1_gender"
names(remir_all)[98] <- "subg_signif2_gender"
table(remir_all$subg_signif1_gender, useNA = "always")
## 
##      Female        Male Male;Female        None        <NA> 
##           2           3           6           2         279
table(remir_all$subg_signif2_gender, useNA = "always")
## 
##      Female        Male Male;Female        None        <NA> 
##           3           2          25           7         255
## Combine Two Tnteractions Significant
remir_all$subg_signif12_gender <- ifelse(is.na(remir_all$subg_signif1_gender),
  remir_all$subg_signif2_gender, remir_all$subg_signif1_gender)
tabyl(remir_all$subg_signif12_gender)
## INTERACTION GENDER EXAMINED
tabyl(remir_all$inter_examine12_gender)
## SUBGROUP GENDER EXAMINED
tabyl(remir_all$subg_examine12_gender)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_examine12_gender <- ifelse(
                        (remir_all$female_all > .75 ) &
                        is.na(remir_all$inter_examine12_gender) &
                        is.na(remir_all$subg_examine12_gender), 
      "Homog", remir_all$inter_examine12_gender)
tabyl(remir_all$inter_examine12_gender)
## INTERACTION GENDER BENEFITTTED
tabyl(remir_all$inter_benefit12_gender)
## Simplify Codes
remir_all$inter_benefit12_gender_cat <-
  ifelse(remir_all$inter_benefit12_gender == 'None' &
         remir_all$main_effect           == 'Yes', 'Both',
  ifelse(remir_all$inter_benefit12_gender == 'None' &
         remir_all$main_effect          == 'No', 'Neither', 
         remir_all$inter_benefit12_gender))
## Check -- Look OK
tabyl(remir_all, inter_benefit12_gender, inter_benefit12_gender_cat)
tabyl(remir_all$inter_benefit12_gender_cat)
## SUBGROUP GENDER BENEFITTED
tabyl(remir_all$subg_signif12_gender)
## SEPARATE OUT HOMOGENOUS SAMPLE
remir_all$inter_benefit12_gender_cat <- ifelse(
                        (remir_all$female_all > .75) &
                        is.na(remir_all$inter_benefit12_gender_cat) &
                        is.na(remir_all$subg_signif12_gender), 
      "Homog", remir_all$inter_benefit12_gender_cat)
tabyl(remir_all$inter_benefit12_gender_cat)

Sexual Identity

############## SEX  ########################

############## What Sex Interaction Groups Were Examined ####################

## Change Interaction Examined Variable Names
names(remir_all)[27] <- "inter_examine1_sex"
names(remir_all)[100] <- "inter_examine2_sex"
table(remir_all$inter_examine1_sex, useNA = "always")
## 
##   No  Yes <NA> 
##   51    2  239
table(remir_all$inter_examine2_sex, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Examined
remir_all$inter_examine12_sex <- ifelse(is.na(remir_all$inter_examine1_sex),
  remir_all$inter_examine2_sex, remir_all$inter_examine1_sex)
tabyl(remir_all$inter_examine12_sex)
############## What Sex interactions Were Significant ###################

## Change Interaction Significant Variable Names
names(remir_all)[28] <- "inter_signif1_sex"
names(remir_all)[101] <- "inter_signif2_sex"
table(remir_all$inter_signif1_sex, useNA = "always")
## 
## None <NA> 
##    2  290
table(remir_all$inter_signif2_sex, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Significant
remir_all$inter_signif12_sex <- ifelse(is.na(remir_all$inter_signif1_sex),
  remir_all$inter_signif2_sex, remir_all$inter_signif1_sex)
tabyl(remir_all$inter_signif12_sex)
############ What Sex Interaction Groups Benefited More ####################

## Change Interactions Benefitted Variable Names
names(remir_all)[30] <- "inter_benefit1_sex"
names(remir_all)[103] <- "inter_benefit2_sex"
table(remir_all$inter_benefit1_sex, useNA = "always")
## 
## None <NA> 
##    2  290
table(remir_all$inter_benefit2_sex, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Benefitted
remir_all$inter_benefit12_sex <- ifelse(is.na(remir_all$inter_benefit1_sex),
  remir_all$inter_benefit2_sex, remir_all$inter_benefit1_sex)
tabyl(remir_all$inter_benefit12_sex)
############# What Sex Subgroup Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[59] <- "subg_examine1_sex"
names(remir_all)[104] <- "subg_examine2_sex"
table(remir_all$subg_examine1_sex, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_examine2_sex, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Subgroups Examined
remir_all$subg_examine12_sex <- ifelse(is.na(remir_all$subg_examine1_sex),
  remir_all$subg_examine2_sex, remir_all$subg_examine1_sex)
tabyl(remir_all$subg_examine12_sex)
############## What Sex Subgroups Were Significant #######################

## Change Subgroup Significant Variable Names 
names(remir_all)[61] <- "subg_signif1_sex"
names(remir_all)[106] <- "subg_signif2_sex"
table(remir_all$subg_signif1_sex, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_signif2_sex, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Significant
remir_all$subg_signif12_sex <- ifelse(is.na(remir_all$subg_signif1_sex),
  remir_all$subg_signif2_sex, remir_all$subg_signif1_sex)
tabyl(remir_all$subg_signif12_sex)
## INTERACTION SEX EXAMINED
## Codebook didn't ask which groups examined in interaction
## Used were any groups examined
tabyl(remir_all$inter_examine12_sex)
## SUBGROUP SEX EXAMINED
tabyl(remir_all$subg_examine12_sex)
## SEPARATE OUT HOMOGENEOUS SAMPLE
## Not possible, no measure of lgbt sample in Remir 1

## INTERACTION SEX BENEFITTED
tabyl(remir_all$inter_benefit12_sex)
tabyl(remir_all, inter_benefit12_sex, main_effect)
## None with main effect means benefit
remir_all$inter_benefit12_sex_cat <-
  ifelse(remir_all$inter_benefit12_sex == 'None' &
         remir_all$main_effect == 'Yes', 'Yes', remir_all$inter_benefit12_sex)
tabyl(remir_all$inter_benefit12_sex_cat)
## SUBGROUP SEX BENEFITTED
tabyl(remir_all$subg_signif12_sex)

Economic Disadvantage

############## What SES Interaction Group Were Examined ########################

## Change Interaction SES Varialbe Names 
names(remir_all)[31] <- "inter_examine1_ses"
names(remir_all)[108] <- "inter_examine2_ses"
table(remir_all$inter_examine1_ses, useNA = "always")
## 
##   No  Yes <NA> 
##   40   13  239
table(remir_all$inter_examine2_ses, useNA = "always")
## 
## Low/High     <NA> 
##       13      279
## Combine Two Tnteractions Examined
remir_all$inter_examine12_ses <- ifelse(is.na(remir_all$inter_examine1_ses),
  remir_all$inter_examine2_ses, remir_all$inter_examine1_ses)
tabyl(remir_all$inter_examine12_ses)
############## What SES Interactions Were Significant ####################

## Change Interaction Significant Variable Names
names(remir_all)[32] <- "inter_signif1_ses"
names(remir_all)[109] <- "inter_signif2_ses"
table(remir_all$inter_signif1_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        5        8      279
table(remir_all$inter_signif2_ses, useNA = "always")
## 
## Low/High     None     <NA> 
##        4        9      279
## Combine Two Tnteractions Significant
remir_all$inter_signif12_ses <- ifelse(is.na(remir_all$inter_signif1_ses),
  remir_all$inter_signif2_ses, remir_all$inter_signif1_ses)
tabyl(remir_all$inter_signif12_ses)
############ What SES Interaction Groups Benefited More ##################

## Change Interaction Benefitted Variable Names
names(remir_all)[34] <- "inter_benefit1_ses"
names(remir_all)[111] <- "inter_benefit2_ses"
table(remir_all$inter_benefit1_ses, useNA = "always")
## 
## High  Low None <NA> 
##    1    4    8  279
table(remir_all$inter_benefit2_ses, useNA = "always")
## 
##    High     Low    None Unclear    <NA> 
##       1       2       9       1     279
## Combine Two Tnteractions
remir_all$inter_benefit12_ses <- ifelse(is.na(remir_all$inter_benefit1_ses),
  remir_all$inter_benefit2_ses, remir_all$inter_benefit1_ses)
tabyl(remir_all$inter_benefit12_ses)
############# What SES Subgroups Were Examined ####################

## Change Subgroups Examined Variable Names
names(remir_all)[63] <- "subg_examine1_ses"
names(remir_all)[112] <- "subg_examine2_ses"
table(remir_all$subg_examine1_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        3        6      283
table(remir_all$subg_examine2_ses, useNA = "always")
## 
##      Low Low;High     <NA> 
##        4        9      279
## Combine Two Subgroups Examined
remir_all$subg_examine12_ses <- ifelse(is.na(remir_all$subg_examine1_ses),
  remir_all$subg_examine2_ses, remir_all$subg_examine1_ses)
tabyl(remir_all$subg_examine12_ses)
############## What SES Subgroups Were Significant #########################

## Change Subgroups Significant Variable Names 
names(remir_all)[65] <- "subg_signif1_ses"
names(remir_all)[114] <- "subg_signif2_ses"
table(remir_all$subg_signif1_ses, useNA = "always")
## 
##      Low Low;High     None     <NA> 
##        5        2        2      283
table(remir_all$subg_signif2_ses, useNA = "always")
## 
##     High      Low Low;High     <NA> 
##        1        5        7      279
## Combine Two Tnteractions Significant
remir_all$subg_signif12_ses <- ifelse(is.na(remir_all$subg_signif1_ses),
  remir_all$subg_signif2_ses, remir_all$subg_signif1_ses)
tabyl(remir_all$subg_signif12_ses)
remir_us$subg_signif12_ses <- ifelse(is.na(remir_us$subg_signif1_ses),
  remir_us$subg_signif2_ses, remir_us$subg_signif1_ses)
tabyl(remir_us$subg_signif12_ses)
## INTERACTION SES EXAMINED
tabyl(remir_all$inter_examine12_ses)
## Change No to NA
remir_all$inter_examine12_ses_cat <- ifelse(
  remir_all$inter_examine12_ses == 'No', NA, remir_all$inter_examine12_ses)
tabyl(remir_all$inter_examine12_ses_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_examine12_ses_cat <- ifelse(
                        (remir_all$econ_all > .75) &
                        is.na(remir_all$inter_examine12_ses_cat) & 
                        is.na(remir_all$subg_examine12_ses), 
      "Homog", remir_all$inter_examine12_ses_cat)
tabyl(remir_all$inter_examine12_ses_cat)
## INTERACTION SES BENEFITTED
tabyl(remir_all$inter_benefit12_ses)
## Simplify Codes
tabyl(remir_all, inter_benefit12_ses, inter_examine12_ses)
remir_all$inter_benefit12_ses_cat <-
  ifelse(remir_all$inter_benefit12_ses == 'None' &
         remir_all$main_effect           == 'Yes', 'Both',
  ifelse(remir_all$inter_benefit12_ses == 'None' &
         remir_all$main_effect          == 'No', 'Neither', 
          remir_all$inter_benefit12_ses))
tabyl(remir_all, inter_benefit12_ses, inter_benefit12_ses_cat)
## SUBGROUP SES BENEFITTED
tabyl(remir_all$subg_signif12_ses)
## SEPARATE OUT HOMOGENEOUS SAMPLE
remir_all$inter_benefit12_ses_cat <- ifelse(
                        (remir_all$econ_all > .75) &
                        is.na(remir_all$inter_benefit12_ses_cat) &
                        is.na(remir_all$subg_signif12_ses), 
      "Homog", remir_all$inter_benefit12_ses_cat)
tabyl(remir_all$inter_benefit12_ses_cat)

Location (rural, suburban, urban)

############## What Location Interaction Groups Were Examined ###################

## Change Interaction Examined Variable Names
names(remir_all)[36] <- "inter_examine1_loc"
names(remir_all)[116] <- "inter_examine2_loc"
table(remir_all$inter_examine1_loc, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$inter_examine2_loc, useNA = "always")
## 
## Urban/Non-Urban            <NA> 
##               2             290
## Combine Two Tnteractions Examined
remir_all$inter_examine12_loc <- ifelse(is.na(remir_all$inter_examine1_loc),
  remir_all$inter_examine2_loc, remir_all$inter_examine1_loc)
tabyl(remir_all$inter_examine12_loc)
############ What Location Interactions Were Significant ################

## Change Interaction Significant Variable Names
names(remir_all)[37] <- "inter_signif1_loc"
names(remir_all)[117] <- "inter_signif2_loc"
table(remir_all$inter_signif1_loc, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$inter_signif2_loc, useNA = "always")
## 
## None <NA> 
##    2  290
## Combine Two Tnteractions Significant
remir_all$inter_signif12_loc <- ifelse(is.na(remir_all$inter_signif1_loc),
  remir_all$inter_signif2_loc, remir_all$inter_signif1_loc)
tabyl(remir_all$inter_signif12_loc)
############ What Location Interaction Groups Benefited More #############

## Change Interaction Benefitted Variable Names
names(remir_all)[39] <- "inter_benefit1_loc"
names(remir_all)[119] <- "inter_benefit2_loc"
table(remir_all$inter_benefit1_loc, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$inter_benefit2_loc, useNA = "always")
## 
## None <NA> 
##    2  290
## Combine Two Tnteractions
remir_all$inter_benefit12_loc <- ifelse(is.na(remir_all$inter_benefit1_loc),
  remir_all$inter_benefit2_loc, remir_all$inter_benefit1_loc)
tabyl(remir_all$inter_benefit12_loc)
############# What Location Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[67] <- "subg_examine1_loc"
names(remir_all)[120] <- "subg_examine2_loc"
table(remir_all$subg_examine1_loc, useNA = "always")
## 
## Rural  <NA> 
##     2   290
table(remir_all$subg_examine2_loc, useNA = "always")
## 
## Urban;Non-Urban            <NA> 
##               2             290
## Combine Two Subgroups Examined
remir_all$subg_examine12_loc <- ifelse(is.na(remir_all$subg_examine1_loc),
  remir_all$subg_examine2_loc, remir_all$subg_examine1_loc)
tabyl(remir_all$subg_examine12_loc)
############## What Location Subgroups Were Significant ####################

## Change Subgroup Significant Variable Names 
names(remir_all)[69] <- "subg_signif1_loc"
names(remir_all)[122] <- "subg_signif2_loc"
table(remir_all$subg_signif1_loc, useNA = "always")
## 
## Rural  <NA> 
##     2   290
table(remir_all$subg_signif2_loc, useNA = "always")
## 
##            None Urban;Non-Urban            <NA> 
##               1               1             290
## Combine Two Tnteractions Significant
remir_all$subg_signif12_loc <- ifelse(is.na(remir_all$subg_signif1_loc),
  remir_all$subg_signif2_loc, remir_all$subg_signif1_loc)
tabyl(remir_all$subg_signif12_loc)
## INTERACTION LOCATION EXAMINED
tabyl(remir_all$inter_examine12_loc)
## SUBGROUP LOCATION EXAMINED
tabyl(remir_all$subg_examine12_loc)
## SEPARATE OUT HOMOGENEOUS SAMPLE
## No measure of sample proportion for urban or rural

## INTERACTION LOCATION BENEFITTED
tabyl(remir_all$inter_benefit12_loc)
## SUBGROUP LOCATION BENEFITTED
tabyl(remir_all$subg_signif12_loc)

Nativity (foreign-born - yes/no)

############## What Nativity Interaction Groups Were Examined ################################

## Change Interaction Nativity Variable Names
names(remir_all)[41] <- "inter_examine1_nat"
names(remir_all)[124] <- "inter_examine2_nat"
table(remir_all$inter_examine1_nat, useNA = "always")
## 
## Immigrant/Nonimmigrant                   <NA> 
##                      1                    291
table(remir_all$inter_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Examined
remir_all$inter_examine12_nat <- ifelse(is.na(remir_all$inter_examine1_nat),
  remir_all$inter_examine2_nat, remir_all$inter_examine1_nat)
tabyl(remir_all$inter_examine12_nat)
############## What Nativity Interactions Were Significant ##############################

## Change Interaction Significant Variable Names 
names(remir_all)[42] <- "inter_signif1_nat"
names(remir_all)[125] <- "inter_signif2_nat"
table(remir_all$inter_signif1_nat, useNA = "always")
## 
## None <NA> 
##    1  291
table(remir_all$inter_signif2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Significant
remir_all$inter_signif12_nat <- ifelse(is.na(remir_all$inter_signif1_nat),
  remir_all$inter_signif2_nat, remir_all$inter_signif1_nat)
tabyl(remir_all$inter_signif12_nat)
############## What Nativity Interaction Groups Benefited More ##############################

## Change Interaction Benfitted Variable Names
names(remir_all)[44] <- "inter_benefit1_nat"
names(remir_all)[127] <- "inter_benefit2_nat"
table(remir_all$inter_benefit1_nat, useNA = "always")
## 
## None <NA> 
##    1  291
table(remir_all$inter_benefit2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions
remir_all$inter_benefit12_nat <- ifelse(is.na(remir_all$inter_benefit1_nat),
  remir_all$inter_benefit2_nat, remir_all$inter_benefit1_nat)
tabyl(remir_all$inter_benefit12_nat)
############# What Nativity Subgroups Were Examined ####################

## Change Subgroup Examined Variable Names
names(remir_all)[71] <- "subg_examine1_nat"
names(remir_all)[128] <- "subg_examine2_nat"
table(remir_all$subg_examine1_nat, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Subgroups Examined
remir_all$subg_examine12_nat <- ifelse(is.na(remir_all$subg_examine1_nat),
  remir_all$subg_examine2_nat, remir_all$subg_examine1_nat)
tabyl(remir_all$subg_examine12_nat)
############## What Nativity Subgroups Were Significant ##############################

## Change Subgroup Significant Variable Names 
names(remir_all)[73] <- "subg_signif1_nat"
names(remir_all)[130] <- "subg_signif2_nat"
table(remir_all$subg_signif1_nat, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_signif2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Significant
remir_all$subg_signif12_nat <- ifelse(is.na(remir_all$subg_signif1_nat),
  remir_all$subg_signif2_nat, remir_all$subg_signif1_nat)
tabyl(remir_all$subg_signif12_nat)
## INTERACTION NATIVITY EXAMINED
tabyl(remir_all$inter_examine12_nat)
## SUBGROUP NATIVITY EXAMINED
tabyl(remir_all$subg_examine12_nat)
## INTERACTION NATIVITY BENEFITTED
tabyl(remir_all$inter_benefit12_nat)
## SUBGROUP NATIVITY BENEFITTED
tabyl(remir_all$subg_signif12_nat)
# Nativity
tabyl(remir_all, inter_examine12_nat, subg_examine12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_nat_short <-
  ifelse(is.na(remir_all$inter_examine12_nat) & 
         is.na(remir_all$subg_examine12_nat), 'None',
  ifelse(remir_all$inter_examine12_nat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_nat_short)
## Race
tabyl(remir_all, inter_examine12_race_cat, subg_examine12_race_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_race_short <-
  ifelse(is.na(remir_all$inter_examine12_race_cat) & 
         is.na(remir_all$subg_examine12_race_cat), 'None',
  ifelse(remir_all$inter_examine12_race_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_race_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_race_short <- ifelse(
  is.na(remir_all$examine12_race_short), 'Yes', remir_all$examine12_race_short)
tabyl(remir_all$examine12_race_short)
## Ethnicity
## Change Inteaction Examined Variable Names 
names(remir_all)[18] <- "inter_examine1_ethnic"
names(remir_all)[84] <- "inter_examine2_ethnic"
table(remir_all$inter_examine1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/majority     Minority/Majority 
##                     5                     2                     1 
##        White/Minority       White/Non-White                  <NA> 
##                     3                     1                   280
table(remir_all$inter_examine2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                    14                     5                     2 
##        White/Minority           White/Other                  <NA> 
##                     1                     1                   269
## Combine Two Tnteractions Examined
remir_all$inter_examine12_ethnic <- ifelse(is.na(remir_all$inter_examine1_ethnic),
  remir_all$inter_examine2_ethnic, remir_all$inter_examine1_ethnic)
tabyl(remir_all$inter_examine12_ethnic)
tabyl(remir_all, inter_examine12_ethnic_cat, subg_examine12_ethnic_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_ethnic_short <-
  ifelse(is.na(remir_all$inter_examine12_ethnic_cat) & 
         is.na(remir_all$subg_examine12_ethnic_cat), 'None',
  ifelse(remir_all$inter_examine12_ethnic_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_ethnic_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_ethnic_short <- ifelse(
  is.na(remir_all$examine12_ethnic_short), 'Yes', remir_all$examine12_ethnic_short)
tabyl(remir_all$examine12_ethnic_short)
names(remir_us)[18] <- "inter_examine1_ethnic"
names(remir_us)[84] <- "inter_examine2_ethnic"
table(remir_us$inter_examine1_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/majority     Minority/Majority 
##                     5                     2                     1 
##        White/Minority       White/Non-White                  <NA> 
##                     3                     1                   228
table(remir_us$inter_examine2_ethnic, useNA = "always")
## 
## Hispanic/Non-Hispanic     Minority/Majority                  None 
##                    14                     5                     2 
##        White/Minority           White/Other                  <NA> 
##                     1                     1                   217
## Combine Two Interactions Examined
remir_us$inter_examine12_ethnic <- ifelse(is.na(remir_us$inter_examine1_ethnic),
  remir_us$inter_examine2_ethnic, remir_us$inter_examine1_ethnic)
tabyl(remir_us$inter_examine12_ethnic)
remir_us$inter_examine12_ethnic_cat <-
  car::recode(remir_us$inter_examine12_ethnic, "
  'Hispanic/Non-Hispanic' = 'Exact';
  'None' = NA ")
tabyl(remir_us$inter_examine12_ethnic_cat)
## Second, remaining categores are assigned as mixed
remir_us$inter_examine12_ethnic_cat <-
  ifelse(remir_us$inter_examine12_ethnic_cat != "Exact", "Mixed",
     remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us$inter_examine12_ethnic_cat)
## Check -- Looks OK
tabyl(remir_us, inter_examine12_ethnic, inter_examine12_ethnic_cat)
names(remir_us)[51] <- "subg_examine1_ethnic"
names(remir_us)[88] <- "subg_examine2_ethnic"
table(remir_us$subg_examine1_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic                  <NA> 
##                     6                     1                   233
table(remir_us$subg_examine2_ethnic, useNA = "always")
## 
##              Hispanic Hispanic;Non-Hispanic              Minority 
##                    12                     3                     2 
##    Minority; Majority                  None                  <NA> 
##                     2                     4                   217
remir_us$subg_examine12_ethnic <- ifelse(is.na(remir_us$subg_examine1_ethnic),
  remir_us$subg_examine2_ethnic, remir_us$subg_examine1_ethnic)
tabyl(remir_us$subg_examine12_ethnic)
remir_us$subg_examine12_ethnic_cat <-
  ifelse(remir_us$subg_examine12_ethnic == 'Minority'|
          remir_us$subg_examine12_ethnic == 'Minority; Majority',
    'Mixed', 
  ifelse(remir_us$subg_examine12_ethnic == 'None', NA,
    'Exact'))
## Check -- Looks OK
tabyl(remir_us$subg_examine12_ethnic_cat)
tabyl(remir_us, subg_examine12_ethnic, subg_examine12_ethnic_cat)
## SEPARATE OUT HOMOGENEOUS SAMPLE OF HISPANICS
tabyl(remir_us$inter_examine12_ethnic_cat)
remir_us$inter_examine12_ethnic_cat <- ifelse(
                        (remir_us$hisp_all > .75) &
                        is.na(remir_us$inter_examine12_ethnic_cat) &
                        is.na(remir_us$subg_examine12_ethnic_cat), 
      "Homog", remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us$inter_examine12_ethnic_cat)
tabyl(remir_us, inter_examine12_ethnic, inter_examine12_ethnic_cat)
tabyl(remir_us, inter_examine12_ethnic_cat, subg_examine12_ethnic_cat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_us$examine12_ethnic_short <-
  ifelse(is.na(remir_us$inter_examine12_ethnic_cat) & 
         is.na(remir_us$subg_examine12_ethnic_cat), 'None',
  ifelse(remir_us$inter_examine12_ethnic_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_us$examine12_ethnic_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_us$examine12_ethnic_short <- ifelse(
  is.na(remir_us$examine12_ethnic_short), 'Yes', remir_us$examine12_ethnic_short)
tabyl(remir_us$examine12_ethnic_short)
## Gender
tabyl(remir_all, inter_examine12_gender, subg_examine12_gender) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_gender_short <-
  ifelse(is.na(remir_all$inter_examine12_gender) & 
         is.na(remir_all$subg_examine12_gender), 'None',
  ifelse(remir_all$inter_examine12_gender == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_gender_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_gender_short <- ifelse(
  is.na(remir_all$examine12_gender_short), 'Yes', remir_all$examine12_gender_short)
tabyl(remir_all$examine12_gender_short)
## Sex 
names(remir_all)[59] <- "subg_examine1_sex"
names(remir_all)[104] <- "subg_examine2_sex"
table(remir_all$subg_examine1_sex, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_examine2_sex, useNA = "always")
## 
## <NA> 
##  292
remir_all$subg_examine12_sex <- ifelse(is.na(remir_all$subg_examine1_sex),
  remir_all$subg_examine2_sex, remir_all$subg_examine1_sex)
tabyl(remir_all$subg_examine12_sex)
names(remir_all)[27] <- "inter_examine1_sex"
names(remir_all)[100] <- "inter_examine2_sex"
table(remir_all$inter_examine1_sex, useNA = "always")
## 
##   No  Yes <NA> 
##   51    2  239
table(remir_all$inter_examine2_sex, useNA = "always")
## 
## <NA> 
##  292
remir_all$inter_examine12_sex <- ifelse(is.na(remir_all$inter_examine1_sex),
  remir_all$inter_examine2_sex, remir_all$inter_examine1_sex)
tabyl(remir_all$inter_examine12_sex)
tabyl(remir_all, inter_examine12_sex, subg_examine12_sex) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_sex_short <-
  ifelse(is.na(remir_all$inter_examine12_sex), 'No', 
    remir_all$inter_examine12_sex)
tabyl(remir_all$examine12_sex_short)
## SES 
tabyl(remir_all, inter_examine12_ses_cat, subg_examine12_ses) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_ses_short <-
  ifelse(is.na(remir_all$inter_examine12_ses_cat) & 
         is.na(remir_all$subg_examine12_ses), 'None',
  ifelse(remir_all$inter_examine12_ses_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_ses_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_ses_short <- ifelse(
  is.na(remir_all$examine12_ses_short), 'Yes', remir_all$examine12_ses_short)
tabyl(remir_all$examine12_ses_short)
## Location 
tabyl(remir_all, inter_examine12_loc, subg_examine12_loc) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_loc_short <-
  ifelse(is.na(remir_all$inter_examine12_loc) & 
         is.na(remir_all$subg_examine12_loc), 'None',
  ifelse(remir_all$inter_examine12_loc == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_loc_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_loc_short <- ifelse(
  is.na(remir_all$examine12_loc_short), 'Yes', remir_all$examine12_loc_short)
tabyl(remir_all$examine12_loc_short)
## Nativity
names(remir_all)[41] <- "inter_examine1_nat"
names(remir_all)[124] <- "inter_examine2_nat"
table(remir_all$inter_examine1_nat, useNA = "always")
## 
## Immigrant/Nonimmigrant                   <NA> 
##                      1                    291
table(remir_all$inter_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Tnteractions Examined
remir_all$inter_examine12_nat <- ifelse(is.na(remir_all$inter_examine1_nat),
  remir_all$inter_examine2_nat, remir_all$inter_examine1_nat)
tabyl(remir_all$inter_examine12_nat)
names(remir_all)[71] <- "subg_examine1_nat"
names(remir_all)[128] <- "subg_examine2_nat"
table(remir_all$subg_examine1_nat, useNA = "always")
## 
## <NA> 
##  292
table(remir_all$subg_examine2_nat, useNA = "always")
## 
## <NA> 
##  292
## Combine Two Subgroups Examined
remir_all$subg_examine12_nat <- ifelse(is.na(remir_all$subg_examine1_nat),
  remir_all$subg_examine2_nat, remir_all$subg_examine1_nat)
tabyl(remir_all$subg_examine12_nat)
tabyl(remir_all, inter_examine12_nat, subg_examine12_nat) %>% 
  adorn_percentages("all") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
remir_all$examine12_nat_short <-
  ifelse(is.na(remir_all$inter_examine12_nat) & 
         is.na(remir_all$subg_examine12_nat), 'None',
  ifelse(remir_all$inter_examine12_nat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_nat_short)

IX. Online Supplemental Table 4: Proportions Testing for Subgroup Effects by Period of Time (Early Period and Late Period) by Subgroup

tabyl(remir_all$Citation.Year)
remir_all$dyear <- ifelse(remir_all$Citation.Year <= 2016,0,1)
tabyl(remir_all, Citation.Year, dyear)
tabyl(remir_all, dyear)
tabyl(remir_us$Citation.Year)
remir_us$dyear <- ifelse(remir_us$Citation.Year <= 2016,0,1)
tabyl(remir_us, Citation.Year, dyear)
tabyl(remir_us, dyear)
remir_all$examine12_ethnic_short <-
  ifelse(is.na(remir_all$inter_examine12_ethnic_cat) & 
         is.na(remir_all$subg_examine12_ethnic_cat), 'None',
  ifelse(remir_all$inter_examine12_ethnic_cat == 'Homog', 'Homog', 'Yes'))
tabyl(remir_all$examine12_ethnic_short)
## Fix remaining NAs -- Should be yes since they are missing for one test only
remir_all$examine12_ethnic_short <- ifelse(
  is.na(remir_all$examine12_ethnic_short), 'Yes', remir_all$examine12_ethnic_short)
tabyl(remir_all$examine12_ethnic_short)
## Test for Relationship Between Examined and Year 
tabyl(remir_all,examine12_race_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_race_short, remir_all$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_race_short and remir_all$dyear
## X-squared = 7.425, df = 2, p-value = 0.02442
################ ETHNICTY ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all,examine12_ethnic_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_ethnic_short, remir_all$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_ethnic_short and remir_all$dyear
## X-squared = 16.151, df = 2, p-value = 0.0003111
################ GENDER ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all,examine12_gender_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_gender_short, remir_all$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_gender_short and remir_all$dyear
## X-squared = 2.9677, df = 2, p-value = 0.2268
################ SEX ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all,examine12_sex_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_sex_short, remir_all$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_sex_short and remir_all$dyear
## X-squared = 3.19, df = 1, p-value = 0.07409
################ SES ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all,examine12_ses_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_ses_short, remir_all$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_ses_short and remir_all$dyear
## X-squared = 0.19515, df = 2, p-value = 0.907
################ Location ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all,examine12_loc_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_loc_short, remir_all$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_loc_short and remir_all$dyear
## X-squared = 2.5602, df = 1, p-value = 0.1096
################ Nativity ##################

## Test for Relationship Between Examined and Year
tabyl(remir_all, examine12_nat_short, dyear) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_all$examine12_nat_short, remir_all$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_all$examine12_nat_short and remir_all$dyear
## X-squared = 0.63345, df = 1, p-value = 0.4261
## Test for Relationship Between Examined and Year 
tabyl(remir_us,examine12_race_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_race_short, remir_us$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_race_short and remir_us$dyear
## X-squared = 7.4228, df = 2, p-value = 0.02444
################ ETHNICTY ##################

## Test for Relationship Between Examined and Year
tabyl(remir_us,examine12_ethnic_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_ethnic_short, remir_us$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_ethnic_short and remir_us$dyear
## X-squared = 16.564, df = 2, p-value = 0.000253
################ GENDER ##################

## Test for Relationship Between Examined and Year
remir_us <- remir_all %>% filter(country == "USA")
tabyl(remir_us,examine12_gender_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_gender_short, remir_us$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_gender_short and remir_us$dyear
## X-squared = 1.5242, df = 2, p-value = 0.4667
################ SEX ##################

## Test for Relationship Between Examined and Year
tabyl(remir_us,examine12_sex_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_sex_short, remir_us$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_sex_short and remir_us$dyear
## X-squared = 3.1879, df = 1, p-value = 0.07419
################ SES ##################

## Test for Relationship Between Examined and Year
tabyl(remir_us,examine12_ses_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_ses_short, remir_us$dyear, correct=FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_ses_short and remir_us$dyear
## X-squared = 1.5377, df = 2, p-value = 0.4635
################ Location ##################

## Test for Relationship Between Examined and Year
tabyl(remir_us,examine12_loc_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_loc_short, remir_us$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_loc_short and remir_us$dyear
## X-squared = 2.5735, df = 1, p-value = 0.1087
################ Nativity ##################

## Test for Relationship Between Examined and Year
tabyl(remir_us, examine12_nat_short, dyear) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us$examine12_nat_short, remir_us$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us$examine12_nat_short and remir_us$dyear
## X-squared = 0.6353, df = 1, p-value = 0.4254
################ SUB RELATIONSHIP WITH YEAR ##################

## RECREATE SUBGROUP DATA FRAME
remir_us_subgroup <- remir_us %>% filter(!is.na(method))
dim(remir_us_subgroup)
## [1] 100 329
## RACE 
## Test for Relationship Between Examined and Year 
tabyl(remir_us_subgroup,examine12_race_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_race_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_race_short and remir_us_subgroup$dyear
## X-squared = 6.0621, df = 2, p-value = 0.04826
## ETHNICTY
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup,examine12_ethnic_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_ethnic_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_ethnic_short and remir_us_subgroup$dyear
## X-squared = 4.2895, df = 2, p-value = 0.1171
## GENDER 
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup,examine12_gender_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_gender_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_gender_short and remir_us_subgroup$dyear
## X-squared = 4.7829, df = 2, p-value = 0.0915
## SEX 
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup,examine12_sex_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_sex_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_sex_short and remir_us_subgroup$dyear
## X-squared = 2.7053, df = 1, p-value = 0.1
## SES 
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup,examine12_ses_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_ses_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_ses_short and remir_us_subgroup$dyear
## X-squared = 1.3173, df = 2, p-value = 0.5176
## Location 
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup,examine12_loc_short, dyear ) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_loc_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_loc_short and remir_us_subgroup$dyear
## X-squared = 3.1433, df = 1, p-value = 0.07624
## Nativity 
## Test for Relationship Between Examined and Year
tabyl(remir_us_subgroup, examine12_nat_short, dyear) %>% 
  adorn_percentages("col") %>% adorn_pct_formatting(rounding = "half up", digits = 1)
chisq.test(remir_us_subgroup$examine12_nat_short, remir_us_subgroup$dyear, correct=FALSE)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  remir_us_subgroup$examine12_nat_short and remir_us_subgroup$dyear
## X-squared = 0.76201, df = 1, p-value = 0.3827

X. Online Supplemental Table 5: Proportions Registering Prospectively and Retrospectively with and without Subgroup Registration for Sub-Analysis Sample

# About Online Supplemental Table 5: Proportions Registering Prospectively and Retrospectively with and without Subgroup Registration for Sub-Analysis Sample

## a, c Tested for one or more of the following subgroups: race, ethnicity, gender, sexual identity, economic disadvantage, location (rural, urban, suburban), nativity status (foreign-born – yes/no). 

## b Registered prospectively means that study participants were enrolled and the study was documented in a public registry before the outcomes relevant to the study’s objectives were known or analyzed. This practice enhances the reliability and credibility of research findings by ensuring transparency and reducing the potential for bias. 

## d Registered retrospectively means that the study was entered into a public registry after data collection had started or after the study was completed. While retrospective registration provides transparency post-facto, it is generally considered less desirable than prospective registration because it can introduce bias. For example, researchers might selectively report outcomes or change their analysis plan based on the data collected, potentially compromising the study's scientific integrity. 
remir_us_subgroup <- remir_all %>% filter(country == "USA" & ! is.na(method))
## Use method variable for studies examining subgroup effects

## FULL SAMPLE
tabyl(remir_us_subgroup, reg, prereg)
tabyl(remir_us_subgroup, prereg, prereg_subg)
## Recode unclear to No for subg
tabyl(remir_us_subgroup, prereg_subg)
remir_us_subgroup$prereg_subg <- ifelse(remir_us_subgroup$prereg_subg == 'Unclear', 'No', remir_us_subgroup$prereg_subg)
tabyl(remir_us_subgroup, prereg_subg)
## Add new categories to preregister 
remir_us_subgroup$prereg_all <- ifelse(remir_us_subgroup$reg == 'Yes' & 
    remir_us_subgroup$prereg == 'Yes' & remir_us_subgroup$prereg_subg == 'Yes', 1,
  ifelse(remir_us_subgroup$reg == 'Yes' & 
    remir_us_subgroup$prereg == 'Yes' & remir_us_subgroup$prereg_subg == 'No', 2,
  ifelse(remir_us_subgroup$reg == 'Yes' & 
    remir_us_subgroup$prereg == 'No' & remir_us_subgroup$prereg_subg == 'Yes', 3,
  ifelse(remir_us_subgroup$reg == 'Yes' & 
    remir_us_subgroup$prereg == 'No' & remir_us_subgroup$prereg_subg == 'No', 4,
  ifelse(remir_us_subgroup$reg == 'No', 5, NA)))))
tabyl(remir_us_subgroup$prereg_all)
# Assigning labels to the 'prereg_all' variable
remir_us_subgroup$prereg_all <- factor(remir_us_subgroup$prereg_all, levels = c(1, 2, 3, 4, 5),
                               labels = c("Registered Prospectively with Subgroup",
                                          "Registered Prospectively without Subgroup",
                                          "Registered Retrospectively with Subgroup",
                                          "Registered Retrospectively without Subgroup",
                                          "Not registered"))

# Generate the table
tab_prereg <- remir_us_subgroup %>%
  filter(!is.na(prereg_all)) %>%
  group_by(prereg_all) %>%
  summarise(Frequency = n()) %>%
  mutate(Proportion = round(Frequency / sum(Frequency), 3))
tab_prereg <- bind_rows(tab_prereg, tibble(prereg_all = "Total", Frequency = sum(tab_prereg$Frequency), Proportion = round(sum(tab_prereg$Proportion), 3)))
print(tab_prereg)
## # A tibble: 6 × 3
##   prereg_all                                  Frequency Proportion
##   <chr>                                           <int>      <dbl>
## 1 Registered Prospectively with Subgroup              1       0.01
## 2 Registered Prospectively without Subgroup           1       0.01
## 3 Registered Retrospectively with Subgroup            6       0.06
## 4 Registered Retrospectively without Subgroup        15       0.15
## 5 Not registered                                     77       0.77
## 6 Total                                             100       1

XI. Figure 1

################### FOR PRISMA DIAGRAM FIGURE 1 ################

## Number of Programs - Full sample (N = 292)
length(unique(remir_all$Program.ID))
## [1] 111
## Number of Studies - Full sample (N = 292)
length(unique(remir_all$Study.ID))
## [1] 172
## Number of Citations - Full sample (N = 292)
length(unique(remir_all$Citation.ID))
## [1] 292
# Records Excluded
1598-111 # Programs
## [1] 1487
2955-172 # Studies
## [1] 2783
4176-292 # Reports
## [1] 3884
# Analysis Sample - US Studies (N = 240)

## Number of Programs - US Studies (N = 240)
length(unique(remir_us$Program.ID))
## [1] 97
## Number of Studies - US Studies (N = 240)
length(unique(remir_us$Study.ID))
## [1] 140
## Number of Citations - US Studies (N = 240)
length(unique(remir_us$Citation.ID))
## [1] 240
## Non-US Studies
111-97
## [1] 14
172-140
## [1] 32
292-240 
## [1] 52
# US Studies with Subgroup Effects (N = 100)

## Number of Programs - US Subgroup (N = 100)
length(unique(remir_us_subgroup$Program.ID))
## [1] 49
## Number of Studies - US Subgroup (N = 100)
length(unique(remir_us_subgroup$Study.ID))
## [1] 63
## Number of Citations - US Subgroup (N = 100)
length(unique(remir_us_subgroup$Citation.ID))
## [1] 100
97-52
## [1] 45
140-49
## [1] 91
240-63
## [1] 177