load(“/Users/nicolecolchete/Downloads/ICPSR_30263 7/DS0001/30263-0001-Data.rda”) load(file=‘/Users/nicolecolchete/Downloads/ICPSR_30263 7/DS0001/30263-0001-Data.rda’) data <-“/Users/nicolecolchete/Downloads/ICPSR_30263 7/DS0001/30263-0001-Data.rda” LSAYdata <- da30263.0001

Define the variables you want to include in the subset

variables <- c(“COHORT”, “AB29”, “RACETH”, “KA44B”, “KA48A”, “KA46D”, “KA47K”, “KA45B”, “KA43B”, “KA41P”, “KA43H”, “KA41O”, “KA41H”, “KA46J”, “KA45E”, “KA44E”, “KA41L”, “KA47J”, “KA7F”, “KA7H”, “KA7L”, “KA48O”, “KA38A”, “KA16C”, “KA19I”, “KA16I”, “KA16A”, “KA17G”,“LI12C2”, “LJ13C2”, “RSTEMM10”)

STEMidentity <- LSAYdata[, variables]

Latina <- STEMidentity[STEMidentity\(COHORT == '(2) Younger' & STEMidentity\)AB29 == ‘(1) Female’ & STEMidentity\(RACETH == '(1) Hispanic', ] Blackgirls <- STEMidentity[STEMidentity\)COHORT == ‘(2) Younger’ & STEMidentity\(AB29 == '(1) Female' & STEMidentity\)RACETH == ‘(2) Black’, ]

#DESCRIPTIVES describe(Latina) describe(Blackgirls)

#Frequency Tables

#Motivation Frequency Tables for Latinas

#Motiv. Item 1 Why No Math- Don’t Need generate_frequency_table <- function(Latina, KA44B) { freq_table <- table(Latina[“KA44B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA44B)

#Motive Item 2 Science/technology improving our lives generate_frequency_table <- function(Latina, KA48A) { freq_table <- table(Latina[“KA48A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA48A)

#Motive Item 3 Math more useful for boys generate_frequency_table <- function(Latina, KA46D) { freq_table <- table(Latina[“KA46D”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA46D)

#Motive Item 4 Need science for a good job generate_frequency_table <- function(Latina, KA47K) { freq_table <- table(Latina[“KA47K”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA47K)

#Motive Item 5 Why no science: don’t need - fall 12th grade generate_frequency_table <- function(Latina, KA45B) { freq_table <- table(Latina[“KA45B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA45B)

#Motivation Frequency Tables for Blackgirls #Motiv. Item 1 Why No Math- Don’t Need generate_frequency_table <- function(Blackgirls, KA44B) { freq_table <- table(Blackgirls[“KA44B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA44B)

#Motive Item 2 Science/technology improving our lives generate_frequency_table <- function(Blackgirls, KA48A) { freq_table <- table(Blackgirls[“KA48A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA48A)

#Motive Item 3 Math more useful for boys generate_frequency_table <- function(Blackgirls, KA46D) { freq_table <- table(Blackgirls[“KA46D”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA46D)

#Motive Item 4 Need science for a good job generate_frequency_table <- function(Blackgirls, KA47K) { freq_table <- table(Blackgirls[“KA47K”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA47K)

#Motive Item 5 Why no science: don’t need - fall 12th grade generate_frequency_table <- function(Blackgirls, KA45B) { freq_table <- table(Blackgirls[“KA45B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA45B)

#Persistence Frequency Tables for Latinas #Persistence Item #1 #KA43B-Give up when don’t understand generate_frequency_table <- function(Latina, KA43B) { freq_table <- table(Latina[“KA43B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA43B)

#Persistence Item #2 #KA41P-Like to keep struggling with problems generate_frequency_table <- function(Latina, KA41P) { freq_table <- table(Latina[“KA41P”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA41P)

#Persistence Item #3 #KA43H-Try harder if get bad grades generate_frequency_table <- function(Latina, KA43H) { freq_table <- table(Latina[“KA43H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA43H)

#Persistence Item #4 #KA41O-Don’t do more than have to - fall 12th grade generate_frequency_table <- function(Latina, KA41O) { freq_table <- table(Latina[“KA41O”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA41O)

#Persistence Item #5 #KA41H-Happier to accept conditions - fall 12th grade generate_frequency_table <- function(Latina, KA41H) { freq_table <- table(Latina[“KA41H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA41H)

#Persistence Frequency Tables for Blackgirls #Persistence Item #1 #KA43B-Give up when don’t understand generate_frequency_table <- function(Blackgirls, KA43B) { freq_table <- table(Blackgirls[“KA43B”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA43B)

#Persistence Item #2 #KA41P-Like to keep struggling with problems generate_frequency_table <- function(Blackgirls, KA41P) { freq_table <- table(Blackgirls[“KA41P”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA41P)

#Persistence Item #3 #KA43H-Try harder if get bad grades generate_frequency_table <- function(Blackgirls, KA43H) { freq_table <- table(Blackgirls[“KA43H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA43H)

#Persistence Item #4 #KA41O-Don’t do more than have to - fall 12th grade generate_frequency_table <- function(Blackgirls, KA41O) { freq_table <- table(Blackgirls[“KA41O”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA41O)

#Persistence Item #5 #KA41H-Happier to accept conditions - fall 12th grade generate_frequency_table <- function(Blackgirls, KA41H) { freq_table <- table(Blackgirls[“KA41H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA41H)

#Sense of Belonging Items for Latinas #Sense of Belonging Item #1 #KA46J-Boys better at math than girls generate_frequency_table <- function(Latina, KA46J) { freq_table <- table(Latina[“KA46J”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA46J)

#Sense of Belonging Item #2 #KA45E-Why no science: advised not to - fall 12th grade generate_frequency_table <- function(Latina, KA45E) { freq_table <- table(Latina[“KA45E”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA45E)

#Sense of Belonging Item #3 #KA44E-Why no math: advised not to - fall 12th grade generate_frequency_table <- function(Latina, KA44E) { freq_table <- table(Latina[“KA44E”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA44E)

#Sense of Belonging Item #4 #KA41L-Feel I am a failure generate_frequency_table <- function(Latina, KA41L) { freq_table <- table(Latina[“KA41L”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA41L)

#Sense of Belonging Item #5 #KA47J-Boys better at science than girls generate_frequency_table <- function(Latina, KA47J) { freq_table <- table(Latina[“KA47J”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA47J)

#Sense of Belonging Items for Blackgirls

#Sense of Belonging Item #1 #KA46J-Boys better at math than girls generate_frequency_table <- function(Blackgirls, KA46J) { freq_table <- table(Blackgirls[“KA46J”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA46J)

#Sense of Belonging Item #2 #KA45E-Why no science: advised not to - fall 12th grade generate_frequency_table <- function (Blackgirls, KA45E) { freq_table <- table(Blackgirls[“KA45E”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA45E)

#Sense of Belonging Item #3 #KA44E-Why no math: advised not to - fall 12th grade generate_frequency_table <- function(Blackgirls, KA44E) { freq_table <- table(Blackgirls[“KA44E”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA44E)

#Sense of Belonging Item #4 #KA41L-Feel I am a failure generate_frequency_table <- function(Blackgirls, KA41L) { freq_table <- table(Blackgirls[“KA41L”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA41L)

#Sense of Belonging Item #5 #KA47J-Boys better at science than girls generate_frequency_table <- function(Blackgirls, KA47J) { freq_table <- table(Blackgirls[“KA47J”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA47J)

#Trailblazing Items for Latinas #Trailblazing Item #1 #KA7F-How important: leader in community generate_frequency_table <- function(Latina, KA7F) { freq_table <- table(Latina[“KA7F”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA7F)

#Trailblazing Item #2 #KA7H-How important: changing social/economic wrong generate_frequency_table <- function(Latina, KA7H) { freq_table <- table(Latina[“KA7H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA7H)

#Trailblazing Item #3 #KA7L-How important: helping others in community generate_frequency_table <- function(Latina, KA7L) { freq_table <- table(Latina[“KA7L”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA7L)

#Trailblazing Item #4 #KA48O-Scientists work for good of humanity generate_frequency_table <- function(Latina, KA48O) { freq_table <- table(Latina[“KA48O”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA48O)

#Trailblazing Item #5 #KA38A-Science and technology cause good generate_frequency_table <- function(Latina, KA38A) { freq_table <- table(Latina[“KA38A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA38A)

#Trailblazing Items for Black girls #Trailblazing Item #1 #KA7F-How important: leader in community generate_frequency_table <- function(Blackgirls, KA7F) { freq_table <- table(Blackgirls[“KA7F”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA7F)

#Trailblazing Item #2 #KA7H-How important: changing social/economic wrong generate_frequency_table <- function(Blackgirls, KA7H) { freq_table <- table(Blackgirls[“KA7H”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA7H)

#Trailblazing Item #3 #KA7L-How important: helping others in community generate_frequency_table <- function(Blackgirls, KA7L) { freq_table <- table(Blackgirls[“KA7L”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA7L)

#Trailblazing Item #4 #KA48O-Scientists work for good of humanity generate_frequency_table <- function(Blackgirls, KA48O) { freq_table <- table(Blackgirls[“KA48O”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA48O)

#Trailblazing Item #5 #KA38A-Science and technology cause good generate_frequency_table <- function(Blackgirls, KA38A) { freq_table <- table(Blackgirls[“KA38A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA38A)

#Parental Support Items #Parental Support Items for Latinas

#Parental Support Item #1 #KA16C-Talk to parents: homework - fall 12th grade generate_frequency_table <- function(Latina, KA16C) { freq_table <- table(Latina[“KA16C”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA16C)

#Parental Support Item #2 #KA19I-Important reasons for attending college: parents want me to generate_frequency_table <- function(Latina, KA19I) { freq_table <- table(Latina[“KA19I”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA19I)

#Parental Support Item #3 #KA16I-Talk to parents: science/technology issues generate_frequency_table <- function(Latina, KA16I) { freq_table <- table(Latina[“KA16I”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA16I)

#Parental Support Item #4 #KA16A-Talk to parents: school progress generate_frequency_table <- function(Latina, KA16A) { freq_table <- table(Latina[“KA16A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA16A)

#Parental Support Item #5 # KA17G-College: parents don’t want me to go generate_frequency_table <- function(Latina, KA17G) { freq_table <- table(Latina[“KA17G”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Latina, KA17G)

#Parental Support Items for Black girls #Parental Support Item #1 #KA16C-Talk to parents: homework - fall 12th grade generate_frequency_table <- function(Blackgirls, KA16C) { freq_table <- table(Blackgirls[“KA16C”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA16C)

#Parental Support Item #2 #KA19I-Important reasons for attending college: parents want me to generate_frequency_table <- function(Blackgirls, KA19I) { freq_table <- table(Blackgirls[“KA19I”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA19I)

#Parental Support Item #3 #KA16I-Talk to parents: science/technology issues generate_frequency_table <- function(Blackgirls, KA16I) { freq_table <- table(Blackgirls[“KA16I”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA16I)

#Parental Support Item #4 #KA16A-Talk to parents: school progress generate_frequency_table <- function(Blackgirls, KA16A) { freq_table <- table(Blackgirls[“KA16A”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA16A)

#Parental Support Item #5 # KA17G-College: parents don’t want me to go generate_frequency_table <- function(Blackgirls, KA17G) { freq_table <- table(Blackgirls[“KA17G”]) freq_table <- as.data.frame(freq_table) freq_table <- freq_table %>% rename(Count = 1) freq_table <- freq_table %>% mutate(Percentage = prop.table(Freq) * 100) return(freq_table) }

generate_frequency_table(Blackgirls, KA17G)

#T-tests #Motivation Items #Converting Motivation items for Latinas to numeric #5 Motivation Items: #KA44B-Why No Math- Don’t Need (Check/not checked) #KA48A- Science/technology improving our lives (5- point likert scale) #KA46D-Math more useful for boys (5-point likert scale) #KA47K-Need science for a good job (5-point likert scale) #KA45B-Why no science: don’t need - fall 12th grade (checked/not checked) Latina\(KA44B<-c("(1) Checked"=1,"(2) Not Checked" =0)[Latina\)KA44B] Latina\(KA48A<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA48A] Latina\(KA46D<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA46D] Latina\(KA47K<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA47K] Latina\(KA45B<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latina\)KA45B] View(Latina)

#Converting Motivation items for Black Girls to numeric Blackgirls\(KA44B<-c("(1) Checked"=1,"(2) Not Checked" =0)[Blackgirls\)KA44B] Blackgirls\(KA48A<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA48A] Blackgirls\(KA46D<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA46D] Blackgirls\(KA47K<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA47K] Blackgirls\(KA45B<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirls\)KA45B] View(Blackgirls)

#T-tests for motivation #KA44B-Why No Math- Don’t Need (Check/not checked) #KA48A- Science/technology improving our lives (5- point likert scale) #KA46D-Math more useful for boys (5-point likert scale) #KA47K-Need science for a good job (5-point likert scale) #KA45B-Why no science: don’t need - fall 12th grade (checked/not checked) t_test_result <- t.test(Latina\(KA44B, Blackgirls\)KA44B) print(t_test_result) #Constant, cannot perform t-test t_test_result <- t.test(Latina\(KA48A, Blackgirls\)KA48A) print(t_test_result) t_test_result <- t.test(Latina\(KA46D, Blackgirls\)KA46D) print(t_test_result) t_test_result <- t.test(Latina\(KA47K, Blackgirls\)KA47K) print(t_test_result) t_test_result <- t.test(Latina\(KA45B, Blackgirls\)KA45B) print(t_test_result) #Constant, cannot perform t-test

#Persistence/resilience items #KA43B-Give up when don’t understand #KA41P-Like to keep struggling with problems #KA43H-Try harder if get bad grades #KA41O-Don’t do more than have to #KA41H-Happier to accept conditions

#Converting Persistence/Resilience items for Latina to numeric Latina\(KA41P<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA41P] Latina\(KA41O<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA41O] Latina\(KA41H<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA41H] Latina\(KA43B<-c("(1) Never"=1,"(2) Rarely" =2,"(3) Sometimes" =3,"(4) Often" =4, "(5) Always" =5)[Latina\)KA43B] Latina\(KA43H<-c("(1) Never"=1,"(2) Rarely" =2,"(3) Sometimes" =3,"(4) Often" =4, "(5) Always" =5)[Latina\)KA43H] View(Latina)

#Converting Persistence/Resilience items for Black Girls to numeric Blackgirls\(KA41P<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA41P] Blackgirls\(KA41O<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA41O] Blackgirls\(KA41H<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA41H] Blackgirls\(KA43B<-c("(1) Never"=1,"(2) Rarely" =2,"(3) Sometimes" =3,"(4) Often" =4, "(5) Always" =5)[Blackgirls\)KA43B] Blackgirls\(KA43H<-c("(1) Never"=1,"(2) Rarely" =2,"(3) Sometimes" =3,"(4) Often" =4, "(5) Always" =5)[Blackgirls\)KA43H] View(Blackgirls)

#T-tests for persistence/resilience items #KA43B-Give up when don’t understand #KA41P-Like to keep struggling with problems #KA43H-Try harder if get bad grades #KA41O-Don’t do more than have to #KA41H-Happier to accept conditions

t_test_result <- t.test(Latina\(KA43B, Blackgirls\)KA43B) print(t_test_result) t_test_result <- t.test(Latina\(KA41P, Blackgirls\)KA41P) print(t_test_result) t_test_result <- t.test(Latina\(KA43H, Blackgirls\)KA43H) print(t_test_result) t_test_result <- t.test(Latina\(KA41O, Blackgirls\)KA41O) print(t_test_result) t_test_result <- t.test(Latina\(KA41H, Blackgirls\)KA41H) print(t_test_result)

#Sense of Belonging Items #KA46J-Boys better at math than girls #KA45E-Why no science: advised not to #KA44E-Why no math: advised not to #KA41L-Feel I am a failure #KA47J-Boys better at science than girls

#Converting Sense of Belonging items for Latinas to numeric Latina\(KA46J<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA46J] Latina\(KA41L<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA41L] Latina\(KA47J<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA47J] Latina\(KA45E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latina\)KA45E] Latina\(KA44E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latina\)KA44E] View(Latina)

#Converting Sense of belonging items for Black Girls to numeric Blackgirls\(KA46J<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA46J] Blackgirls\(KA41L<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA41L] Blackgirls\(KA47J<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA47J] Blackgirls\(KA45E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirls\)KA45E] Blackgirls\(KA44E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirls\)KA44E]

#T-tests for Sense of Belonging Items #KA46J-Boys better at math than girls #KA45E-Why no science: advised not to #KA44E-Why no math: advised not to #KA41L-Feel I am a failure #KA47J-Boys better at science than girls

t_test_result <- t.test(Latina\(KA45E, Blackgirls\)KA45E) print(t_test_result) #Constant, cannot perform t-test t_test_result <- t.test(Latina\(KA41L, Blackgirls\)KA41L) print(t_test_result) t_test_result <- t.test(Latina\(KA47J, Blackgirls\)KA47J) print(t_test_result) t_test_result <- t.test(Latina\(KA46J, Blackgirls\)KA46J) print(t_test_result) t_test_result <- t.test(Latina\(KA44E, Blackgirls\)KA44E) print(t_test_result) #Constant, cannot perform t-test

#Trailblazing items #KA7F-How important: leader in community #KA7H-How important: changing social/economic wrong #KA7L-How important: helping others in community #KA48O-Scientists work for good of humanity #KA38A-Science and technology cause good

#Converting Trailblazing items for Latina to numeric Latina\(KA48O<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA48O] Latina\(KA38A<-c("(1) Strongly Agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Latina\)KA38A] Latina\(KA7F<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Latina\)KA7F] Latina\(KA7H<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Latina\)KA7H] Latina\(KA7L<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Latina\)KA7L] View(Latina)

#Converting Trailblazing items for Black Girls to numeric Blackgirls\(KA48O<-c("(1) Strongly agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA48O] Blackgirls\(KA38A<-c("(1) Strongly Agree"=1,"(2) Agree" =2,"(3) Not sure" =3,"(4) Disagree" =4, "(5) Strongly disagree" =5)[Blackgirls\)KA38A] Blackgirls\(KA7F<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Blackgirls\)KA7F] Blackgirls\(KA7H<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Blackgirls\)KA7H] Blackgirls\(KA7L<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Blackgirls\)KA7L] View(Blackgirls)

#T-tests for trailblazing #KA7F-How important: leader in community #KA7H-How important: changing social/economic wrong #KA7L-How important: helping others in community #KA48O-Scientists work for good of humanity #KA38A-Science and technology cause good t_test_result <- t.test(Latina\(KA7F, Blackgirls\)KA7F) print(t_test_result) t_test_result <- t.test(Latina\(KA7H, Blackgirls\)KA7H) print(t_test_result) t_test_result <- t.test(Latina\(KA7L, Blackgirls\)KA7L) print(t_test_result) t_test_result <- t.test(Latina\(KA48O, Blackgirls\)KA48O) print(t_test_result) t_test_result <- t.test(Latina\(KA38A, Blackgirls\)KA38A) print(t_test_result)

#Parental Support Items #KA16C-Talk to parents: homework #KA19I-Important reasons for attending college: parents want me to #KA16I-Talk to parents: science/technology issues #KA16A-Talk to parents: school progress #KA17G-College: parents don’t want me to go

#Converting Parental Support items for Latina to numeric Latina\(KA16C<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Latina\)KA16C] Latina\(KA16I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Latina\)KA16I] Latina\(KA16A<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Latina\)KA16A] Latina\(KA19I<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Latina\)KA19I] Latina\(KA17G<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Latina\)KA17G] View(Latina)

#Converting Parental Support items for Black Girls to numeric Blackgirls\(KA16C<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Blackgirls\)KA16C] Blackgirls\(KA16A<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Blackgirls\)KA16A] Blackgirls\(KA16I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Blackgirls\)KA16I] Blackgirls\(KA19I<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Blackgirls\)KA19I] Blackgirls\(KA17G<-c("(1) Not important"=1,"(2) Somewhat important" =2,"(3) Very important" =3)[Blackgirls\)KA17G] View(Blackgirls)

#T-tests for Parental Support #KA16C-Talk to parents: homework #KA19I-Important reasons for attending college: parents want me to #KA16I-Talk to parents: science/technology issues #KA16A-Talk to parents: school progress #KA17G-College: parents don’t want me to go

t_test_result <- t.test(Latina\(KA16C, Blackgirls\)KA16C) print(t_test_result) t_test_result <- t.test(Latina\(KA19I, Blackgirls\)KA19I) print(t_test_result) t_test_result <- t.test(Latina\(KA16I, Blackgirls\)KA16I) print(t_test_result) t_test_result <- t.test(Latina\(KA16A, Blackgirls\)KA16A) print(t_test_result) t_test_result <- t.test(Latina\(KA17G, Blackgirls\)KA17G) print(t_test_result)

#Dichotomizing variables data <-“/Users/nicolecolchete/Downloads/ICPSR_30263 7/DS0001/30263-0001-Data.rda” LSAYdata <- da30263.0001 dichotvariables <- c(“COHORT”, “AB29”, “RACETH”, “KA44B”, “KA48A”, “KA46D”, “KA47K”, “KA45B”, “KA43B”, “KA41P”, “KA43H”, “KA41O”, “KA41H”, “KA46J”, “KA45E”, “KA44E”, “KA41L”, “KA47J”, “KA7F”, “KA7H”, “KA7L”, “KA48O”, “KA38A”, “KA16C”, “KA19I”, “KA16I”, “KA16A”, “KA17G”,“LT12C2”, “LJ13C2”, “RSTEMM10”)

STEMidentity <- LSAYdata [, dicotvariables]

Latinad <- STEMidentity[STEMidentity\(COHORT == '(2) Younger' & STEMidentity\)AB29 == ‘(1) Female’ & STEMidentity\(RACETH == '(1) Hispanic', ] Blackgirlsd <- STEMidentity[STEMidentity\)COHORT == ‘(2) Younger’ & STEMidentity\(AB29 == '(1) Female' & STEMidentity\)RACETH == ‘(2) Black’, ]

View(Latinad) View(Blackgirlsd) #Dichotomizinzing variables #KA44B-Why No Math- Don’t Need (Check/not checked) #KA48A- Science/technology improving our lives (5- point likert scale) #KA46D-Math more useful for boys (5-point likert scale) #KA47K-Need science for a good job (5-point likert scale) #KA45B-Why no science: don’t need - fall 12th grade (checked/not checked)

#Dichotomizing Latina Motivation items Latinad\(KA44B<-c("(1) Checked"=1,"(2) Not Checked" =0)[Latinad\)KA44B] Latinad\(KA48A<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Latinad\)KA48A] Latinad\(KA46D<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA46D] Latinad\(KA47K<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Latinad\)KA47K] Latinad\(KA45B<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latinad\)KA45B] View(Latinad)

#Dichotomizing Black girls Motivation items Blackgirlsd\(KA44B<-c("(1) Checked"=1,"(2) Not Checked" =0)[Blackgirlsd\)KA44B] Blackgirlsd\(KA48A<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Blackgirlsd\)KA48A] Blackgirlsd\(KA46D<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA46D] Blackgirlsd\(KA47K<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Blackgirlsd\)KA47K] Blackgirlsd\(KA45B<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirlsd\)KA45B] View(Blackgirlsd)

#Persistence Items #KA43B-Give up when don’t understand #KA41P-Like to keep struggling with problems #KA43H-Try harder if get bad grades #KA41O-Don’t do more than have to #KA41H-Happier to accept conditions

#Dichotomizing Latina Persistence items Latinad\(KA41P<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Latinad\)KA41P] Latinad\(KA41O<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA41O] Latinad\(KA41H<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA41H] Latinad\(KA43B<-c("(1) Never"=1,"(2) Rarely" =1,"(3) Sometimes" =0,"(4) Often" =0, "(5) Always" =0)[Latinad\)KA43B] Latinad\(KA43H<-c("(1) Never"=0,"(2) Rarely" =0,"(3) Sometimes" =0,"(4) Often" =1, "(5) Always" =1)[Latinad\)KA43H] View(Latinad)

#Dichotomizing Black girls Persistence items Blackgirlsd\(KA41P<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Blackgirlsd\)KA41P] Blackgirlsd\(KA41O<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA41O] Blackgirlsd\(KA41H<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA41H] Blackgirlsd\(KA43B<-c("(1) Never"=1,"(2) Rarely" =1,"(3) Sometimes" =0,"(4) Often" =0, "(5) Always" =0)[Blackgirlsd\)KA43B] Blackgirlsd\(KA43H<-c("(1) Never"=0,"(2) Rarely" =0,"(3) Sometimes" =0,"(4) Often" =1, "(5) Always" =1)[Blackgirlsd\)KA43H] View(Blackgirlsd)

#Sense of Belonging Items #KA46J-Boys better at math than girls #KA45E-Why no science: advised not to #KA44E-Why no math: advised not to #KA41L-Feel I am a failure #KA47J-Boys better at science than girls

#Dichotomizing Sense of Belonging items for latinas Latinad\(KA46J<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA46J] Latinad\(KA41L<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA41L] Latinad\(KA47J<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Latinad\)KA47J] Latinad\(KA45E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latinad\)KA45E] Latinad\(KA44E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Latinad\)KA44E] View(Latinad)

#Dichotomizing Sense of Belonging items for Black girls Blackgirlsd\(KA46J<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA46J] Blackgirlsd\(KA41L<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA41L] Blackgirlsd\(KA47J<-c("(1) Strongly agree"=0,"(2) Agree" =0,"(3) Not sure" =0,"(4) Disagree" =1, "(5) Strongly disagree" =1)[Blackgirlsd\)KA47J] Blackgirlsd\(KA45E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirlsd\)KA45E] Blackgirlsd\(KA44E<-c("(1) Checked"=1,"(2) Not Checked" = 0)[Blackgirlsd\)KA44E] View(Blackgirlsd)

#Trailblazing #KA7F-How important: leader in community #KA7H-How important: changing social/economic wrong #KA7L-How important: helping others in community #KA48O-Scientists work for good of humanity #KA38A-Science and technology cause good

#Dichotomizing trailblazing items for Latinas Latinad\(KA48O<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Latinad\)KA48O] Latinad\(KA38A<-c("(1) Strongly Agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Latinad\)KA38A] Latinad\(KA7F<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Latinad\)KA7F] Latinad\(KA7H<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Latinad\)KA7H] Latinad\(KA7L<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Latinad\)KA7L] View(Latinad)

#Dichotomizing trailblazing items for Blackgirls Blackgirlsd\(KA48O<-c("(1) Strongly agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Blackgirlsd\)KA48O] Blackgirlsd\(KA38A<-c("(1) Strongly Agree"=1,"(2) Agree" =1,"(3) Not sure" =0,"(4) Disagree" =0, "(5) Strongly disagree" =0)[Blackgirlsd\)KA38A] Blackgirlsd\(KA7F<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Blackgirlsd\)KA7F] Blackgirlsd\(KA7H<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Blackgirlsd\)KA7H] Blackgirlsd\(KA7L<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Blackgirlsd\)KA7L] View(Blackgirlsd)

#Parental Support Items #KA16C-Talk to parents: homework #KA19I-Important reasons for attending college: parents want me to #KA16I-Talk to parents: science/technology issues #KA16A-Talk to parents: school progress #KA17G-College: parents don’t want me to go

#Dichotomizing parental support items for Latinas Latinad\(KA16C<-c("(1) Often"=1,"(2) Sometimes" =0,"(3) Never" =1)[Latinad\)KA16C] Latinad\(KA19I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Latinad\)KA19I] Latinad\(KA16I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Latinad\)KA16I] Latinad\(KA16A<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Latinad\)KA16A] Latinad\(KA17G<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Latinad\)KA17G] View(Latinad)

#Dichotomizing parental support items for Black Girls Blackgirlsd\(KA16C<-c("(1) Often"=1,"(2) Sometimes" =0,"(3) Never" =1)[Blackgirlsd\)KA16C] Blackgirlsd\(KA19I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Blackgirlsd\)KA19I] Blackgirlsd\(KA16I<-c("(1) Often"=1,"(2) Sometimes" =2,"(3) Never" =3)[Blackgirlsd\)KA16I] Blackgirlsd\(KA16A<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Blackgirlsd\)KA16A] Blackgirlsd\(KA17G<-c("(1) Not important"=0,"(2) Somewhat important" =0,"(3) Very important" =1)[Blackgirlsd\)KA17G] View(Blackgirlsd)

#Item by Item Correlations #KA44B-Why No Math- Don’t Need (Check/not checked) #KA48A- Science/technology improving our lives (5- point likert scale) #KA46D-Math more useful for boys (5-point likert scale) #KA47K-Need science for a good job (5-point likert scale) #KA45B-Why no science: don’t need - fall 12th grade (checked/not checked) #Motivation items correlations for Latinas corr.test(Latinad\(KA44B, Latinad\)KA48A) corr.test(Latinad\(KA44B, Latinad\)KA46D) corr.test(Latinad\(KA44B, Latinad\)KA47K) corr.test(Latinad\(KA44B, Latinad\)KA45B)

corr.test(Latinad\(KA48A, Latinad\)KA46D) corr.test(Latinad\(KA48A, Latinad\)KA47K) corr.test(Latinad\(KA48A, Latinad\)KA45B)

corr.test(Latinad\(KA46D, Latinad\)KA47K) corr.test(Latinad\(KA46D, Latinad\)KA45B)

corr.test(Latinad\(KA47K, Latinad\)KA45B)

#Motivation items correlations for Blackgirls corr.test(Blackgirlsd\(KA44B, Blackgirlsd\)KA48A) corr.test(Blackgirlsd\(KA44B, Blackgirlsd\)KA46D) corr.test(Blackgirlsd\(KA44B, Blackgirlsd\)KA47K) corr.test(Blackgirlsd\(KA44B, Blackgirlsd\)KA45B)

corr.test(Blackgirlsd\(KA48A, Blackgirlsd\)KA46D) corr.test(Blackgirlsd\(KA48A, Blackgirlsd\)KA47K) corr.test(Blackgirlsd\(KA48A, Blackgirlsd\)KA45B)

corr.test(Blackgirlsd\(KA46D, Blackgirlsd\)KA47K) corr.test(Blackgirlsd\(KA46D, Blackgirlsd\)KA45B)

corr.test(Blackgirlsd\(KA47K, Blackgirlsd\)KA45B)

#Persistence Correlations item by item #KA43B-Give up when don’t understand #KA41P-Like to keep struggling with problems #KA43H-Try harder if get bad grades #KA41O-Don’t do more than have to #KA41H-Happier to accept conditions

#correlations for Latinas corr.test(Latinad\(KA43B, Latinad\)KA41P) corr.test(Latinad\(KA43B, Latinad\)KA43H) corr.test(Latinad\(KA43B, Latinad\)KA41O) corr.test(Latinad\(KA43B, Latinad\)KA41H)

corr.test(Latinad\(KA41P, Latinad\)KA43H) corr.test(Latinad\(KA41P, Latinad\)KA41O) corr.test(Latinad\(KA41P, Latinad\)KA41H)

corr.test(Latinad\(KA43H, Latinad\)KA41O) corr.test(Latinad\(KA43H, Latinad\)KA41H)

corr.test(Latinad\(KA41O, Latinad\)KA41H)

#correlations for Black Girls corr.test(Blackgirlsd\(KA43B, Blackgirlsd\)KA41P) corr.test(Blackgirlsd\(KA43B, Blackgirlsd\)KA43H) corr.test(Blackgirlsd\(KA43B, Blackgirlsd\)KA41O) corr.test(Blackgirlsd\(KA43B, Blackgirlsd\)KA41H)

corr.test(Blackgirlsd\(KA41P, Blackgirlsd\)KA43H) corr.test(Blackgirlsd\(KA41P, Blackgirlsd\)KA41O) corr.test(Blackgirlsd\(KA41P, Blackgirlsd\)KA41H)

corr.test(Blackgirlsd\(KA43H, Blackgirlsd\)KA41O) corr.test(Blackgirlsd\(KA43H, Blackgirlsd\)KA41H)

corr.test(Blackgirlsd\(KA41O, Blackgirlsd\)KA41H)

#Item by Item correlations for Sense of Belonging #KA46J-Boys better at math than girls #KA45E-Why no science: advised not to #KA44E-Why no math: advised not to #KA41L-Feel I am a failure #KA47J-Boys better at science than girls

#Correlations for Latinas corr.test(Latinad\(KA46J, Latinad\)KA45E) corr.test(Latinad\(KA46J, Latinad\)KA44E) corr.test(Latinad\(KA46J, Latinad\)KA41L) corr.test(Latinad\(KA46J,Latinad\)KA47J)

corr.test(Latinad\(KA45E, Latinad\)KA44E) corr.test(Latinad\(KA45E, Latinad\)KA41L) corr.test(Latinad\(KA45E, Latinad\)KA47J)

corr.test(Latinad\(KA44E, Latinad\)KA41L) corr.test(Latinad\(KA44E, Latinad\)KA47J)

corr.test(Latinad\(KA41L, Latinad\)KA47J)

#Correlations for Blackgirls corr.test(Blackgirlsd\(KA46J, Blackgirlsd\)KA45E) corr.test(Blackgirlsd\(KA46J, Blackgirlsd\)KA44E) corr.test(Blackgirlsd\(KA46J, Blackgirlsd\)KA41L) corr.test(Blackgirlsd\(KA46J, Blackgirlsd\)KA47J)

corr.test(Blackgirlsd\(KA45E, Blackgirlsd\)KA44E) corr.test(Blackgirlsd\(KA45E, Blackgirlsd\)KA41L) corr.test(Blackgirlsd\(KA45E, Blackgirlsd\)KA47J)

corr.test(Blackgirlsd\(KA44E, Blackgirlsd\)KA41L) corr.test(Blackgirlsd\(KA44E, Blackgirlsd\)KA47J)

corr.test(Blackgirlsd\(KA41L, Blackgirlsd\)KA47J)

#Trailblazing Items #KA7F-How important: leader in community #KA7H-How important: changing social/economic wrong #KA7L-How important: helping others in community #KA48O-Scientists work for good of humanity #KA38A-Science and technology cause good

#Correlations for Latinas corr.test(Latinad\(KA7F, Latinad\)KA7H) corr.test(Latinad\(KA7F, Latinad\)KA7L) corr.test(Latinad\(KA7F, Latinad\)KA48O) corr.test(Latinad\(KA7F, Latinad\)KA38A)

corr.test(Latinad\(KA7H, Latinad\)KA7L) corr.test(Latinad\(KA7H, Latinad\)KA48O) corr.test(Latinad\(KA7H, Latinad\)KA38A)

corr.test(Latinad\(KA7L, Latinad\)KA48O) corr.test(Latinad\(KA7L, Latinad\)KA38A)

corr.test(Latinad\(KA48O, Latinad\)KA38A)

#Correlations for Blackgirls corr.test(Blackgirlsd\(KA7F, Blackgirlsd\)KA7H) corr.test(Blackgirlsd\(KA7F, Blackgirlsd\)KA7L) corr.test(Blackgirlsd\(KA7F, Blackgirlsd\)KA48O) corr.test(Blackgirlsd\(KA7F, Blackgirlsd\)KA38A)

corr.test(Blackgirlsd\(KA7H, Blackgirlsd\)KA7L) corr.test(Blackgirlsd\(KA7H, Blackgirlsd\)KA48O) corr.test(Blackgirlsd\(KA7H, Blackgirlsd\)KA38A)

corr.test(Blackgirlsd\(KA7L, Blackgirlsd\)KA48O) corr.test(Blackgirlsd\(KA7L, Blackgirlsd\)KA38A)

corr.test(Blackgirlsd\(KA48O, Blackgirlsd\)KA38A)

#Parental Support Items #KA16C-Talk to parents: homework #KA19I-Important reasons for attending college: parents want me to #KA16I-Talk to parents: science/technology issues #KA16A-Talk to parents: school progress #KA17G-College: parents don’t want me to go

#Correlations for Latinas corr.test(Latinad\(KA16C, Latinad\)KA19I) corr.test(Latinad\(KA16C, Latinad\)KA16I) corr.test(Latinad\(KA16C, Latinad\)KA16A) corr.test(Latinad\(KA16C, Latinad\)KA17G)

corr.test(Latinad\(KA19I, Latinad\)KA16I) corr.test(Latinad\(KA19I, Latinad\)KA16A) corr.test(Latinad\(KA19I, Latinad\)KA17G)

corr.test(Latinad\(KA16I, Latinad\)KA16A) corr.test(Latinad\(KA16I, Latinad\)KA17G)

corr.test(Latinad\(KA16A, Latinad\)KA17G)

#Correlations for Black Girls corr.test(Blackgirlsd\(KA16C, Blackgirlsd\)KA19I) corr.test(Blackgirlsd\(KA16C, Blackgirlsd\)KA16I) corr.test(Blackgirlsd\(KA16C, Blackgirlsd\)KA16A) corr.test(Blackgirlsd\(KA16C, Blackgirlsd\)KA17G)

corr.test(Blackgirlsd\(KA19I, Blackgirlsd\)KA16I) corr.test(Blackgirlsd\(KA19I, Blackgirlsd\)KA16A) corr.test(Blackgirlsd\(KA19I, Blackgirlsd\)KA17G)

corr.test(Blackgirlsd\(KA16I, Blackgirlsd\)KA16A) corr.test(Blackgirlsd\(KA16I, Blackgirlsd\)KA17G)

corr.test(Blackgirlsd\(KA16A, Blackgirlsd\)KA17G)

#Creating Compoite Scores #Motivation #KA44B-Why No Math- Don’t Need (Check/not checked) #KA48A- Science/technology improving our lives (5- point likert scale) #KA46D-Math more useful for boys (5-point likert scale) #KA47K-Need science for a good job (5-point likert scale) #KA45B-Why no science: don’t need - fall 12th grade (checked/not checked)

Latinad\(KA44B <- as.numeric(as.character(Latinad\)KA44B)) Latinad\(KA48A <- as.numeric(as.character(Latinad\)KA48A)) Latinad\(KA46D <- as.numeric(as.character(Latinad\)KA46D)) Latinad\(KA47K <- as.numeric(as.character(Latinad\)KA47K)) Latinad\(KA45B <- as.numeric(as.character(Latinad\)KA45B)) View(Latinad) Latinad[is.na(Latinad)] <- 0 str(Latinad) composite_scoreM <- (Latinad\(KA44B + Latinad\)KA48A + Latinad\(KA46D + Latinad\)KA47K + Latinad$KA45B) / 5

print(composite_scoreM)

install.packages(“dplyr”) install.packages(“purrr”)

library(dplyr) library(purrr) rmarkdown:render(“input.Rmd”)

#Composites for Latinas Latinad <- Latinad %>% rowwise() %>% mutate( motiv = ifelse(sum(!is.na(c(KA44B, KA48A, KA46D, KA47K, KA45B))) >= 1, mean(c(KA44B, KA48A, KA46D, KA47K, KA45B), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = motiv )

print(Latinad$composite_scores)

View(Latinad) #checked, and new variable called “motiv” was made

#Composites for Black girls

Blackgirlsd <- Blackgirlsd %>% rowwise() %>% mutate( motivbg = ifelse(sum(!is.na(c(KA44B, KA48A, KA46D, KA47K, KA45B))) >= 1, mean(c(KA44B, KA48A, KA46D, KA47K, KA45B), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = motivbg )

Access and print the calculated composite scores

print(Blackgirlsd$composite_scores)

View(Blackgirlsd) #checked, and new variable called “motivbg” was made

#Composites for Persistence items #KA43B-Give up when don’t understand #KA41P-Like to keep struggling with problems #KA43H-Try harder if get bad grades #KA41O-Don’t do more than have to #KA41H-Happier to accept conditions

#Compoites for Latinas

Latinad <- Latinad %>%
  rowwise() %>%
  mutate(
    persist = ifelse(sum(!is.na(c(KA43B, KA41P, KA43H, KA41O, KA41H))) >= 1,
                   mean(c(KA43B, KA41P, KA43H, KA41O, KA41H), na.rm = TRUE),
                   NA_real_)
  ) %>%
  mutate(
    composite_scores = persist
  )

# Access and print the calculated composite scores
print(Latinad$composite_scores) 

View(Latinad) #checked and new variable called “persist” was created

#composites for black girls Blackgirlsd <- Blackgirlsd %>% rowwise() %>% mutate( persistbg = ifelse(sum(!is.na(c(KA43B, KA41P, KA43H, KA41O, KA41H))) >= 1, mean(c(KA43B, KA41P, KA43H, KA41O, KA41H), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = persistbg )

Access and print the calculated composite scores

print(Blackgirlsd$composite_scores)

View(Blackgirlsd) #checked and new variable called “persistbg” was created

#Sense of belonging Composites #KA46J-Boys better at math than girls #KA45E-Why no science: advised not to #KA44E-Why no math: advised not to #KA41L-Feel I am a failure #KA47J-Boys better at science than girls

#Composites for Clack girls Blackgirlsd <- Blackgirlsd %>% rowwise() %>% mutate( belongbg = ifelse(sum(!is.na(c(KA46J, KA45E, KA44E, KA41L, KA47J))) >= 1, mean(c(KA46J, KA45E, KA44E, KA41L, KA47J), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = belongbg )

Access and print the calculated composite scores

print(Blackgirlsd$composite_scores)

View(Blackgirlsd) #checked and new variable called “belongbg” was created

#Composites for Trailblazing #KA7F-How important: leader in community #KA7H-How important: changing social/economic wrong #KA7L-How important: helping others in community #KA48O-Scientists work for good of humanity #KA38A-Science and technology cause good

#Composites for Latinas Latinad <- Latinad %>% rowwise() %>% mutate( trail = ifelse(sum(!is.na(c(KA7F, KA7H, KA7L, KA48O, KA38A))) >= 1, mean(c(KA7F, KA7H, KA7L, KA48O, KA38A), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = trail )

Access and print the calculated composite scores

print(Latinad$composite_scores)

View(Latinad) #checked and the variable “trail” was created

#Composites for Black Girls

Blackgirlsd <- Blackgirlsd %>% rowwise() %>% mutate( trailbg = ifelse(sum(!is.na(c(KA7F, KA7H, KA7L, KA48O, KA38A))) >= 1, mean(c(KA7F, KA7H, KA7L, KA48O, KA38A), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = trailbg )

Access and print the calculated composite scores

print(Blackgirlsd $composite_scores)

View(Blackgirlsd) #checked and the variable “trailbg” was created

#Parental Support Composites #KA16C-Talk to parents: homework #KA19I-Important reasons for attending college: parents want me to #KA16I-Talk to parents: science/technology issues #KA16A-Talk to parents: school progress #KA17G-College: parents don’t want me to go

#Composites for Latinas Latinad <- Latinad %>% rowwise() %>% mutate( parent = ifelse(sum(!is.na(c(KA7F, KA7H, KA7L, KA48O, KA38A))) >= 1, mean(c(KA7F, KA7H, KA7L, KA48O, KA38A), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = parent )

Access and print the calculated composite scores

print(Latinad$composite_scores)

View(Latinad) #checked and the variable “parent” was created

#Composites for Latinas Blackgirlsd <- Blackgirlsd %>% rowwise() %>% mutate( parentbg = ifelse(sum(!is.na(c(KA7F, KA7H, KA7L, KA48O, KA38A))) >= 1, mean(c(KA7F, KA7H, KA7L, KA48O, KA38A), na.rm = TRUE), NA_real_) ) %>% mutate( composite_scores = parentbg )

Access and print the calculated composite scores

print(Blackgirlsd$composite_scores)

View(Blackgirlsd) #checked and the variable “parent” was created

#Correlations with composite scores #Latinas #motiv, persist, trail, belong, trail, parent

#Motiv corr.test(Latinad\(motiv, Latinad\)persist) corr.test(Latinad\(motiv, Latinad\)trail) corr.test(Latinad\(motiv, Latinad\)belong) corr.test(Latinad\(motiv, Latinad\)parent)

#Persist corr.test(Latinad\(persist, Latinad\)trail) corr.test(Latinad\(persist, Latinad\)belong) corr.test(Latinad\(persist, Latinad\)parent)

#Trail corr.test(Latinad\(trail, Latinad\)belong) corr.test(Latinad\(trail, Latinad\)parent)

#Belong corr.test(Latinad\(belong, Latinad\)parent)

#Black girls #motiv, persist, trail, belong, trail, parent

#Motiv corr.test(Blackgirlsd\(motivbg, Blackgirlsd\)persistbg) corr.test(Blackgirlsd\(motivbg, Blackgirlsd\)trailbg) corr.test(Blackgirlsd\(motivbg, Blackgirlsd\)belongbg) corr.test(Blackgirlsd\(motivbg, Blackgirlsd\)parentbg)

#Persist corr.test(Blackgirlsd\(persistbg, Blackgirlsd\)trailbg) corr.test(Blackgirlsd\(persistbg, Blackgirlsd\)belongbg) corr.test(Blackgirlsd\(persistbg, Blackgirlsd\)parentbg)

#Trail corr.test(Blackgirlsd\(trailbg, Blackgirlsd\)belongbg) corr.test(Blackgirlsd\(trailbg, Blackgirlsd\)parentbg)

#Belong corr.test(Blackgirlsd\(belongbg, Blackgirlsd\)parentbg)

#t-tests with composites ##motiv, persist, trail, belong, trail, parent #Latinas t_test_result <- t.test(Latinad\(motiv, Blackgirlsd\)motivbg) print(t_test_result) t_test_result <- t.test(Latinad\(persist, Blackgirlsd\)persistbg) print(t_test_result) t_test_result <- t.test(Latinad\(trail, Blackgirlsd\)trailbg) print(t_test_result) t_test_result <- t.test(Latinad\(belong, Blackgirlsd\)belongbg) print(t_test_result) t_test_result <- t.test(Latinad\(parent, Blackgirlsd\)parentbg) print(t_test_result)

#Regression