Author

Margaret Gatongi

Load and run libraries

Code
library(tidyverse)
library(ggplot2)
library(lavaan)
library(Hmisc)
library(haven)
library(dplyr)
library(naniar)
library(visdat)
library(corrr)

Load in data

Code
fifedata <- read_sav("Fife data.sav")
view(fifedata)

Data Cleaning: Remove empty rows

Code
fifedata.clean <- fifedata %>%
   slice_head(n = 468)

Data Cleaning: View data

Code
view(fifedata.clean)

Summarize Missing Data

Code
naniar::miss_var_summary(fifedata.clean)
# A tibble: 272 × 3
   variable             n_miss pct_miss
   <chr>                 <int>    <num>
 1 ParentEducation         468    100  
 2 SemanticsMath           173     37.0
 3 SemanticsEngineering    142     30.3
 4 Q7_3R                   138     29.5
 5 Q7_4R                   132     28.2
 6 SemanticsScience        131     28.0
 7 SemanticsTechnology     120     25.6
 8 SemanticsJobInSTEM      118     25.2
 9 Q7_2R                   110     23.5
10 Q8_1R                   106     22.6
# ℹ 262 more rows

Visualize missing data

Code
library(visdat)
vis_miss(fifedata.clean)

Pairwise comparisons for missing data (ACOPE Vs. CERQ)

Code
library(naniar)
ggplot(data = fifedata.clean, mapping = aes(x = ACOPE, y = CERQTotal)) + 
  geom_miss_point() 

Pairwise comparisons for missing data (ACOPE Vs. Social Support)

Code
ggplot(data = fifedata.clean, mapping = aes(x = ACOPE, y = QFSSSTotal)) + 
  geom_miss_point() 

Pairwise comparisons for missing data (ACOPE Vs. STEM Semantics)

Code
ggplot(data = fifedata.clean, mapping = aes(x = ACOPE, y = SemanticsTotal)) + 
  geom_miss_point() 

Pairwise comparisons for missing data (ACOPE Vs. S-STEM)

Code
ggplot(data = fifedata.clean, mapping = aes(x = ACOPE, y = SSTEMTotal)) + 
  geom_miss_point() 

Data Cleaning: Convert categorical variables from numeric to factors

Code
fifedata.clean <- fifedata.clean %>%
  mutate(.,
         race.fac = as_factor(Race),
         gender.fac = as_factor(Gender),
         grade.fac = as_factor(Grade),
         dailylife = DailyLifeExperiences,
         fear = FearOfCalamity)
view(fifedata.clean)

Glimpse data

Code
glimpse(fifedata.clean)
Rows: 468
Columns: 277
$ Q26                        <chr> "Prefer not to say", "Male", "Male", "Femal…
$ Q27                        <chr> "Other", "Black or African American", "Whit…
$ Q28                        <chr> "8th", "8th", "8th", "7th", "7th", "7th", "…
$ Q29                        <chr> "High School", "Master's, Ph.D., M.D., J.D.…
$ Q1_1                       <dbl> 2, 3, 5, 5, 2, 4, 4, 3, 2, 1, 3, 2, 3, 4, 5…
$ Q1_1R                      <dbl> 4, 3, 1, 1, 4, 2, 2, 3, 4, 5, 3, 4, 3, 2, 1…
$ Q1_2                       <dbl> 1, 3, 1, 2, 2, 4, 3, 1, 4, 2, 3, 1, 2, 1, 1…
$ Q1_3                       <dbl> 3, 3, 5, 1, 3, 4, 3, 1, 2, 2, 3, 4, 4, 5, 5…
$ Q1_3R                      <dbl> 3, 3, 1, 5, 3, 2, 3, 5, 4, 4, 3, 2, 2, 1, 1…
$ Q1_4                       <dbl> 3, 4, 2, 5, 4, 2, 2, 1, 4, 4, 3, 3, 1, 1, 1…
$ Q1_5                       <dbl> 2, 4, 4, 2, 1, 5, 5, 3, 2, 3, 3, 3, 3, 1, 1…
$ Q1_5R                      <dbl> 4, 2, 2, 4, 5, 1, 1, 3, 4, 3, 3, 3, 3, 5, 5…
$ Q1_6                       <dbl> 4, 2, 3, 5, 3, 3, 4, 1, 2, 1, 3, 3, 4, 5, 1…
$ Q1_7                       <dbl> 5, 4, 4, 5, 5, 5, 5, 4, 4, 5, 3, 4, 2, 4, 1…
$ Q1_8                       <dbl> 4, 3, 1, 5, 3, 3, 3, 3, 4, 4, 3, 4, 1, 3, 1…
$ Q2_1                       <dbl> 3, 4, 4, 4, 2, 2, 2, 2, 3, 4, 3, 3, 1, 5, 3…
$ Q2_2                       <dbl> 1, 3, 3, 1, 1, 1, 3, 2, 2, 1, 3, 4, 1, 2, 1…
$ Q2_3                       <dbl> 1, 5, 3, 2, 2, 1, 2, 2, 2, 1, 3, 5, 1, 3, 1…
$ Q2_4                       <dbl> 1, 4, 3, 3, 3, 4, 4, 2, 3, 1, 3, 4, 1, 2, 1…
$ Q2_5                       <dbl> 1, 5, 2, 2, 2, 2, 3, 2, 3, 1, 3, 3, 1, 3, 1…
$ Q2_6                       <dbl> 1, 4, 3, 3, 3, 2, 4, 2, 2, 1, 3, 3, 1, 4, 3…
$ Q2_7                       <dbl> 3, 4, 4, 3, 2, 2, 3, 2, 3, 1, 3, 3, 1, 3, 1…
$ Q2_8                       <dbl> 5, 3, 5, 3, 3, 1, 3, 2, 2, 4, 3, 4, 1, 5, 5…
$ Q2_8R                      <dbl> 1, 3, 1, 3, 3, 5, 3, 4, 4, 2, 3, 2, 5, 1, 1…
$ Q2_9                       <dbl> 2, 2, 2, 1, 2, 1, 3, 2, 3, 1, 3, 4, 1, 2, 1…
$ Q3_1                       <dbl> 2, 5, 4, 3, 4, 1, 5, 2, 2, 4, 4, 2, 1, 1, 3…
$ Q3_2                       <dbl> 4, 4, 4, 2, 5, 1, 4, 2, 2, 2, 4, 3, 1, 3, 1…
$ Q3_3                       <dbl> 3, 3, 4, 1, 3, 2, 3, 2, 2, 2, 4, 3, 1, 1, 2…
$ Q3_4                       <dbl> 2, 4, 5, 1, 2, 3, 4, 2, 2, 2, 4, 4, 1, 3, 1…
$ Q3_5                       <dbl> 1, 4, 3, 1, 1, 2, 3, 2, 4, 1, 4, 2, 1, 3, 3…
$ Q3_6                       <dbl> 1, 5, 5, 1, 2, 3, 5, 2, 2, 2, 4, 2, 1, 4, 1…
$ Q3_7                       <dbl> 2, 5, 5, 1, 4, 3, 3, 2, 4, 1, 4, 3, 1, 4, 1…
$ Q3_8                       <dbl> 5, 4, 3, 1, 4, 3, 5, 2, 2, 1, 4, 1, 1, 3, 1…
$ Q3_9                       <dbl> 1, 3, 4, 1, 3, 3, 1, 2, 2, 1, 4, 2, 1, 3, 3…
$ Q4_1                       <dbl> 3, 4, 4, 2, 4, 4, 5, 2, 2, 4, 3, 5, 3, 1, 5…
$ Q4_2                       <dbl> 5, 5, 5, 4, 5, 3, 4, 2, 2, 4, 3, 4, 3, 5, 5…
$ Q4_3                       <dbl> 3, 3, 3, 3, 5, 4, 5, 2, 3, 1, 3, 2, 3, 2, 5…
$ Q4_4                       <dbl> 5, 5, 4, 4, 5, 2, 5, 2, 4, 1, 3, 3, 3, 4, 3…
$ Q4_5                       <dbl> 5, 4, 5, 5, 4, 3, 4, 2, 4, 1, 3, 4, 3, 4, 5…
$ Q4_6                       <dbl> 5, 3, 4, 3, 3, 2, 4, 2, 2, 1, 3, 5, 3, 4, 3…
$ Q4_7                       <dbl> 5, 3, 4, 3, 3, 1, 2, 2, 2, 1, 3, 4, 3, 4, 3…
$ Q4_8                       <dbl> 5, 4, 2, 4, 4, 1, 5, 2, 4, 1, 3, 2, 3, 2, 5…
$ Q4_9                       <dbl> 4, 3, 1, 3, 3, 1, 5, 2, 4, 1, 3, 2, 3, 4, 5…
$ Q4_10                      <dbl> 5, 4, 2, 3, 4, 1, 5, 2, 2, 1, 3, 2, 3, 4, 3…
$ Q4_11                      <dbl> 4, 2, 5, 3, 5, 1, 3, 2, 4, 1, 3, 3, 3, 3, 3…
$ Q5_1                       <dbl> 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 4, 2, 2, 1…
$ Q5_2                       <dbl> 1, 1, 4, 1, 4, 1, 3, 2, 1, 1, 2, 1, 2, 4, 1…
$ Q5_3                       <dbl> 2, 1, 3, 1, 4, 1, 2, 2, 1, 1, 2, 3, 2, 4, 1…
$ Q5_4                       <dbl> 3, 3, 2, 2, 4, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1…
$ Q5_5                       <dbl> 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1…
$ Q6_1                       <dbl> 7, 3, 2, 7, 4, 1, 5, 7, 6, 5, 7, 1, 7, 2, 7…
$ Q6_1R                      <dbl> NA, 3, 4, NA, 2, 5, 1, NA, NA, 1, NA, 5, NA…
$ Q6_2                       <dbl> 7, 5, 3, 7, 3, 1, 5, 7, 5, 2, 7, 1, 7, 2, 7…
$ Q6_2R                      <dbl> NA, 1, 3, NA, 3, 5, 1, NA, 1, 4, NA, 5, NA,…
$ Q6_3                       <dbl> 4, 2, 1, 7, 2, 1, 5, 7, 7, 5, 7, 1, 7, 2, 7…
$ Q6_3R                      <dbl> 2, 4, 5, NA, 4, 5, 1, NA, NA, 1, NA, 5, NA,…
$ Q6_4                       <dbl> 3, 5, 4, 4, 5, 1, 7, 1, 2, 2, 7, 7, 1, 6, 2…
$ Q6_5                       <dbl> 1, 5, 5, 2, 7, 1, 5, 1, 2, 6, 7, 7, 1, 6, 1…
$ Q7_1                       <dbl> 7, 1, 1, 7, 3, 1, 6, 1, 4, 3, 3, 7, 1, 1, 1…
$ Q7_2                       <dbl> 1, 6, 7, 1, 5, 1, 6, 7, 5, 4, 3, 1, 7, 7, 7…
$ Q7_2R                      <dbl> 5, NA, NA, 5, 1, 5, NA, NA, 1, 2, 3, 5, NA,…
$ Q7_3                       <dbl> 4, 3, 7, 5, 6, 1, 4, 7, 5, 3, 3, 1, 7, 7, 7…
$ Q7_3R                      <dbl> 2, 3, NA, 1, NA, 5, 2, NA, 1, 3, 3, 5, NA, …
$ Q7_4                       <dbl> 3, 5, 7, 1, 6, 1, 6, 7, 5, 1, 3, 1, 7, 7, 7…
$ Q7_4R                      <dbl> 3, 1, NA, 5, NA, 5, NA, NA, 1, 5, 3, 5, NA,…
$ Q7_5                       <dbl> 7, 4, 1, 7, 7, 1, 7, 5, 4, 5, 3, 7, 1, 1, 1…
$ Q8_1                       <dbl> 7, 5, 2, 7, 6, 1, 2, 7, 7, 1, 5, 7, 7, 7, 7…
$ Q8_1R                      <dbl> NA, 1, 4, NA, NA, 5, 4, NA, NA, 5, 1, NA, N…
$ Q8_2                       <dbl> 7, 4, 1, 7, 6, 1, 2, 7, 7, 4, 5, 7, 7, 7, 7…
$ Q8_2R                      <dbl> NA, 2, 5, NA, NA, 5, 4, NA, NA, 2, 1, NA, N…
$ Q8_3                       <dbl> 1, 3, 4, 1, 3, 1, 2, 1, 1, 6, 5, 1, 1, 1, 1…
$ Q8_4                       <dbl> 7, 4, 3, 6, 6, 1, 2, 7, 7, 3, 5, 7, 7, 7, 7…
$ Q8_4R                      <dbl> NA, 2, 3, NA, NA, 5, 4, NA, NA, 3, 1, NA, N…
$ Q8_5                       <dbl> 1, 3, 5, 2, 5, 1, 7, 1, 1, 4, 5, 7, 1, 1, 1…
$ Q9_1                       <dbl> 7, 3, 1, 7, 2, 1, 1, 1, 7, 2, 3, 1, 7, 7, 7…
$ Q9_1R                      <dbl> NA, 3, 5, NA, 4, 5, 5, 5, NA, 4, 3, 5, NA, …
$ Q9_2                       <dbl> 3, 6, 7, 1, 4, 1, 7, 1, 1, 5, 3, 7, 1, 1, 1…
$ Q9_3                       <dbl> 1, 7, 7, 3, 5, 1, 7, 1, 1, 1, 3, 7, 1, 1, 1…
$ Q9_4                       <dbl> 6, 3, 1, 7, 4, 1, 1, 1, 7, 3, 3, 1, 7, 7, 7…
$ Q9_4R                      <dbl> NA, 3, 5, NA, 2, 5, 5, 5, NA, 3, 3, 5, NA, …
$ Q9_5                       <dbl> 7, 5, 1, 7, 1, 1, 1, 1, 7, 5, 3, 1, 7, 7, 7…
$ Q9_5R                      <dbl> NA, 1, 5, NA, 5, 5, 5, 5, NA, 1, 3, 5, NA, …
$ Q10_1                      <dbl> 1, 5, 5, 3, 4, 1, 7, 1, 1, 5, 3, 1, 1, 1, 1…
$ Q10_2                      <dbl> 1, 4, 5, 1, 5, 1, 7, 1, 1, 6, 3, 7, 1, 1, 1…
$ Q10_3                      <dbl> 7, 3, 3, 4, 3, 1, 1, 7, 7, 5, 3, 1, 7, 7, 7…
$ Q10_3R                     <dbl> NA, 3, 3, 2, 3, 5, 5, NA, NA, 1, 3, 5, NA, …
$ Q10_4                      <dbl> 7, 5, 3, 5, 5, 1, 1, 7, 7, 3, 3, 1, 7, 7, 7…
$ Q10_4R                     <dbl> NA, 1, 3, 1, 1, 5, 5, NA, NA, 3, 3, 5, NA, …
$ Q10_5                      <dbl> 7, 4, 4, 3, 2, 1, 1, 7, 7, 5, 3, 1, 7, 7, 7…
$ Q10_5R                     <dbl> NA, 2, 2, 3, 4, 5, 5, NA, NA, 1, 3, 5, NA, …
$ Q11_1                      <dbl> 1, 2, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3…
$ Q11_2                      <dbl> 1, 3, 3, 3, 2, 4, 3, 1, 1, 1, 1, 1, 1, 1, 3…
$ Q11_3                      <dbl> 1, 1, 3, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 3…
$ Q11_4                      <dbl> 1, 3, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Q11_5                      <dbl> 1, 4, 3, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1…
$ Q12_1                      <dbl> 2, 2, 2, 2, 2, 2, 5, 1, 1, 1, 1, 1, 1, 1, 1…
$ Q12_2                      <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ Q12_3                      <dbl> 2, 5, 1, 1, 3, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1…
$ Q12_4                      <dbl> 1, 2, 3, 1, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1…
$ Q12_5                      <dbl> 1, 2, 2, 1, 4, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1…
$ Q13_1                      <dbl> 1, 5, 3, 2, 3, 1, 4, 2, 1, 1, 1, 4, 1, 1, 1…
$ Q13_2                      <dbl> 4, 3, 3, 4, 4, 1, 3, 2, 4, 2, 1, 3, 1, 1, 3…
$ Q13_3                      <dbl> 1, 4, 3, 1, 2, 1, 3, 2, 1, 1, 1, 3, 1, 1, 1…
$ Q13_4                      <dbl> 4, 2, 4, 3, 2, 1, 3, 2, 5, 2, 1, 2, 1, 1, 1…
$ Q14_1                      <dbl> 1, 2, 2, 2, 2, 1, 3, 2, 5, 2, 1, 2, 1, 3, 2…
$ Q14_2                      <dbl> 2, 4, 5, 2, 3, 1, 4, 2, 1, 2, 1, 4, 1, 5, 4…
$ Q14_3                      <dbl> 4, 4, 4, 5, 4, 1, 3, 2, 1, 1, 1, 4, 1, 3, 2…
$ Q14_4                      <dbl> 1, 4, 2, 1, 2, 2, 4, 2, 1, 3, 1, 4, 1, 5, 2…
$ Q14_5                      <dbl> 2, 2, 1, 3, 5, 2, 4, 2, 1, 4, 1, 3, 1, 3, 2…
$ Q14_6                      <dbl> 2, 2, 1, 4, 5, 3, 4, 2, 1, 2, 1, 3, 1, 5, 2…
$ Q14_7                      <dbl> 2, 4, 5, 5, 4, 2, 5, 2, 1, 3, 1, 4, 1, 3, 4…
$ Q14_8                      <dbl> 1, 2, 1, 1, 1, 3, 5, 2, 5, 1, 1, 2, 1, 1, 2…
$ Q14_9                      <dbl> 2, 3, 1, 2, 2, 2, 1, 2, 4, 4, 1, 5, 1, 1, 2…
$ Q14_10                     <dbl> 1, 5, 3, 2, 2, 2, 3, 2, 5, 1, 1, 3, 1, 1, 2…
$ Q14_11                     <dbl> 2, 4, 5, 2, 3, 2, 5, 2, 1, 2, 1, 3, 1, 3, 2…
$ Q14_12                     <dbl> 1, 5, 2, 3, 1, 3, 3, 2, 1, 4, 1, 4, 1, 1, 4…
$ Q14_13                     <dbl> 2, 2, 1, 5, 4, 1, 3, 2, 1, 2, 1, 5, 1, 5, 2…
$ Q14_14                     <dbl> 5, 1, 1, 1, 3, 1, 4, 2, 1, 5, 1, 3, 1, 5, 2…
$ Q14_15                     <dbl> 2, 3, 1, 1, 5, 1, 4, 2, 1, 1, 1, 2, 1, 5, 2…
$ Q14_16                     <dbl> 5, 3, 2, 3, 5, 3, 3, 2, 1, 2, 1, 4, 1, 5, 2…
$ Q14_17                     <dbl> 1, 5, 4, 1, 2, 2, 2, 2, 1, 5, 1, 5, 1, 1, 2…
$ Q14_18                     <dbl> 2, 2, 2, 2, 1, 2, 3, 2, 4, 2, 1, 5, 1, 1, 2…
$ Q14_19                     <dbl> 1, 3, 3, 5, 4, 3, 3, 2, 1, 3, 1, 5, 1, 1, 2…
$ Q14_20                     <dbl> 1, 1, 3, 4, 3, 1, 4, 2, 1, 1, 1, 5, 1, 1, 2…
$ Q14_21                     <dbl> 1, 2, 5, 1, 4, 1, 5, 2, 1, 2, 1, 5, 1, 1, 2…
$ Q14_22                     <dbl> 2, 4, 1, 1, 5, 2, 4, 2, 1, 3, 1, 4, 1, 5, 2…
$ Q14_23                     <dbl> 2, 3, 1, 1, 1, 1, 4, 2, 1, 1, 1, 4, 1, 5, 2…
$ Q14_24                     <dbl> 1, 5, 1, 1, 3, 1, 4, 2, 1, 4, 1, 4, 1, 3, 2…
$ Q14_25                     <dbl> 2, 2, 1, 3, 4, 1, 5, 2, 1, 2, 1, 5, 1, 5, 2…
$ Q14_26                     <dbl> 1, 1, 4, 1, 1, 1, 4, 2, 1, 4, 1, 4, 1, 1, 2…
$ Q14_27                     <dbl> 1, 2, 1, 3, 2, 1, 4, 2, 1, 2, 1, 1, 1, 3, 2…
$ Q14_28                     <dbl> 1, 3, 1, 3, 3, 1, 3, 2, 5, 1, 1, 3, 1, 1, 2…
$ Q14_29                     <dbl> 2, 3, 2, 5, 4, 3, 4, 2, 5, 2, 1, 3, 1, 4, 2…
$ Q14_30                     <dbl> 1, 4, 3, 3, 2, 2, 4, 2, 1, 4, 1, 4, 1, 1, 2…
$ Q14_31                     <dbl> 1, 1, 1, 1, 4, 2, 4, 2, 1, 2, 1, 4, 1, 5, 2…
$ Q14_32                     <dbl> 1, 3, 1, 2, 5, 2, 4, 2, 1, 5, 1, 5, 1, 4, 2…
$ Q14_33                     <dbl> 1, 5, 1, 1, 1, 1, 4, 2, 1, 3, 1, 3, 1, 5, 2…
$ Q14_34                     <dbl> 2, 2, 2, 5, 4, 1, 4, 2, 1, 1, 1, 4, 1, 1, 2…
$ Q14_35                     <dbl> 1, 4, 5, 5, 3, 1, 4, 2, 5, 4, 1, 4, 1, 1, 2…
$ Q14_36                     <dbl> 1, 3, 1, 3, 2, 4, 4, 2, 4, 2, 1, 2, 1, 5, 2…
$ Q15_1                      <dbl> 2, 2, 3, 2, 4, 1, 1, 3, 4, 2, 1, 1, 1, 5, 2…
$ Q15_2                      <dbl> 5, 1, 1, 2, 3, 1, 1, 3, 1, 4, 1, 1, 1, 5, 5…
$ Q15_3                      <dbl> 2, 4, 2, 3, 2, 1, 1, 3, 1, 2, 1, 1, 1, 5, 2…
$ Q16_1                      <dbl> 2, 3, 4, 2, 4, 1, 5, 3, 1, 1, 2, 1, 1, 1, 2…
$ Q16_2                      <dbl> 2, 1, 3, 2, 2, 1, 4, 3, 1, 4, 2, 1, 1, 1, 5…
$ Q16_3                      <dbl> 3, 1, 2, 2, 4, 4, 5, 3, 1, 1, 2, 1, 1, 1, 5…
$ Q17_1                      <dbl> 1, 1, 4, 2, 2, 1, 2, 3, 1, 1, 3, 5, 1, 1, 2…
$ Q17_2                      <dbl> 5, 2, 1, 2, 1, 2, 2, 3, 1, 2, 3, 5, 1, 1, 5…
$ Q17_3                      <dbl> 1, 4, 3, 2, 1, 3, 2, 3, 1, 4, 3, 5, 1, 1, 5…
$ Q18_1                      <dbl> 2, 4, 4, 2, 5, 1, 3, 3, 1, 1, 2, 3, 1, 5, 5…
$ Q18_2                      <dbl> 5, 3, 1, 2, 4, 2, 1, 3, 2, 4, 2, 4, 1, 5, 4…
$ Q18_3                      <dbl> 1, 3, 3, 2, 3, 4, 1, 3, 2, 1, 2, 4, 1, 5, 5…
$ Q19_1                      <dbl> 3, 2, 5, 2, 5, 3, 5, 1, 1, 2, 4, 3, 1, 3, 5…
$ Q19_2                      <dbl> 3, 3, 3, 2, 4, 3, 3, 1, 1, 4, 4, 3, 1, 3, 2…
$ Q19_3                      <dbl> 4, 5, 4, 2, 2, 3, 5, 1, 1, 1, 4, 5, 1, 3, 5…
$ Q20_1                      <dbl> 2, 3, 5, 2, 2, 1, 3, 1, 1, 5, 1, 1, 1, 2, 2…
$ Q20_2                      <dbl> 2, 3, 1, 2, 2, 2, 3, 1, 1, 2, 1, 3, 1, 2, 3…
$ Q20_3                      <dbl> 2, 3, 3, 2, 2, 2, 3, 1, 1, 4, 1, 5, 1, 2, 5…
$ Q21_1                      <dbl> 1, 3, 1, 1, 2, 1, 6, 1, 2, 1, 5, 1, 1, 1, 3…
$ Q21_2                      <dbl> 1, 2, 1, 1, 4, 1, 6, 1, 1, 5, 6, 2, 1, 6, 3…
$ Q21_3                      <dbl> 1, 5, 1, 1, 4, 1, 6, 1, 1, 5, 5, 3, 1, 1, 3…
$ Q21_4                      <dbl> 1, 3, 1, 1, 2, 1, 3, 1, 1, 3, 6, 4, 1, 1, 1…
$ Q21_5                      <dbl> 1, 1, 1, 1, 1, 1, 4, 1, 1, 3, 5, 5, 1, 1, 1…
$ Q21_6                      <dbl> 1, 5, 1, 1, 2, 2, 5, 1, 1, 1, 6, 6, 1, 1, 1…
$ Q21_7                      <dbl> 1, 4, 1, 1, 3, 1, 6, 1, 1, 2, 5, 5, 1, 1, 3…
$ Q21_8                      <dbl> 3, 3, 1, 1, 1, 1, 6, 1, 1, 3, 6, 4, 1, 1, 3…
$ Q21_9                      <dbl> 3, 3, 1, 2, 3, 2, 6, 1, 1, 4, 5, 3, 1, 4, 1…
$ Q21_10                     <dbl> 1, 4, 1, 1, 1, 5, 5, 1, 1, 3, 6, 2, 1, 1, 3…
$ Q21_11                     <dbl> 1, 4, 1, 3, 2, 3, 6, 1, 1, 2, 5, 2, 1, 1, 3…
$ Q21_12                     <dbl> 1, 4, 1, 1, 2, 4, 6, 1, 1, 5, 6, 3, 1, 1, 3…
$ Q21_13                     <dbl> 1, 2, 1, 1, 2, 2, 5, 1, 1, 3, 5, 3, 1, 1, 3…
$ Q21_14                     <dbl> 1, 6, 1, 1, 3, 2, 3, 1, 1, 2, 6, 4, 1, 1, 1…
$ Q21_15                     <dbl> 1, 2, 1, 1, 2, 3, 1, 1, 1, 5, 5, 4, 1, 1, 3…
$ Q21_16                     <dbl> 1, 3, 1, 1, 2, 4, 4, 1, 1, 3, 6, 4, 1, 3, 1…
$ Q21_17                     <dbl> 3, 3, 1, 1, 3, 2, 6, 1, 5, 5, 5, 1, 1, 1, 1…
$ Q21_18                     <dbl> 1, 2, 1, 2, 1, 3, 6, 1, 1, 1, 6, 2, 1, 1, 1…
$ Q30_1                      <dbl> 3, 2, 3, 5, 3, 1, 3, 1, 1, 2, 4, 5, 1, 3, 4…
$ Q30_2                      <dbl> 3, 3, 2, 2, 2, 2, 3, 1, 1, 1, 5, 2, 1, 3, 1…
$ Q30_3                      <dbl> 3, 4, 5, 3, 5, 2, 4, 1, 1, 3, 4, 3, 1, 1, 3…
$ Q30_4                      <dbl> 1, 4, 4, 1, 2, 2, 2, 1, 1, 2, 5, 1, 1, 4, 3…
$ Q30_5                      <dbl> 5, 2, 2, 3, 5, 4, 5, 1, 1, 2, 4, 2, 1, 5, 4…
$ Q30_6                      <dbl> 1, 4, 3, 2, 3, 3, 1, 1, 1, 2, 5, 5, 1, 1, 1…
$ Q30_7                      <dbl> 5, 3, 5, 1, 5, 1, 3, 1, 1, 5, 4, 5, 1, 5, 4…
$ Q30_8                      <dbl> 1, 4, 4, 5, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 1…
$ Q30_9                      <dbl> 1, 1, 3, 1, 3, 1, 1, 1, 1, 2, 4, 5, 1, 1, 1…
$ Q30_10                     <dbl> 2, 4, 3, 1, 4, 1, 4, 1, 1, 2, 5, 3, 1, 3, 3…
$ Q30_11                     <dbl> 3, 3, 2, 3, 3, 3, 5, 1, 1, 5, 4, 5, 1, 3, 4…
$ Q30_12                     <dbl> 2, 3, 4, 2, 2, 1, 1, 1, 1, 1, 5, 3, 1, 3, 3…
$ Q30_13                     <dbl> 4, 4, 3, 5, 5, 1, 5, 1, 1, 5, 4, 4, 1, 3, 3…
$ Q30_14                     <dbl> 3, 1, 2, 5, 4, 1, 5, 1, 5, 3, 5, 1, 1, 1, 3…
$ Q30_15                     <dbl> 3, 4, 3, 1, 3, 1, 5, 1, 1, 2, 4, 4, 1, 3, 4…
$ Q30_16                     <dbl> 1, 3, 3, 3, 1, 5, 2, 5, 1, 4, 5, 5, 1, 1, 1…
$ Q30_17                     <dbl> 1, 4, 3, 2, 3, 1, 2, 1, 1, 3, 4, 3, 1, 3, 3…
$ Q30_18                     <dbl> 3, 1, 3, 3, 4, 4, 5, 1, 1, 1, 5, 4, 1, 3, 3…
$ Q30_19                     <dbl> 2, 2, 3, 4, 5, 1, 5, 1, 5, 1, 4, 4, 1, 1, 1…
$ Q30_20                     <dbl> 4, 1, 5, 5, 5, 1, 2, 1, 1, 5, 5, 4, 1, 3, 4…
$ Q30_21                     <dbl> 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1…
$ Q30_22                     <dbl> 1, 3, 1, 1, 1, 2, 5, 1, 1, 1, 5, 3, 1, 2, 1…
$ Q30_23                     <dbl> 1, 2, 5, 1, 3, 2, 2, 3, 1, 4, 4, 4, 1, 1, 4…
$ Q30_24                     <dbl> 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 5, 1, 1, 1, 1…
$ Q30_25                     <dbl> 2, 3, 2, 3, 3, 3, 5, 1, 1, 1, 4, 4, 1, 5, 3…
$ Q30_26                     <dbl> 3, 3, 4, 5, 5, 2, 5, 1, 5, 3, 5, 5, 1, 3, 3…
$ Q30_27                     <dbl> 3, 4, 2, 4, 4, 1, 3, 1, 1, 3, 4, 4, 1, 3, 3…
$ Q30_28                     <dbl> 1, 3, 2, 2, 2, 2, 1, 1, 1, 5, 5, 1, 1, 1, 3…
$ Q30_29                     <dbl> 1, 3, 4, 3, 5, 2, 5, 1, 1, 4, 4, 2, 1, 3, 4…
$ Q30_30                     <dbl> 4, 4, 4, 4, 3, 1, 5, 1, 1, 2, 5, 1, 1, 1, 3…
$ Q30_31                     <dbl> 2, 3, 1, 3, 4, 3, 1, 1, 1, 4, 4, 4, 1, 3, 3…
$ Q30_32                     <dbl> 4, 2, 4, 2, 5, 3, 5, 1, 1, 2, 5, 3, 1, 3, 3…
$ Q30_33                     <dbl> 3, 4, 4, 3, 3, 2, 5, 1, 1, 3, 4, 2, 1, 1, 1…
$ Q30_34                     <dbl> 1, 3, 1, 2, 2, 3, 4, 1, 1, 5, 5, 3, 1, 1, 1…
$ Q30_35                     <dbl> 4, 3, 5, 5, 2, 2, 5, 1, 1, 2, 4, 4, 1, 3, 4…
$ Q30_36                     <dbl> 3, 4, 4, 3, 3, 2, 5, 1, 1, 4, 5, 5, 1, 3, 1…
$ Q30_37                     <dbl> 1, 3, 2, 2, 4, 2, 2, 1, 1, 2, 4, 5, 1, 3, 1…
$ Q30_38                     <dbl> 5, 2, 4, 5, 5, 1, 5, 1, 1, 3, 5, 5, 1, 3, 3…
$ Q30_39                     <dbl> 3, 4, 1, 2, 1, 1, 5, 1, 1, 2, 4, 5, 1, 2, 3…
$ Q30_40                     <dbl> 1, 2, 1, 5, 4, 1, 5, 1, 1, 4, 5, 1, 1, 3, 3…
$ Q30_41                     <dbl> 3, 3, 1, 2, 3, 2, 3, 1, 1, 5, 4, 2, 1, 3, 3…
$ Q30_42                     <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 1, 1, 1, 1…
$ Q30_43                     <dbl> 2, 5, 1, 2, 5, 1, 2, 1, 1, 4, 4, 4, 1, 3, 4…
$ Q30_44                     <dbl> 2, 3, 3, 3, 3, 3, 1, 1, 1, 2, 5, 5, 1, 1, 1…
$ Q30_45                     <dbl> 1, 3, 1, 2, 2, 4, 3, 1, 1, 3, 4, 4, 1, 3, 3…
$ Q30_46                     <dbl> 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 5, 1, 1, 1, 1…
$ Q30_47                     <dbl> 1, 3, 4, 3, 5, 1, 5, 1, 1, 2, 4, 4, 1, 3, 3…
$ Q30_48                     <dbl> 4, 4, 3, 3, 5, 1, 5, 1, 1, 1, 5, 4, 1, 5, 3…
$ Q30_49                     <dbl> 1, 2, 4, 2, 3, 1, 3, 1, 1, 4, 4, 4, 1, 2, 3…
$ Q30_50                     <dbl> 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 5, 3, 1, 1, 1…
$ Q30_51                     <dbl> 1, 2, 3, 4, 2, 2, 2, 1, 1, 4, 4, 3, 1, 3, 3…
$ Q30_52                     <dbl> 1, 1, 3, 5, 2, 2, 2, 1, 1, 1, 5, 4, 1, 3, 3…
$ Q30_53                     <dbl> 1, 5, 5, 5, 4, 2, 4, 1, 1, 2, 4, 5, 1, 5, 3…
$ Q30_54                     <dbl> 1, 3, 3, 2, 4, 1, 3, 1, 1, 4, 5, 4, 1, 4, 1…
$ Q31_1                      <dbl> 3, 1, 1, 3, 1, 4, 1, 4, 3, 3, 4, 1, 1, 1, 1…
$ Q31_2                      <dbl> 1, 1, 2, 3, 1, 4, 1, 2, 1, 4, 5, 1, 1, 1, 1…
$ Q31_3                      <dbl> 1, 3, 3, 1, 3, 4, 1, 1, 1, 1, 4, 2, 1, 1, 1…
$ Q31_4                      <dbl> 1, 1, 1, 1, 5, 4, 1, 5, 1, 1, 5, 1, 1, 1, 1…
$ Q31_5                      <dbl> 1, 1, 1, 1, 2, 4, 1, 1, 1, 1, 4, 1, 1, 1, 1…
$ Q31_6                      <dbl> 2, 1, 4, 3, 5, 4, 1, 2, 1, 1, 5, 1, 1, 1, 1…
$ Q31_7                      <dbl> 1, 1, 1, 3, 5, 5, 1, 1, 1, 4, 4, 1, 1, 1, 1…
$ Q31_8                      <dbl> 1, 2, 5, 4, 5, 4, 2, 2, 4, 5, 5, 2, 1, 2, 1…
$ SSTEMMath                  <dbl> 3.500, 3.000, 1.875, 4.000, 3.625, 2.750, 2…
$ SSTEMScience               <dbl> 1.555556, 3.777778, 2.777778, 2.444444, 2.2…
$ SSTEMTechEngineer          <dbl> 2.333333, 4.111111, 4.111111, 1.333333, 3.1…
$ SSTEM21stCentury           <dbl> 4.454545, 3.636364, 3.545455, 3.363636, 4.0…
$ SSTEMYourFuture            <dbl> 1.6, 1.8, 2.4, 1.4, 3.0, 1.4, 2.0, 2.0, 1.0…
$ SemanticsScience           <dbl> NA, 3.6, 4.2, NA, 4.2, 3.4, 3.0, NA, NA, 2.…
$ SemanticsMath              <dbl> 4.8, NA, NA, 5.0, NA, 3.4, NA, NA, 2.2, 3.6…
$ SemanticsEngineering       <dbl> NA, 2.2, 4.2, NA, NA, 3.4, 4.2, NA, NA, 4.0…
$ SemanticsTechnology        <dbl> NA, 4.0, 5.8, NA, 4.0, 3.4, 5.8, 3.4, NA, 2…
$ SemanticsJobInSTEM         <dbl> NA, 3.0, 3.6, 2.0, 3.4, 3.4, 5.8, NA, NA, 3…
$ DailyLifeExperiences       <dbl> 1.333333, 3.277778, 1.000000, 1.222222, 2.2…
$ ACOPE                      <dbl> 2.166667, 2.796296, 2.870370, 2.796296, 3.1…
$ CERQSelfBlame              <dbl> 1.00, 3.25, 2.25, 3.00, 2.75, 1.75, 3.00, 2…
$ CERQAcceptance             <dbl> 1.75, 3.00, 3.75, 3.25, 3.25, 1.75, 4.25, 2…
$ CERQRumination             <dbl> 1.75, 3.75, 3.50, 3.00, 2.75, 1.75, 3.75, 2…
$ CERQPositiveRefocusing     <dbl> 1.50, 2.75, 1.25, 2.00, 3.75, 1.75, 3.75, 2…
$ CERQRefocusOnPlanning      <dbl> 2.50, 2.25, 1.00, 1.75, 3.50, 1.50, 4.00, 2…
$ CERQCatastrophizing        <dbl> 1.00, 3.00, 3.50, 2.00, 1.75, 1.75, 3.75, 2…
$ CERQOtherBlame             <dbl> 1.50, 2.50, 1.25, 2.50, 1.75, 2.25, 3.00, 2…
$ CERQPuttingIntoPerspective <dbl> 2.75, 2.75, 2.50, 4.00, 4.25, 1.75, 4.25, 2…
$ CERQPositiveReappraisal    <dbl> 1.50, 3.75, 1.00, 1.75, 3.50, 1.50, 4.00, 2…
$ QFSSSCommunity             <dbl> 2.000000, 3.000000, 3.000000, 2.000000, 2.0…
$ QFSSSFamily                <dbl> 2.666667, 3.333333, 2.666667, 2.000000, 4.0…
$ QFSSSFriends               <dbl> 3.333333, 3.333333, 4.000000, 2.000000, 3.6…
$ QFSSSPartner               <dbl> 2.333333, 1.666667, 3.000000, 2.000000, 3.3…
$ FearOfCalamity             <dbl> 1.375, 1.375, 2.250, 2.375, 3.375, 4.125, 1…
$ Gender                     <dbl+lbl> 3, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, …
$ Race                       <dbl+lbl> 5, 1, 2, 5, 1, 1, 3, 1, 5, 5, 2, 1, 1, …
$ ParentEducation            <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ Grade                      <dbl> 8, 8, 8, 7, 7, 7, 7, 8, 7, 7, 7, 6, 8, 8, 6…
$ CERQTotal                  <dbl> 1.694444, 3.000000, 2.222222, 2.583333, 3.0…
$ QFSSSTotal                 <dbl> 2.533333, 2.733333, 3.066667, 2.000000, 2.8…
$ SSTEMTotal                 <dbl> 2.857143, 3.428571, 3.047619, 2.619048, 3.2…
$ SemanticsTotal             <dbl> 2.714286, 3.041667, 4.136364, 3.000000, 3.8…
$ race.fac                   <fct> Other, Black, White, Other, Black, Black, I…
$ gender.fac                 <fct> Prefer not to say, Male, Male, Female, Fema…
$ grade.fac                  <fct> 8, 8, 8, 7, 7, 7, 7, 8, 7, 7, 7, 6, 8, 8, 6…
$ dailylife                  <dbl> 1.333333, 3.277778, 1.000000, 1.222222, 2.2…
$ fear                       <dbl> 1.375, 1.375, 2.250, 2.375, 3.375, 4.125, 1…

Data Structure: S-STEM Math

Code
str(fifedata.clean$Q1_1, vec.len=50)
 num [1:468] 2 3 5 5 2 4 4 3 2 1 3 2 3 4 5 3 2 5 2 3 4 3 1 4 4 2 5 3 2 1 4 4 4 4 2 3 4 2 4 3 2 1 5 2 2 1 2 1 3 2 1 2 1 2 3 5 1| __truncated__ ...
 - attr(*, "label")= chr "S-STEM Math"
 - attr(*, "format.spss")= chr "F25.0"
 - attr(*, "display_width")= int 25
Code
table(fifedata.clean$Q1_1)

  1   2   3   4   5 
111 123 105  77  52 

Data Structure: S-STEM Science

Code
str(fifedata.clean$Q2_1, vec.len=50)
 num [1:468] 3 4 4 4 2 2 2 2 3 4 3 3 1 5 3 3 4 4 4 1 1 2 1 4 2 1 3 3 4 3 4 3 5 4 4 3 5 2 4 3 4 4 5 5 4 3 3 3 5 4 4 1 4 4 5 1 5| __truncated__ ...
 - attr(*, "label")= chr "S-STEM Science"
 - attr(*, "format.spss")= chr "F25.0"
 - attr(*, "display_width")= int 25
Code
table(fifedata.clean$Q2_1)

  1   2   3   4   5 
 27  37 127 208  69 

Data Structure: S-STEM Tech/Engineer

Code
str(fifedata.clean$Q3_1, vec.len=50)
 num [1:468] 2 5 4 3 4 1 5 2 2 4 4 2 1 1 3 4 1 2 4 1 4 2 4 4 2 3 4 3 3 4 4 3 5 4 4 2 5 2 4 4 5 5 4 2 5 4 5 5 4 4 5 4 5 4 2 5 5| __truncated__ ...
 - attr(*, "label")= chr "S-STEM Tech/Engineer"
 - attr(*, "format.spss")= chr "F26.0"
 - attr(*, "display_width")= int 26
Code
table(fifedata.clean$Q3_1)

  1   2   3   4   5 
 30  56  81 214  87 

Data Structure: S-STEM 21st Century

Code
str(fifedata.clean$Q4_1, vec.len=50)
 num [1:468] 3 4 4 2 4 4 5 2 2 4 3 5 3 1 5 5 4 4 3 1 3 3 5 4 3 3 2 4 1 5 4 3 4 5 3 2 4 4 2 4 5 5 4 5 3 4 5 5 3 5 3 4 3 5 5 1 5| __truncated__ ...
 - attr(*, "label")= chr "S-STEM 21st century"
 - attr(*, "format.spss")= chr "F26.0"
 - attr(*, "display_width")= int 26
Code
table(fifedata.clean$Q4_1)

  1   2   3   4   5 
 31  34 100 193 110 

Data Structure: S-STEM Your Future

Code
str(fifedata.clean$Q5_1, vec.len=50)
 num [1:468] 1 2 2 1 2 2 2 2 1 1 2 4 2 2 1 2 1 4 2 2 1 1 2 1 1 4 2 1 1 1 2 4 4 3 2 1 4 3 3 4 2 3 2 3 4 2 3 1 3 2 2 3 1 2 1 1 4| __truncated__ ...
 - attr(*, "label")= chr "S-STEM Your Future"
 - attr(*, "format.spss")= chr "F21.0"
 - attr(*, "display_width")= int 21
Code
table(fifedata.clean$Q5_1)

  1   2   3   4 
 85 190 139  54 

Data Structure: Semantics Science

Code
str(fifedata.clean$Q6_1, vec.len=50)
 num [1:468] 7 3 2 7 4 1 5 7 6 5 7 1 7 2 7 7 1 1 4 7 6 6 7 3 5 7 7 5 7 4 4 2 1 4 1 4 1 1 1 1 4 3 1 1 1 3 7 3 3 1 2 1 6 6 1 7 1| __truncated__ ...
 - attr(*, "label")= chr "Semantics science"
 - attr(*, "format.spss")= chr "F1.0"
 - attr(*, "display_width")= int 1
Code
table(fifedata.clean$Q6_1)

  1   2   3   4   5   6   7 
161  45  65  78  31  23  64 

Data Structure: Semantics Math

Code
str(fifedata.clean$Q7_1, vec.len=50)
 num [1:468] 7 1 1 7 3 1 6 1 4 3 3 7 1 1 1 7 7 4 5 1 2 1 1 1 1 7 1 1 7 7 6 6 7 3 7 5 6 5 1 5 4 6 1 7 7 7 7 6 4 6 7 7 5 4 1 1 7| __truncated__ ...
 - attr(*, "label")= chr "Semantics math"
 - attr(*, "format.spss")= chr "F1.0"
 - attr(*, "display_width")= int 1
Code
table(fifedata.clean$Q7_1)

  1   2   3   4   5   6   7 
 99  20  36  63  51  33 166 

Data Structure: Semantics Engineering

Code
str(fifedata.clean$Q8_1, vec.len=50)
 num [1:468] 7 5 2 7 6 1 2 7 7 1 5 7 7 7 7 1 1 2 7 7 7 6 1 4 7 6 7 6 1 4 3 6 1 2 7 1 1 2 7 4 2 3 4 1 7 4 6 1 5 4 5 1 1 2 1 7 1| __truncated__ ...
 - attr(*, "label")= chr "Semantics engineering"
 - attr(*, "format.spss")= chr "F1.0"
 - attr(*, "display_width")= int 1
Code
table(fifedata.clean$Q8_1)

  1   2   3   4   5   6   7 
161  41  56  83  21  20  86 

Data Structure: Semantics Tech

Code
str(fifedata.clean$Q9_1, vec.len=50)
 num [1:468] 7 3 1 7 2 1 1 1 7 2 3 1 7 7 7 1 7 1 4 1 7 4 4 5 7 4 1 3 1 4 4 3 1 2 3 1 1 3 1 1 1 1 3 1 4 1 1 1 5 4 1 1 1 1 1 1 1| __truncated__ ...
 - attr(*, "label")= chr "Semantics tech"
 - attr(*, "format.spss")= chr "F1.0"
 - attr(*, "display_width")= int 1
Code
table(fifedata.clean$Q9_1)

  1   2   3   4   5   6   7 
224  49  56  58  19   9  53 

Data Structure: Semantics Job in STEM

Code
str(fifedata.clean$Q10_1, vec.len=50)
 num [1:468] 1 5 5 3 4 1 7 1 1 5 3 1 1 1 1 2 1 5 3 7 1 1 7 4 1 4 1 4 7 1 1 3 7 2 6 7 7 2 7 6 7 7 7 7 5 7 7 4 6 6 6 7 7 6 1 7 7| __truncated__ ...
 - attr(*, "label")= chr "Semantics job in STEM"
 - attr(*, "format.spss")= chr "F1.0"
 - attr(*, "display_width")= int 1
Code
table(fifedata.clean$Q10_1)

  1   2   3   4   5   6   7 
 55  22  28  84  50  51 178 

Data Structure: Career Interest Questionnaire - Part 1

Code
str(fifedata.clean$Q11_1, vec.len=50)
 num [1:468] 1 2 3 1 1 1 3 1 1 1 1 1 1 1 3 3 1 4 1 3 1 1 3 2 1 2 2 1 3 1 4 1 3 4 3 2 5 2 5 4 3 4 3 4 1 4 3 3 5 4 4 4 1 1 5 5 5| __truncated__ ...
 - attr(*, "label")= chr "Career interest questionnaire"
 - attr(*, "format.spss")= chr "F28.0"
 - attr(*, "display_width")= int 28
Code
table(fifedata.clean$Q11_1)

  1   2   3   4   5 
 63  67 166 118  54 

Data Structure: Career Interest Part 2

Code
str(fifedata.clean$Q12_1, vec.len=50)
 num [1:468] 2 2 2 2 2 2 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5| __truncated__ ...
 - attr(*, "label")= chr "Career interest part 2"
 - attr(*, "format.spss")= chr "F19.0"
 - attr(*, "display_width")= int 19
Code
table(fifedata.clean$Q12_1)

  1   2   3   4   5 
 40  55 160 124  89 

Data Structure: Career Interest - Part 3

Code
str(fifedata.clean$Q13_1, vec.len=50)
 num [1:468] 1 5 3 2 3 1 4 2 1 1 1 4 1 1 1 1 3 5 1 1 1 3 1 2 1 5 3 2 1 1 2 2 5 2 2 4 5 3 5 4 5 4 2 4 5 4 3 5 3 4 3 4 1 4 2 5 5| __truncated__ ...
 - attr(*, "label")= chr "Career interest part 3"
 - attr(*, "format.spss")= chr "F19.0"
 - attr(*, "display_width")= int 19
Code
table(fifedata.clean$Q13_1)

  1   2   3   4   5 
 52  73 142 128  73 

Data Structure: CERQ

Code
str(fifedata.clean$Q14_1, vec.len=50)
 num [1:468] 1 2 2 2 2 1 3 2 5 2 1 2 1 3 2 1 2 3 2 1 5 2 2 4 2 3 2 5 1 1 4 4 4 3 2 3 4 5 2 3 1 2 2 2 3 2 4 5 3 1 2 2 2 1 2 1 2| __truncated__ ...
 - attr(*, "label")= chr "CERQ"
 - attr(*, "format.spss")= chr "F17.0"
 - attr(*, "display_width")= int 17
Code
table(fifedata.clean$Q14_1)

  1   2   3   4   5 
 99 213  76  46  34 

Data Structure:

Code
str(fifedata.clean$Q15_1, vec.len=50)
 num [1:468] 2 2 3 2 4 1 1 3 4 2 1 1 1 5 2 5 2 2 2 5 5 3 1 4 2 4 5 2 3 5 2 4 1 3 5 4 5 5 5 1 1 5 3 5 1 2 2 5 3 4 2 4 4 5 5 5 5| __truncated__ ...
 - attr(*, "format.spss")= chr "F15.0"
 - attr(*, "display_width")= int 15
Code
table(fifedata.clean$Q15_1)

  1   2   3   4   5 
 62 110  95  69 132 

Data Structure: QFSSS Partner

Code
str(fifedata.clean$Q16_1, vec.len=50)
 num [1:468] 2 3 4 2 4 1 5 3 1 1 2 1 1 1 2 5 4 4 2 3 1 5 4 4 3 5 3 4 3 5 2 5 1 3 5 5 5 4 2 1 2 3 4 2 1 3 2 5 4 5 3 4 5 4 4 5 5| __truncated__ ...
 - attr(*, "label")= chr "QFSSS Partner"
 - attr(*, "format.spss")= chr "F15.0"
 - attr(*, "display_width")= int 15
Code
table(fifedata.clean$Q16_1)

  1   2   3   4   5 
 49 105 108 102 104 

Data Structure: QFSSS Community

Code
str(fifedata.clean$Q17_1, vec.len=50)
 num [1:468] 1 1 4 2 2 1 2 3 1 1 3 5 1 1 2 5 1 1 3 5 1 3 5 4 1 1 2 3 3 3 3 5 1 4 3 4 5 4 1 2 1 3 1 2 2 3 3 5 1 4 2 4 3 2 2 5 5| __truncated__ ...
 - attr(*, "label")= chr "QFSSS Community"
 - attr(*, "format.spss")= chr "F15.0"
 - attr(*, "display_width")= int 15
Code
table(fifedata.clean$Q17_1)

  1   2   3   4   5 
107 115 105  72  69 

Data Structure: QFSSS Family

Code
str(fifedata.clean$Q18_1, vec.len=50)
 num [1:468] 2 4 4 2 5 1 3 3 1 1 2 3 1 5 5 5 3 3 3 5 4 2 2 5 3 1 4 2 4 5 5 5 2 3 5 5 5 4 1 1 2 5 4 5 5 4 1 5 5 3 5 5 1 5 5 5 5| __truncated__ ...
 - attr(*, "label")= chr "QFSSS Family"
 - attr(*, "format.spss")= chr "F18.0"
 - attr(*, "display_width")= int 18
Code
table(fifedata.clean$Q18_1)

  1   2   3   4   5 
 43  63 104 104 154 

Data Structure: QFSSS Friends

Code
str(fifedata.clean$Q19_1, vec.len=50)
 num [1:468] 3 2 5 2 5 3 5 1 1 2 4 3 1 3 5 5 2 5 3 3 1 5 1 4 3 4 3 4 4 4 4 5 1 2 5 4 5 3 1 1 3 4 5 3 5 2 3 4 1 4 5 2 3 5 4 4 5| __truncated__ ...
 - attr(*, "label")= chr "QFSSS Friends"
 - attr(*, "format.spss")= chr "F18.0"
 - attr(*, "display_width")= int 18
Code
table(fifedata.clean$Q19_1)

  1   2   3   4   5 
 45  73 113 108 129 

Data Structure: QFSSS Community

Code
str(fifedata.clean$Q20_1, vec.len=50)
 num [1:468] 2 3 5 2 2 1 3 1 1 5 1 1 1 2 2 5 2 1 3 5 1 3 5 4 1 4 2 2 4 3 1 5 1 5 5 5 5 3 2 2 1 4 2 3 2 3 4 5 2 2 3 5 5 4 1 5 5| __truncated__ ...
 - attr(*, "label")= chr "QFSSS Community"
 - attr(*, "format.spss")= chr "F18.0"
 - attr(*, "display_width")= int 18
Code
table(fifedata.clean$Q20_1)

  1   2   3   4   5 
 74 103 114  87  90 

Data Structure: Daily Life Experiences

Daily life experiences from an adolescents perspective can include family economy, hunger, abuse in the home, among other factors (CDC ABES findings). According to CDC, students experiencing racism are more likely to experience poor mental health and less likely to feel connected to people at school.

Code
str(fifedata.clean$Q21_1, vec.len=50)
 num [1:468] 1 3 1 1 2 1 6 1 2 1 5 1 1 1 3 1 3 3 3 2 6 1 2 4 1 3 6 5 4 2 3 3 6 5 6 3 5 5 5 2 1 1 1 1 2 2 6 5 1 1 5 3 2 3 1 1 5| __truncated__ ...
 - attr(*, "label")= chr "Daily Life Experiences"
 - attr(*, "format.spss")= chr "F15.0"
 - attr(*, "display_width")= int 15
Code
table(fifedata.clean$Q21_1)

  1   2   3   4   5   6 
138  90 131  59  28  22 

Data Structure: ACOPE

Code
str(fifedata.clean$Q30_1, vec.len=50)
 num [1:468] 3 2 3 5 3 1 3 1 1 2 4 5 1 3 4 5 5 4 3 5 5 4 5 3 1 1 5 4 3 5 3 4 4 2 5 3 5 3 5 3 4 3 2 4 5 5 5 4 2 4 3 2 1 1 4 5 5| __truncated__ ...
 - attr(*, "label")= chr "ACOPE"
 - attr(*, "format.spss")= chr "F16.0"
 - attr(*, "display_width")= int 16
Code
table(fifedata.clean$Q30_1)

  1   2   3   4   5 
 32  45 107 116 168 

Data Structure:

Code
str(fifedata.clean$Q31_1, vec.len=50)
 num [1:468] 3 1 1 3 1 4 1 4 3 3 4 1 1 1 1 3 1 1 1 3 4 2 1 1 1 1 1 1 2 2 3 4 1 5 3 3 1 5 1 1 1 1 1 1 1 4 1 1 3 1 1 2 1 4 2 1 1| __truncated__ ...
 - attr(*, "format.spss")= chr "F15.0"
 - attr(*, "display_width")= int 15
Code
table(fifedata.clean$Q31_1)

  1   2   3   4   5 
316  60  46  22  24 

Data Structure: Race

Code
str(fifedata.clean$Race, vec.len=50)
 dbl+lbl [1:468] 5, 1, 2, 5, 1, 1, 3, 1, 5, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1...
 @ format.spss  : chr "F8.2"
 @ display_width: int 10
 @ labels       : Named num [1:5] 1 2 3 4 5
  ..- attr(*, "names")= chr [1:5] "Black" "White" "Indigenous" "Asian" "Other"
Code
table(fifedata.clean$Race)

  1   2   3   4   5 
371  13   8   4  70 

Data Structure: Gender

Code
str(fifedata.clean$Gender, vec.len=50)
 dbl+lbl [1:468] 3, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1...
 @ format.spss  : chr "F8.2"
 @ display_width: int 10
 @ labels       : Named num [1:3] 1 2 3
  ..- attr(*, "names")= chr [1:3] "Female" "Male" "Prefer not to say"
Code
table(fifedata.clean$Gender)

  1   2   3 
220 229  18 

Data Structure:

Code
str(fifedata.clean$Grade, vec.len=50)
 num [1:468] 8 8 8 7 7 7 7 8 7 7 7 6 8 8 6 8 7 8 8 7 6 7 6 7 6 7 8 7 6 8 8 6 6 8 8 8 6 7 6 8 8 6 8 8 8 6 6 7 8 7 7 6 6 8 7 6 6| __truncated__ ...
 - attr(*, "format.spss")= chr "F8.2"
 - attr(*, "display_width")= int 10
Code
table(fifedata.clean$Grade)

  6   7   8 
160 141 166 

Summary statistics for gender groups

Gender appears to be equally distributed between male and female students (N = 220 and N = 229, male and female students, respectively). There were no differences in mean coping scores for students in the male gender category (M = 3.044, SD = 0.748), compared to students in the female gender category (M = 2.960, SD = 0.667).

Code
library(rstatix)
library(ggpubr)
fifedata.clean %>%
  group_by(gender.fac) %>%
  get_summary_stats(ACOPE, type = "mean_sd")%>%
  na.omit()
# A tibble: 3 × 5
  gender.fac        variable     n  mean    sd
  <fct>             <fct>    <dbl> <dbl> <dbl>
1 Female            ACOPE      220  2.96 0.667
2 Male              ACOPE      229  3.04 0.748
3 Prefer not to say ACOPE       18  2.85 0.416

One-way ANOVA for gender groups

ANOVA test was conducted to determine if levels of coping differed based on gender. There was no statistically significant difference in levels of coping for students based on gender (F= 1.198, p = .303).

Code
model1a <- aov(ACOPE ~ gender.fac, data=fifedata.clean)%>%
  na.omit()
summary (model1a)
             Df Sum Sq Mean Sq F value Pr(>F)
gender.fac    2   1.18  0.5889   1.198  0.303
Residuals   464 228.02  0.4914               
1 observation deleted due to missingness
Code
model2a <- aov(QFSSSTotal ~ gender.fac, data=fifedata.clean)%>%
  na.omit()
summary (model2a)
             Df Sum Sq Mean Sq F value Pr(>F)
gender.fac    2    1.2  0.6045   0.855  0.426
Residuals   464  328.1  0.7071               
1 observation deleted due to missingness
Code
model3a <- aov(SSTEMTotal ~ gender.fac, data=fifedata.clean)%>%
  na.omit()
summary (model3a)
             Df Sum Sq Mean Sq F value Pr(>F)  
gender.fac    2   1.02  0.5111   2.372 0.0944 .
Residuals   464  99.99  0.2155                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness
Code
model4a <- aov(CERQTotal ~ gender.fac, data=fifedata.clean)%>%
  na.omit()
summary (model4a)
             Df Sum Sq Mean Sq F value Pr(>F)
gender.fac    2   0.23  0.1147   0.223  0.801
Residuals   464 239.08  0.5153               
1 observation deleted due to missingness
Code
model5a <- aov(SemanticsTotal ~ gender.fac, data=fifedata.clean)%>%
  na.omit()
summary (model5a)
             Df Sum Sq Mean Sq F value Pr(>F)  
gender.fac    2    6.7   3.351   3.368 0.0353 *
Residuals   464  461.6   0.995                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness

Visualization for gender groups

Code
ggplot(data = fifedata.clean, mapping = aes(x = gender.fac, y = ACOPE)) +
  geom_boxplot() + 
  ggplot2::labs(title = "Coping by Gender",
       y = "ACOPE",
       x = "gender.fac",
       caption = "N = 468.")%>%
  na.omit()

Summary statistics for race groups

There were no differences in mean coping scores among black, white, indigenous, asian and others races (M = 3.036, SD = 0.721; M = 3.036, SD = 0.595; M = 3.120, SD = 0.332; M = 2.940, SD = 0.280, M = 2.784, SD = 0.627, respectively).

Positionality: I am interested in studying the experiences of historically underrepresented minority students. The present data set comprises participants from what appears to be a predominantly black middle school. In this case, since the black race is much larger than other groups (N = 371) out of a sample size of 468, statistical analysis was conducted to explore academic resilience for all participants as defined by relationships between predictors associated with academic resilience regardless of race or gender.

Code
library(rstatix)
library(ggpubr)
fifedata.clean %>%
  group_by(race.fac) %>%
  get_summary_stats(ACOPE, type = "mean_sd")%>%
na.omit()
# A tibble: 5 × 5
  race.fac   variable     n  mean    sd
  <fct>      <fct>    <dbl> <dbl> <dbl>
1 Black      ACOPE      371  3.04 0.721
2 White      ACOPE       13  3.04 0.595
3 Indigenous ACOPE        8  3.12 0.332
4 Asian      ACOPE        4  2.94 0.28 
5 Other      ACOPE       70  2.78 0.627

One-way ANOVA for Race groups

ANOVA test was conducted to determine if levels of coping differed based on race. There was no statistically significant difference in levels of coping based on race (F= 1.995, p = .0942).

Code
model1b <- aov(ACOPE ~ race.fac, data=fifedata.clean)
summary (model1b)
             Df Sum Sq Mean Sq F value Pr(>F)  
race.fac      4   3.89  0.9734   1.995 0.0942 .
Residuals   461 224.89  0.4878                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
2 observations deleted due to missingness
Code
model2b <- aov(SemanticsTotal ~ race.fac, data=fifedata.clean)
summary (model2b)
             Df Sum Sq Mean Sq F value Pr(>F)
race.fac      4    6.4  1.6095   1.612   0.17
Residuals   461  460.4  0.9987               
2 observations deleted due to missingness
Code
model3b <- aov(SSTEMTotal ~ race.fac, data=fifedata.clean)
summary (model3b)
             Df Sum Sq Mean Sq F value Pr(>F)  
race.fac      4   1.96  0.4898    2.28 0.0598 .
Residuals   461  99.01  0.2148                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
2 observations deleted due to missingness
Code
model4b <- aov(CERQTotal ~ race.fac, data=fifedata.clean)
summary (model4b)
             Df Sum Sq Mean Sq F value Pr(>F)
race.fac      4   1.79  0.4471    0.88  0.476
Residuals   461 234.27  0.5082               
2 observations deleted due to missingness
Code
model5b <- aov(QFSSSTotal ~ race.fac, data=fifedata.clean)
summary (model5b)
             Df Sum Sq Mean Sq F value Pr(>F)
race.fac      4    1.6  0.3923   0.552  0.698
Residuals   461  327.7  0.7109               
2 observations deleted due to missingness

Visualization for Race groups

Code
ggplot(data = fifedata.clean, mapping = aes(x = race.fac, y = ACOPE)) +
  geom_boxplot() + 
  ggplot2::labs(title = "Coping by Race",
       y = "ACOPE",
       x = "race.fac",
       caption = "N = 468.")

Summary statistics for grade groups

There were no differences in mean coping scores based on grade level (M = 3.134, SD = 0.689; M = 3.021, SD = 0.704; M = 2.844, SD = 0.684, for grade 6, grade 7 and grade 8, respectively).

Code
library(rstatix)
library(ggpubr)
fifedata.clean %>%
  group_by(grade.fac) %>%
  get_summary_stats(ACOPE, type = "mean_sd")%>%
na.omit()
# A tibble: 3 × 5
  grade.fac variable     n  mean    sd
  <fct>     <fct>    <dbl> <dbl> <dbl>
1 6         ACOPE      160  3.13 0.689
2 7         ACOPE      141  3.02 0.704
3 8         ACOPE      166  2.84 0.684

One-way ANOVA for grade groups

ANOVA test was conducted to determine if levels of coping differed based on grade. There was a statistically significant difference in levels of coping based on grade level (F= 7.272, p = .001).

Code
model1c <- aov(ACOPE ~ grade.fac, data=fifedata.clean)
summary (model1c)
             Df Sum Sq Mean Sq F value   Pr(>F)    
grade.fac     2   6.97   3.483   7.272 0.000777 ***
Residuals   464 222.23   0.479                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness
Code
model2c <- aov(QFSSSTotal ~ grade.fac, data=fifedata.clean)
summary (model2c)
             Df Sum Sq Mean Sq F value Pr(>F)
grade.fac     2    1.2  0.6175   0.873  0.418
Residuals   464  328.1  0.7071               
1 observation deleted due to missingness
Code
model3c <- aov(SemanticsTotal ~ grade.fac, data=fifedata.clean)
summary (model3c)
             Df Sum Sq Mean Sq F value   Pr(>F)    
grade.fac     2   21.1  10.529   10.92 2.32e-05 ***
Residuals   464  447.3   0.964                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness
Code
model4c <- aov(SSTEMTotal ~ grade.fac, data=fifedata.clean)
summary (model4c)
             Df Sum Sq Mean Sq F value Pr(>F)  
grade.fac     2   1.10  0.5497   2.553 0.0789 .
Residuals   464  99.91  0.2153                 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
1 observation deleted due to missingness
Code
model5c <- aov(CERQTotal ~ grade.fac, data=fifedata.clean)
summary (model5c)
             Df Sum Sq Mean Sq F value Pr(>F)
grade.fac     2   0.06  0.0282   0.055  0.947
Residuals   464 239.26  0.5156               
1 observation deleted due to missingness

Pairwise Comparisons: Grade

A pairwise t-test comparison showed a statistically significant difference between grade 6 and grade 8 mean scores (p < .05). This suggests that coping may vary based on age.

Code
pairwise.t.test(fifedata.clean$ACOPE, fifedata.clean$grade.fac, p.adjust.method = "bonf")

    Pairwise comparisons using t tests with pooled SD 

data:  fifedata.clean$ACOPE and fifedata.clean$grade.fac 

  6       7      
7 0.46763 -      
8 0.00053 0.07963

P value adjustment method: bonferroni 

Visualization for grade groups

Code
ggplot(data = fifedata.clean, mapping = aes(x = grade.fac, y = ACOPE)) +
  geom_boxplot() + 
  ggplot2::labs(title = "Coping by Grade level",
       y = "ACOPE",
       x = "grade.fac",
       caption = "N = 468.")

Variable Correlation: ACOPE, SSTEM, Semantics, QFSSS, CERQ

Code
library(dplyr)
fifedata.clean2<- fifedata.clean %>%
  select(ACOPE,QFSSSTotal, SemanticsTotal, SSTEMTotal,CERQTotal)
Code
corr_matrix <- cor(fifedata.clean2)
print(corr_matrix)
                   ACOPE QFSSSTotal SemanticsTotal SSTEMTotal CERQTotal
ACOPE          1.0000000  0.3734405      0.3293249  0.2853179 0.5139603
QFSSSTotal     0.3734405  1.0000000      0.2514169  0.2177040 0.3904905
SemanticsTotal 0.3293249  0.2514169      1.0000000  0.5343842 0.2988322
SSTEMTotal     0.2853179  0.2177040      0.5343842  1.0000000 0.3720373
CERQTotal      0.5139603  0.3904905      0.2988322  0.3720373 1.0000000

Descriptive Statistics

Code
describe(fifedata.clean2)
fifedata.clean2 

 5  Variables      468  Observations
--------------------------------------------------------------------------------
ACOPE  Format:F8.2 
       n  missing distinct     Info     Mean      Gmd      .05      .10 
     468        0      143        1    2.995   0.7647    1.920    2.198 
     .25      .50      .75      .90      .95 
   2.593    3.000    3.352    3.889    4.259 

lowest : 1       1.11111 1.18519 1.2037  1.22222
highest: 4.61111 4.85185 4.90741 4.98148 5      
--------------------------------------------------------------------------------
QFSSSTotal  Format:F8.2 
       n  missing distinct     Info     Mean      Gmd      .05      .10 
     468        0       58    0.999    3.216    0.952    1.957    2.133 
     .25      .50      .75      .90      .95 
   2.667    3.200    3.733    4.400    4.667 

lowest : 1       1.13333 1.33333 1.4     1.46667
highest: 4.73333 4.8     4.86667 4.93333 5      
--------------------------------------------------------------------------------
SemanticsTotal  Format:F8.2 
       n  missing distinct     Info     Mean      Gmd      .05      .10 
     468        0      265        1    4.192     1.14    2.780    2.988 
     .25      .50      .75      .90      .95 
   3.400    4.140    5.010    5.525    5.800 

lowest : 1       1.1     1.36364 1.54545 1.57143
highest: 5.8     5.82353 5.83333 5.86957 7      
--------------------------------------------------------------------------------
SSTEMTotal  Format:F8.2 
       n  missing distinct     Info     Mean      Gmd      .05      .10 
     468        0       92        1    3.283   0.5206    2.413    2.707 
     .25      .50      .75      .90      .95 
   3.024    3.310    3.595    3.857    4.071 

lowest : 1.83333 1.88095 1.90476 1.97619 2.04762
highest: 4.2381  4.35714 4.45238 4.5     4.61905
--------------------------------------------------------------------------------
CERQTotal  Format:F8.2 
       n  missing distinct     Info     Mean      Gmd      .05      .10 
     468        0      108        1    2.938   0.7945    1.760    2.000 
     .25      .50      .75      .90      .95 
   2.549    3.000    3.333    3.778    4.046 

lowest : 1       1.02778 1.08333 1.11111 1.13889
highest: 4.5     4.61111 4.75    4.88889 5      
--------------------------------------------------------------------------------

Density Plot: ACOPE

Code
ggplot(data = fifedata.clean, mapping = aes(x = ACOPE)) +
  geom_density(color="black", fill="purple") + 
  labs(title = "Density Plot of ACOPE Score",
                      x = "ACOPE Score")

Density plot: CERQTotal

Code
ggplot(data = fifedata.clean, mapping = aes(x = CERQTotal)) +
  geom_density(color="black", fill="pink") + 
  labs(title = "Density Plot of CERQTotal Score",
                      x = "CERQTotal Score")

Density plot: SemanticsTotal

Code
ggplot(data = fifedata.clean, mapping = aes(x = SemanticsTotal)) +
  geom_density(color="black", fill="yellow") + 
  labs(title = "Density Plot of SemanticsTotal Score",
                      x = "SemanticsTotal Score")

Density plot: SSTEMTotal

Code
ggplot(data = fifedata.clean, mapping = aes(x = SSTEMTotal)) +
  geom_density(color="black", fill="grey") + 
  labs(title = "Density Plot of SSTEMTotal Score",
                      x = "SSTEMTotal Score")

Density plot: QFSSSTotal

Code
ggplot(data = fifedata.clean, mapping = aes(x = QFSSSTotal)) +
  geom_density(color="black", fill="green") + 
  labs(title = "Density Plot of QFSSSTotal Score",
                      x = "QFSSSTotal Score")

Density plot: Daily Life Experiences

Code
ggplot(data = fifedata.clean, mapping = aes(x = DailyLifeExperiences)) +
  geom_density(color="black", fill="red") + 
  labs(title = "Density Plot of Daily Life Experiences",
                      x = "Daily Life Experiences Scores")

Data Set: SSTEM

Code
fifedata.cleansstem<- fifedata.clean %>%
  select(.,
         SSTEMMath,
         SSTEMScience,
         SSTEMTechEngineer,
         SSTEM21stCentury,
         SSTEMYourFuture)
get_summary_stats(fifedata.cleansstem, type = "mean_sd")
# A tibble: 5 × 4
  variable              n  mean    sd
  <fct>             <dbl> <dbl> <dbl>
1 SSTEMMath           468  3.30 0.814
2 SSTEMScience        468  3.04 0.596
3 SSTEMTechEngineer   468  3.41 0.764
4 SSTEM21stCentury    468  3.75 0.726
5 SSTEMYourFuture     468  2.43 0.656

Data Set: STEM Semantics

Code
fifedata.cleansemantics<- fifedata.clean %>%
  select(.,
         SemanticsScience,
         SemanticsMath,
         SemanticsEngineering,
         SemanticsTechnology,
         SemanticsJobInSTEM)
  get_summary_stats(fifedata.cleansemantics, type = "mean_sd")
# A tibble: 5 × 4
  variable                 n  mean    sd
  <fct>                <dbl> <dbl> <dbl>
1 SemanticsScience       337  4.41  1.12
2 SemanticsMath          295  4.31  1.21
3 SemanticsEngineering   326  4.34  1.20
4 SemanticsTechnology    348  4.65  1.18
5 SemanticsJobInSTEM     350  4.20  1.22

Data Set: CERQ

Code
fifedata.cleancerq<- fifedata.clean %>%
  select(.,
         CERQSelfBlame,
         CERQAcceptance,
         CERQRumination,
         CERQPositiveRefocusing,
         CERQRefocusOnPlanning,
         CERQCatastrophizing,
         CERQOtherBlame,
         CERQPuttingIntoPerspective,
         CERQPositiveReappraisal)
get_summary_stats(fifedata.cleancerq, type = "mean_sd")
# A tibble: 9 × 4
  variable                       n  mean    sd
  <fct>                      <dbl> <dbl> <dbl>
1 CERQSelfBlame                468  2.73 0.887
2 CERQAcceptance               468  3.09 0.89 
3 CERQRumination               468  2.96 0.877
4 CERQPositiveRefocusing       468  2.94 0.932
5 CERQRefocusOnPlanning        468  3.18 0.951
6 CERQCatastrophizing          468  2.78 0.956
7 CERQOtherBlame               468  2.56 0.931
8 CERQPuttingIntoPerspective   468  3.07 0.931
9 CERQPositiveReappraisal      468  3.13 0.976

Data Set: Social Support

Code
fifedata.cleansupport<- fifedata.clean %>%
  select(.,
         QFSSSCommunity,
         QFSSSFamily,
         QFSSSFriends,
         QFSSSPartner
         )
get_summary_stats(fifedata.cleansupport, type = "mean_sd")
# A tibble: 4 × 4
  variable           n  mean    sd
  <fct>          <dbl> <dbl> <dbl>
1 QFSSSCommunity   468  3.09  1.11
2 QFSSSFamily      468  3.62  1.08
3 QFSSSFriends     468  3.41  1.04
4 QFSSSPartner     468  3.17  1.06

Data Set: ACOPE

Code
fifedata.cleancoping<- fifedata.clean %>%
  select(.,
         Q30_1,
         Q30_2,
         Q30_3,
         Q30_4,
         Q30_5,
         Q30_6,
         Q30_7,
         Q30_8,
         Q30_9,
         Q30_10,
         Q30_11,
         Q30_12,
         Q30_13,
         Q30_14,
         Q30_15,
         Q30_16,
         Q30_17,
         Q30_18,
         Q30_19,
         Q30_20,
         Q30_21,
         Q30_22,
         Q30_23,
         Q30_24,
         Q30_25,
         Q30_26,
         Q30_27,
         Q30_28,
         Q30_29,
         Q30_30,
         Q30_31,
         Q30_32,
         Q30_33,
         Q30_34,
         Q30_35,
         Q30_36,
         Q30_37,
         Q30_38,
         Q30_39,
         Q30_40,
         Q30_41,
         Q30_42,
         Q30_43,
         Q30_44,
         Q30_45,
         Q30_46,
         Q30_47,
         Q30_48,
         Q30_49,
         Q30_50,
         Q30_51,
         Q30_52,
         Q30_53,
         Q30_54
         )
get_summary_stats(fifedata.cleancoping, type = "mean_sd")
# A tibble: 54 × 4
   variable     n  mean    sd
   <fct>    <dbl> <dbl> <dbl>
 1 Q30_1      468  3.73  1.23
 2 Q30_2      468  2.96  1.25
 3 Q30_3      468  3.17  1.24
 4 Q30_4      468  3.31  1.23
 5 Q30_5      468  3.73  1.32
 6 Q30_6      468  2.53  1.40
 7 Q30_7      468  3.80  1.23
 8 Q30_8      468  2.43  1.41
 9 Q30_9      468  2.24  1.41
10 Q30_10     468  2.86  1.29
# ℹ 44 more rows

CFA SSTEM

Chi-squre test statistic (X2 = 24.85) is significant (p < .05). The software has fixed SSTEMMath loading to 1, considered as the item marker approach to give latent variable a scale. CFI= TLI= RMSEA (.092) is higher than .06. The RMSEA CI does not include zero and is therefore significant (RMSEA= .092, 95% CI [.058, .13]). SRMR = .043 (<.06). SSTEM Math appear to have low factor loading (.253) compared to other factors and is less than the .3 cut off.

Code
sstem_cfa1  <- 'SSTEM =~ SSTEMMath + SSTEMScience + SSTEMTechEngineer + SSTEM21stCentury + SSTEMYourFuture'
sstem_cfa1_model <- cfa(sstem_cfa1, data=fifedata.cleansstem) 
summary(sstem_cfa1_model, rsquare= TRUE, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6.17 ended normally after 32 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        10

  Number of observations                           468

Model Test User Model:
                                                      
  Test statistic                                24.851
  Degrees of freedom                                 5
  P-value (Chi-square)                           0.000

Model Test Baseline Model:

  Test statistic                               325.376
  Degrees of freedom                                10
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.937
  Tucker-Lewis Index (TLI)                       0.874

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -2355.770
  Loglikelihood unrestricted model (H1)      -2343.345
                                                      
  Akaike (AIC)                                4731.540
  Bayesian (BIC)                              4773.024
  Sample-size adjusted Bayesian (SABIC)       4741.287

Root Mean Square Error of Approximation:

  RMSEA                                          0.092
  90 Percent confidence interval - lower         0.058
  90 Percent confidence interval - upper         0.130
  P-value H_0: RMSEA <= 0.050                    0.023
  P-value H_0: RMSEA >= 0.080                    0.745

Standardized Root Mean Square Residual:

  SRMR                                           0.043

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  SSTEM =~                                                              
    SSTEMMath         1.000                               0.206    0.253
    SSTEMScience      1.403    0.324    4.334    0.000    0.289    0.485
    SSTEMTechEngnr    2.880    0.633    4.550    0.000    0.593    0.777
    SSTEM21stCntry    2.141    0.474    4.516    0.000    0.441    0.608
    SSTEMYourFutur    1.486    0.346    4.294    0.000    0.306    0.466

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .SSTEMMath         0.619    0.042   14.911    0.000    0.619    0.936
   .SSTEMScience      0.271    0.020   13.431    0.000    0.271    0.765
   .SSTEMTechEngnr    0.230    0.036    6.338    0.000    0.230    0.396
   .SSTEM21stCntry    0.331    0.029   11.370    0.000    0.331    0.630
   .SSTEMYourFutur    0.336    0.025   13.628    0.000    0.336    0.782
    SSTEM             0.042    0.018    2.378    0.017    1.000    1.000

R-Square:
                   Estimate
    SSTEMMath         0.064
    SSTEMScience      0.235
    SSTEMTechEngnr    0.604
    SSTEM21stCntry    0.370
    SSTEMYourFutur    0.218

SSTEM CFA Plot

Code
semPlot::semPaths(sstem_cfa1_model, whatLabels = "stand")

CFA Coping

Code
coping_cfa1  <- 'cope =~ Q30_1 + Q30_2 + Q30_3 + Q30_4 + Q30_5 + Q30_6 + Q30_7 + Q30_8 + Q30_9 + Q30_10 + Q30_11 + Q30_12 + Q30_13 + Q30_14 + Q30_15 + Q30_16 + Q30_17 + Q30_18 + Q30_19 + Q30_20 + Q30_21 + Q30_22 + Q30_23 + Q30_24 + Q30_25 + Q30_26 + Q30_27 + Q30_28 + Q30_29 + Q30_30 + Q30_31 + Q30_32 + Q30_33 + Q30_34 + Q30_35 + Q30_36 + Q30_37 + Q30_38 + Q30_39 + Q30_40 + Q30_41 + Q30_42 + Q30_43 + Q30_44 + Q30_45 + Q30_46 + Q30_47 + Q30_48 + Q30_49 + Q30_50 + Q30_51 + Q30_52 + Q30_53 + Q30_54'
coping_cfa1_model <- cfa(coping_cfa1, data=fifedata.cleancoping) 
summary(coping_cfa1_model, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6.17 ended normally after 44 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                       108

  Number of observations                           468

Model Test User Model:
                                                      
  Test statistic                              5816.726
  Degrees of freedom                              1377
  P-value (Chi-square)                           0.000

Model Test Baseline Model:

  Test statistic                             12757.499
  Degrees of freedom                              1431
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.608
  Tucker-Lewis Index (TLI)                       0.593

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -39265.414
  Loglikelihood unrestricted model (H1)     -36357.051
                                                      
  Akaike (AIC)                               78746.828
  Bayesian (BIC)                             79194.863
  Sample-size adjusted Bayesian (SABIC)      78852.093

Root Mean Square Error of Approximation:

  RMSEA                                          0.083
  90 Percent confidence interval - lower         0.081
  90 Percent confidence interval - upper         0.085
  P-value H_0: RMSEA <= 0.050                    0.000
  P-value H_0: RMSEA >= 0.080                    0.988

Standardized Root Mean Square Residual:

  SRMR                                           0.095

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  cope =~                                                               
    Q30_1             1.000                               0.478    0.388
    Q30_2             1.290    0.180    7.166    0.000    0.617    0.496
    Q30_3             1.262    0.178    7.104    0.000    0.603    0.487
    Q30_4             1.327    0.182    7.304    0.000    0.634    0.517
    Q30_5             1.021    0.166    6.130    0.000    0.488    0.371
    Q30_6             1.539    0.209    7.372    0.000    0.735    0.528
    Q30_7             1.152    0.169    6.829    0.000    0.551    0.449
    Q30_8             1.181    0.184    6.426    0.000    0.564    0.402
    Q30_9             1.266    0.190    6.674    0.000    0.605    0.430
    Q30_10            1.674    0.213    7.852    0.000    0.800    0.619
    Q30_11            1.482    0.199    7.455    0.000    0.708    0.542
    Q30_12            1.587    0.205    7.734    0.000    0.758    0.594
    Q30_13            1.537    0.202    7.597    0.000    0.735    0.567
    Q30_14            0.861    0.156    5.511    0.000    0.411    0.315
    Q30_15            1.478    0.194    7.612    0.000    0.706    0.570
    Q30_16            1.585    0.217    7.320    0.000    0.758    0.519
    Q30_17            1.649    0.213    7.723    0.000    0.788    0.592
    Q30_18            1.908    0.234    8.169    0.000    0.912    0.697
    Q30_19            1.238    0.183    6.774    0.000    0.592    0.442
    Q30_20            1.390    0.192    7.238    0.000    0.664    0.507
    Q30_21            1.564    0.206    7.605    0.000    0.747    0.569
    Q30_22            1.461    0.197    7.400    0.000    0.698    0.533
    Q30_23            1.534    0.205    7.467    0.000    0.733    0.544
    Q30_24            1.114    0.171    6.521    0.000    0.532    0.412
    Q30_25            1.628    0.207    7.868    0.000    0.778    0.622
    Q30_26            0.991    0.169    5.855    0.000    0.474    0.345
    Q30_27            1.533    0.199    7.688    0.000    0.733    0.585
    Q30_28            1.327    0.187    7.095    0.000    0.634    0.485
    Q30_29            1.566    0.203    7.714    0.000    0.749    0.590
    Q30_30            1.638    0.207    7.892    0.000    0.783    0.628
    Q30_31            1.679    0.220    7.645    0.000    0.803    0.576
    Q30_32            1.281    0.179    7.176    0.000    0.612    0.497
    Q30_33            1.551    0.205    7.567    0.000    0.741    0.562
    Q30_34            1.637    0.217    7.558    0.000    0.782    0.560
    Q30_35            1.680    0.212    7.943    0.000    0.803    0.639
    Q30_36            1.354    0.188    7.215    0.000    0.647    0.503
    Q30_37            1.746    0.219    7.977    0.000    0.834    0.647
    Q30_38            1.624    0.214    7.582    0.000    0.776    0.564
    Q30_39            1.624    0.216    7.516    0.000    0.776    0.552
    Q30_40            1.852    0.235    7.883    0.000    0.885    0.626
    Q30_41            1.674    0.212    7.882    0.000    0.800    0.625
    Q30_42            1.070    0.168    6.376    0.000    0.511    0.396
    Q30_43            1.312    0.180    7.277    0.000    0.627    0.513
    Q30_44            1.404    0.193    7.284    0.000    0.671    0.514
    Q30_45            1.566    0.203    7.723    0.000    0.748    0.592
    Q30_46            1.035    0.167    6.188    0.000    0.495    0.377
    Q30_47            1.300    0.181    7.174    0.000    0.621    0.497
    Q30_48            1.010    0.160    6.298    0.000    0.483    0.388
    Q30_49            1.179    0.179    6.581    0.000    0.564    0.419
    Q30_50            1.452    0.202    7.173    0.000    0.694    0.497
    Q30_51            1.639    0.216    7.578    0.000    0.784    0.564
    Q30_52            1.685    0.221    7.634    0.000    0.805    0.574
    Q30_53            1.255    0.189    6.631    0.000    0.600    0.425
    Q30_54            1.757    0.225    7.822    0.000    0.840    0.612

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .Q30_1             1.288    0.085   15.173    0.000    1.288    0.849
   .Q30_2             1.167    0.077   15.069    0.000    1.167    0.754
   .Q30_3             1.172    0.078   15.080    0.000    1.172    0.763
   .Q30_4             1.104    0.073   15.042    0.000    1.104    0.733
   .Q30_5             1.490    0.098   15.185    0.000    1.490    0.862
   .Q30_6             1.401    0.093   15.027    0.000    1.401    0.721
   .Q30_7             1.197    0.079   15.120    0.000    1.197    0.798
   .Q30_8             1.653    0.109   15.162    0.000    1.653    0.838
   .Q30_9             1.612    0.106   15.138    0.000    1.612    0.815
   .Q30_10            1.031    0.069   14.863    0.000    1.031    0.617
   .Q30_11            1.208    0.080   15.006    0.000    1.208    0.706
   .Q30_12            1.056    0.071   14.916    0.000    1.056    0.647
   .Q30_13            1.137    0.076   14.965    0.000    1.137    0.678
   .Q30_14            1.538    0.101   15.220    0.000    1.538    0.901
   .Q30_15            1.036    0.069   14.960    0.000    1.036    0.675
   .Q30_16            1.553    0.103   15.039    0.000    1.553    0.730
   .Q30_17            1.153    0.077   14.921    0.000    1.153    0.650
   .Q30_18            0.881    0.060   14.637    0.000    0.881    0.515
   .Q30_19            1.438    0.095   15.127    0.000    1.438    0.804
   .Q30_20            1.278    0.085   15.056    0.000    1.278    0.743
   .Q30_21            1.168    0.078   14.963    0.000    1.168    0.676
   .Q30_22            1.231    0.082   15.020    0.000    1.231    0.716
   .Q30_23            1.279    0.085   15.003    0.000    1.279    0.704
   .Q30_24            1.381    0.091   15.154    0.000    1.381    0.830
   .Q30_25            0.958    0.064   14.855    0.000    0.958    0.613
   .Q30_26            1.663    0.109   15.203    0.000    1.663    0.881
   .Q30_27            1.034    0.069   14.934    0.000    1.034    0.658
   .Q30_28            1.306    0.087   15.082    0.000    1.306    0.764
   .Q30_29            1.050    0.070   14.924    0.000    1.050    0.652
   .Q30_30            0.943    0.064   14.843    0.000    0.943    0.606
   .Q30_31            1.295    0.087   14.949    0.000    1.295    0.668
   .Q30_32            1.142    0.076   15.067    0.000    1.142    0.753
   .Q30_33            1.192    0.080   14.975    0.000    1.192    0.684
   .Q30_34            1.339    0.089   14.977    0.000    1.339    0.686
   .Q30_35            0.933    0.063   14.814    0.000    0.933    0.591
   .Q30_36            1.235    0.082   15.060    0.000    1.235    0.747
   .Q30_37            0.965    0.065   14.793    0.000    0.965    0.581
   .Q30_38            1.289    0.086   14.970    0.000    1.289    0.681
   .Q30_39            1.371    0.091   14.990    0.000    1.371    0.695
   .Q30_40            1.218    0.082   14.847    0.000    1.218    0.609
   .Q30_41            0.997    0.067   14.848    0.000    0.997    0.609
   .Q30_42            1.402    0.092   15.167    0.000    1.402    0.843
   .Q30_43            1.103    0.073   15.048    0.000    1.103    0.737
   .Q30_44            1.255    0.083   15.046    0.000    1.255    0.736
   .Q30_45            1.040    0.070   14.920    0.000    1.040    0.650
   .Q30_46            1.478    0.097   15.181    0.000    1.478    0.858
   .Q30_47            1.178    0.078   15.068    0.000    1.178    0.753
   .Q30_48            1.314    0.087   15.173    0.000    1.314    0.849
   .Q30_49            1.488    0.098   15.148    0.000    1.488    0.824
   .Q30_50            1.470    0.098   15.068    0.000    1.470    0.753
   .Q30_51            1.318    0.088   14.971    0.000    1.318    0.682
   .Q30_52            1.318    0.088   14.953    0.000    1.318    0.670
   .Q30_53            1.631    0.108   15.143    0.000    1.631    0.819
   .Q30_54            1.175    0.079   14.878    0.000    1.175    0.625
    cope              0.228    0.053    4.276    0.000    1.000    1.000

CFA Semantics

Is the SSTEM questionnaire best represented by the subscales

Code
semantics_cfa1  <- 'semantics =~ SemanticsScience + SemanticsMath + SemanticsEngineering + SemanticsTechnology + SemanticsJobInSTEM'
semantics_cfa1_model <- cfa(semantics_cfa1, data=fifedata.cleansemantics) 
summary(semantics_cfa1_model, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6.17 ended normally after 19 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        10

                                                  Used       Total
  Number of observations                           155         468

Model Test User Model:
                                                      
  Test statistic                                 8.805
  Degrees of freedom                                 5
  P-value (Chi-square)                           0.117

Model Test Baseline Model:

  Test statistic                               339.551
  Degrees of freedom                                10
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.988
  Tucker-Lewis Index (TLI)                       0.977

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1066.575
  Loglikelihood unrestricted model (H1)      -1062.173
                                                      
  Akaike (AIC)                                2153.150
  Bayesian (BIC)                              2183.584
  Sample-size adjusted Bayesian (SABIC)       2151.932

Root Mean Square Error of Approximation:

  RMSEA                                          0.070
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.145
  P-value H_0: RMSEA <= 0.050                    0.274
  P-value H_0: RMSEA >= 0.080                    0.480

Standardized Root Mean Square Residual:

  SRMR                                           0.029

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  semantics =~                                                          
    SemanticsScinc    1.000                               0.845    0.771
    SemanticsMath     0.916    0.122    7.487    0.000    0.773    0.618
    SemntcsEngnrng    1.079    0.118    9.145    0.000    0.911    0.743
    SemntcsTchnlgy    1.033    0.112    9.231    0.000    0.873    0.749
    SmntcsJbInSTEM    1.182    0.115   10.255    0.000    0.998    0.834

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .SemanticsScinc    0.488    0.071    6.854    0.000    0.488    0.406
   .SemanticsMath     0.971    0.121    8.001    0.000    0.971    0.619
   .SemntcsEngnrng    0.675    0.094    7.171    0.000    0.675    0.448
   .SemntcsTchnlgy    0.594    0.084    7.103    0.000    0.594    0.438
   .SmntcsJbInSTEM    0.436    0.076    5.758    0.000    0.436    0.304
    semantics         0.714    0.133    5.385    0.000    1.000    1.000

CFA Social Support

Code
support_cfa1  <- 'socialsupport =~ QFSSSCommunity + QFSSSFamily + QFSSSFriends + QFSSSPartner'
support_cfa1_model <- cfa(support_cfa1, data=fifedata.cleansupport) 
summary(support_cfa1_model, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6.17 ended normally after 20 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         8

  Number of observations                           468

Model Test User Model:
                                                      
  Test statistic                                 2.982
  Degrees of freedom                                 2
  P-value (Chi-square)                           0.225

Model Test Baseline Model:

  Test statistic                               637.220
  Degrees of freedom                                 6
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.998
  Tucker-Lewis Index (TLI)                       0.995

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -2465.671
  Loglikelihood unrestricted model (H1)      -2464.180
                                                      
  Akaike (AIC)                                4947.342
  Bayesian (BIC)                              4980.530
  Sample-size adjusted Bayesian (SABIC)       4955.139

Root Mean Square Error of Approximation:

  RMSEA                                          0.032
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.103
  P-value H_0: RMSEA <= 0.050                    0.554
  P-value H_0: RMSEA >= 0.080                    0.165

Standardized Root Mean Square Residual:

  SRMR                                           0.012

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  socialsupport =~                                                      
    QFSSSCommunity    1.000                               0.687    0.622
    QFSSSFamily       1.004    0.090   11.153    0.000    0.690    0.639
    QFSSSFriends      1.291    0.099   13.068    0.000    0.886    0.855
    QFSSSPartner      1.190    0.094   12.677    0.000    0.817    0.771

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .QFSSSCommunity    0.749    0.056   13.435    0.000    0.749    0.614
   .QFSSSFamily       0.688    0.052   13.241    0.000    0.688    0.591
   .QFSSSFriends      0.290    0.041    7.140    0.000    0.290    0.270
   .QFSSSPartner      0.457    0.043   10.501    0.000    0.457    0.406
    socialsupport     0.472    0.068    6.895    0.000    1.000    1.000

CFA CERQ

Code
cerq_cfa1  <- 'cerq =~ CERQSelfBlame + CERQAcceptance + CERQRumination + CERQPositiveRefocusing + CERQRefocusOnPlanning + CERQCatastrophizing + CERQOtherBlame + CERQPuttingIntoPerspective + CERQPositiveReappraisal'
cerq_cfa1_model <- cfa(cerq_cfa1, data=fifedata.cleancerq) 
summary(cerq_cfa1_model, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6.17 ended normally after 23 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        18

  Number of observations                           468

Model Test User Model:
                                                      
  Test statistic                               479.754
  Degrees of freedom                                27
  P-value (Chi-square)                           0.000

Model Test Baseline Model:

  Test statistic                              2755.812
  Degrees of freedom                                36
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.834
  Tucker-Lewis Index (TLI)                       0.778

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4505.799
  Loglikelihood unrestricted model (H1)      -4265.922
                                                      
  Akaike (AIC)                                9047.598
  Bayesian (BIC)                              9122.270
  Sample-size adjusted Bayesian (SABIC)       9065.142

Root Mean Square Error of Approximation:

  RMSEA                                          0.189
  90 Percent confidence interval - lower         0.175
  90 Percent confidence interval - upper         0.204
  P-value H_0: RMSEA <= 0.050                    0.000
  P-value H_0: RMSEA >= 0.080                    1.000

Standardized Root Mean Square Residual:

  SRMR                                           0.078

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  cerq =~                                                               
    CERQSelfBlame     1.000                               0.628    0.709
    CERQAcceptance    1.086    0.069   15.829    0.000    0.682    0.767
    CERQRumination    1.135    0.068   16.770    0.000    0.713    0.814
    CERQPstvRfcsng    1.128    0.072   15.708    0.000    0.708    0.761
    CERQRfcsOnPlnn    1.194    0.073   16.271    0.000    0.750    0.789
    CERQCtstrphzng    1.020    0.073   13.873    0.000    0.640    0.671
    CERQOtherBlame    0.912    0.072   12.750    0.000    0.573    0.616
    CERQPttngIntPr    1.147    0.072   15.990    0.000    0.720    0.775
    CERQPstvRpprsl    1.201    0.075   15.969    0.000    0.755    0.774

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .CERQSelfBlame     0.390    0.028   13.984    0.000    0.390    0.497
   .CERQAcceptance    0.325    0.024   13.437    0.000    0.325    0.412
   .CERQRumination    0.259    0.020   12.739    0.000    0.259    0.338
   .CERQPstvRfcsng    0.365    0.027   13.506    0.000    0.365    0.421
   .CERQRfcsOnPlnn    0.341    0.026   13.149    0.000    0.341    0.378
   .CERQCtstrphzng    0.501    0.035   14.235    0.000    0.501    0.550
   .CERQOtherBlame    0.537    0.037   14.505    0.000    0.537    0.621
   .CERQPttngIntPr    0.345    0.026   13.339    0.000    0.345    0.399
   .CERQPstvRpprsl    0.381    0.029   13.352    0.000    0.381    0.401
    cerq              0.394    0.046    8.590    0.000    1.000    1.000
Code
semPlot::semPaths(coping_cfa1_model, whatLabels = "stand")

Structural Equation Modelling and Path Analysis

Survey Instruments:

  1. S-STEM Total: A 5-point likert scale validated survey for middle/high school students measuring students’ attitudes toward science, math, engineering and Technology and 21st century learning. The survey asks about students’ interest in STEM in addition to their attitude.

  2. STEM Semantics Total: A 7-point likert scale measuring perceptions of scientific discipline including, science, math, engineering, technology and jobs in STEM. Each construct is assessed using dichotomous adjective pairs including terms like “boring” versus “interesting” .

  3. QFSSS Total: Questionnaire on the Frequency of and Satisfaction with Social Support (QFSSS) is a 20-item, 4-point likert scale questionnaire assessing social support (Martín et al., 2016). The QFSSS was designed to assess the frequency of and the degree of satisfaction with perceived social support received from different sources in relation to three types of support: emotional, informational, and instrumental.CERQ Total (7-point likert-scale).

  4. ACOPE: A 5-point scale, 54-item self-report questionnaire used to identify coping strategies employed by adolescents.

  5. CERQ: The Cognitive Emotion Regulation (CERQ) questionaire is a 36-item, 5-point scale survey measuring constructs including, self-blame, other-blame, rumination, catastrophizing, putting into perspective, positive refocusing, positive reappraisal, and acceptance. 

Research Questions:

  1. What is the relationship between coping (ACOPE) and cognitive emotion regulation (CERQ), perceptions of scientific disciplines (STEM semantics), degree of satisfaction with percieved social support (QFSSS), and students’ attitudes and interests towards STEM disciplines (S-STEM) predictors in middle school students (Grades 6,7 and 8)?

  2. How does the students’ perception of the degree of social support impact coping strategies employed by adolescents with mediation through composite cognitive emotion regulation in middle school students (Grades 6,7 and 8)?

  3. How can academic resilience (latent variable) be predicted through coping strategies employed by adolescents in middle school (Grades 6,7 and 8)?

  4. How can academic resilience be predicted through composite predictors cognitive emotion regulation (CERQ), perceptions of scientific disciplines (STEM semantics), degree of satisfaction with percieved social support (QFSSS), and students’ attitudes and interests towards STEM disciplines (S-STEM) in middle school students (Grades 6,7 and 8)?

Hypotheses:

  1. There is a significant relationship between coping strategies employed by adolescents and cognitive emotion regulation (CERQ), perceptions of scientific disciplines (STEM semantics), degree of satisfaction with percieved social support (QFSSS), and students’ attitudes and interests towards STEM disciplines (S-STEM) in middle school students (Grades 6, 7 and 8).

  2. There is a significant mediating relationship between degree of satisfaction with percieved social support (QFSSS) and coping strategies employed by adolescents through cognitive emotion regulation (CERQ) in middle school students in Grades 6,7 and 8. 

  3. There is a significant relationship between composite predictors cognitive emotion regulation (CERQ), perceptions of scientific disciplines (STEM semantics), degree of satisfaction with percieved social support (QFSSS), and students’ attitudes and interests towards STEM disciplines (S-STEM) and a created latent variable, academic resilience.

Creating dummy variables for categories: race, gender, grade

Code
fifedata.clean2 <- fifedata.clean %>%
  mutate(.,
        black = case_when(
           race.fac== "Black" ~ 1,
           TRUE ~ 0),
        white = case_when(
           race.fac== "White" ~ 2,
           TRUE ~ 0),
        indigenous = case_when(
           race.fac== "Indigenous" ~ 3,
           TRUE ~ 0),
        asian = case_when(
           race.fac== "Asian" ~ 4,
           TRUE ~ 0),
        other = case_when(
          race.fac== "Other" ~ 5,
           TRUE ~ 0),
        grade6 = case_when(
          grade.fac== "6" ~ 1,
          TRUE ~ 0),
        grade7 = case_when(
          grade.fac== "7" ~ 1,
          TRUE ~ 0),
        grade8 = case_when(
          grade.fac== "8" ~ 1,
          TRUE ~ 0),
        male = case_when(
          gender.fac== "Male" ~ 1,
          TRUE ~ 0),
        female = case_when(
          grade.fac== "Female" ~ 1,
          TRUE ~ 0),
        pnts = case_when(
          grade.fac== "Prefer not to say" ~ 1,
          TRUE ~ 0)
        )

SEM: ACOPE (unstandardized)

Code
model1 <- 'ACOPE ~ SSTEMTotal + SemanticsTotal + QFSSSTotal + CERQTotal'
fit1 <- sem(model1, data = fifedata.clean, missing = "ML", fixed.x = FALSE, estimator = "MLR")
summary(fit1)
lavaan 0.6.17 ended normally after 33 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        20

  Number of observations                           468
  Number of missing patterns                         1

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                 0.000       0.000
  Degrees of freedom                                 0           0

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  ACOPE ~                                             
    SSTEMTotal        0.024    0.071    0.338    0.736
    SemanticsTotal    0.111    0.034    3.299    0.001
    QFSSSTotal        0.148    0.036    4.051    0.000
    CERQTotal         0.383    0.050    7.709    0.000

Covariances:
                    Estimate  Std.Err  z-value  P(>|z|)
  SSTEMTotal ~~                                        
    SemanticsTotal     0.250    0.025   10.006    0.000
    QFSSSTotal         0.086    0.022    3.951    0.000
    CERQTotal          0.125    0.018    6.992    0.000
  SemanticsTotal ~~                                    
    QFSSSTotal         0.212    0.046    4.648    0.000
    CERQTotal          0.215    0.041    5.275    0.000
  QFSSSTotal ~~                                        
    CERQTotal          0.235    0.034    6.841    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .ACOPE             0.848    0.187    4.542    0.000
    SSTEMTotal        3.283    0.022  151.921    0.000
    SemanticsTotal    4.192    0.046   90.515    0.000
    QFSSSTotal        3.216    0.039   82.740    0.000
    CERQTotal         2.938    0.033   88.718    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .ACOPE             0.332    0.033   10.156    0.000
    SSTEMTotal        0.218    0.016   13.851    0.000
    SemanticsTotal    1.004    0.061   16.449    0.000
    QFSSSTotal        0.707    0.043   16.557    0.000
    CERQTotal         0.513    0.038   13.588    0.000

SEM: ACOPE Standardized Model

A path analysis was conducted to assess the association between an individualʼs reported level of coping (ACOPE) and four predictors including composite STEM semantics score, composite social support score, composite SSTEM scores, and composite cognitive emotion regulation score .

Three predictors were found to be significantly associated with coping. An increase of one standard deviation in STEM Semantics predicted an increase of .16 standard deviations in coping level, after controlling for all other covariates (p = .001).

Similarly, social support had a positive relationship predicting that for an increase of one standard deviation in social support there is an expected increase of .18 standard deviations in coping, after controlling for all other covariates (p < .001).

Finally, an increase of one standard deviation in cognitive emotion regulation predicted an increase of .39 standard deviations in coping level, after controlling for all other covariates (p = .001).

SSTEM (p = .736) was not found to significantly predict coping after controlling for STEM semantics, social support, and cognitive emotion regulation. The model as a whole explained about 33% of the total variance in coping (R = .33).

Code
model1b <- 'ACOPE ~ SSTEMTotal + SemanticsTotal + QFSSSTotal + CERQTotal'

fit1b <- sem(model1b, data = fifedata.clean, missing = "ML", fixed.x = FALSE, estimator = "MLR")
summary(fit1b, standardized = TRUE, rsquare = TRUE)
lavaan 0.6.17 ended normally after 33 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        20

  Number of observations                           468
  Number of missing patterns                         1

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                 0.000       0.000
  Degrees of freedom                                 0           0

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ACOPE ~                                                               
    SSTEMTotal        0.024    0.071    0.338    0.736    0.024    0.016
    SemanticsTotal    0.111    0.034    3.299    0.001    0.111    0.159
    QFSSSTotal        0.148    0.036    4.051    0.000    0.148    0.177
    CERQTotal         0.383    0.050    7.709    0.000    0.383    0.391

Covariances:
                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  SSTEMTotal ~~                                                          
    SemanticsTotal     0.250    0.025   10.006    0.000    0.250    0.534
    QFSSSTotal         0.086    0.022    3.951    0.000    0.086    0.218
    CERQTotal          0.125    0.018    6.992    0.000    0.125    0.372
  SemanticsTotal ~~                                                      
    QFSSSTotal         0.212    0.046    4.648    0.000    0.212    0.251
    CERQTotal          0.215    0.041    5.275    0.000    0.215    0.299
  QFSSSTotal ~~                                                          
    CERQTotal          0.235    0.034    6.841    0.000    0.235    0.390

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .ACOPE             0.848    0.187    4.542    0.000    0.848    1.209
    SSTEMTotal        3.283    0.022  151.921    0.000    3.283    7.023
    SemanticsTotal    4.192    0.046   90.515    0.000    4.192    4.184
    QFSSSTotal        3.216    0.039   82.740    0.000    3.216    3.825
    CERQTotal         2.938    0.033   88.718    0.000    2.938    4.101

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .ACOPE             0.332    0.033   10.156    0.000    0.332    0.676
    SSTEMTotal        0.218    0.016   13.851    0.000    0.218    1.000
    SemanticsTotal    1.004    0.061   16.449    0.000    1.004    1.000
    QFSSSTotal        0.707    0.043   16.557    0.000    0.707    1.000
    CERQTotal         0.513    0.038   13.588    0.000    0.513    1.000

R-Square:
                   Estimate
    ACOPE             0.324

Visualize Path Analysis Model

Code
semPlot::semPaths(fit1b, whatLabels = "standardized")

Create and combine latent variable, academic resilience, with the multiple regression model

Code
model2 <- 'Resilience =~ SemanticsTotal + QFSSSTotal + CERQTotal + SSTEMTotal'

fit2 <- sem(model2, data=fifedata.clean, estimator = "MLR")
summary(fit2, fit.measures = TRUE, standardized = TRUE)
lavaan 0.6.17 ended normally after 18 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         8

  Number of observations                           468

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                38.973      42.032
  Degrees of freedom                                 2           2
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  0.927
    Yuan-Bentler correction (Mplus variant)                       

Model Test Baseline Model:

  Test statistic                               323.410     237.810
  Degrees of freedom                                 6           6
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.360

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.884       0.827
  Tucker-Lewis Index (TLI)                       0.651       0.482
                                                                  
  Robust Comparative Fit Index (CFI)                         0.882
  Robust Tucker-Lewis Index (TLI)                            0.647

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1921.789   -1921.789
  Scaling correction factor                                  1.314
      for the MLR correction                                      
  Loglikelihood unrestricted model (H1)      -1902.302   -1902.302
  Scaling correction factor                                  1.237
      for the MLR correction                                      
                                                                  
  Akaike (AIC)                                3859.577    3859.577
  Bayesian (BIC)                              3892.765    3892.765
  Sample-size adjusted Bayesian (SABIC)       3867.375    3867.375

Root Mean Square Error of Approximation:

  RMSEA                                          0.199       0.207
  90 Percent confidence interval - lower         0.147       0.153
  90 Percent confidence interval - upper         0.255       0.266
  P-value H_0: RMSEA <= 0.050                    0.000       0.000
  P-value H_0: RMSEA >= 0.080                    1.000       1.000
                                                                  
  Robust RMSEA                                               0.199
  90 Percent confidence interval - lower                     0.149
  90 Percent confidence interval - upper                     0.254
  P-value H_0: Robust RMSEA <= 0.050                         0.000
  P-value H_0: Robust RMSEA >= 0.080                         1.000

Standardized Root Mean Square Residual:

  SRMR                                           0.067       0.067

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Resilience =~                                                         
    SemanticsTotal    1.000                               0.688    0.686
    QFSSSTotal        0.478    0.087    5.473    0.000    0.328    0.390
    CERQTotal         0.539    0.075    7.226    0.000    0.371    0.517
    SSTEMTotal        0.500    0.054    9.347    0.000    0.344    0.736

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .SemanticsTotal    0.531    0.064    8.365    0.000    0.531    0.529
   .QFSSSTotal        0.599    0.044   13.713    0.000    0.599    0.848
   .CERQTotal         0.376    0.039    9.632    0.000    0.376    0.732
   .SSTEMTotal        0.100    0.019    5.234    0.000    0.100    0.459
    Resilience        0.473    0.069    6.882    0.000    1.000    1.000

CFA/SEM with latent variable Academic Resilience

A latent variable, academic resilience, was created and is defined in relation to STEM semantics, social support, cognitive emotion regulation and SSTEM. The academic resilience measure was then used to predict one other outcome, coping (ACOPE).

Academic resilience is a significant predictor of coping (p < .05). A one standard deviation increase in academic coping is associated with a .66 standard deviation in resilience (p < .05).

The R2 for academic resilience is about .43, indicating that coping explains about 43% of the variability in academic resilience.

Code
model3 <- '
# Measurement Portion
Resilience =~ SemanticsTotal + QFSSSTotal + CERQTotal + SSTEMTotal
# Regression Portion
ACOPE ~ Resilience'

fit3 <- sem(model3, data=fifedata.clean, estimator = "MLR")
summary(fit3, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
lavaan 0.6.17 ended normally after 23 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        10

  Number of observations                           468

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                81.924     102.160
  Degrees of freedom                                 5           5
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  0.802
    Yuan-Bentler correction (Mplus variant)                       

Model Test Baseline Model:

  Test statistic                               506.841     374.742
  Degrees of freedom                                10          10
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.353

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.845       0.734
  Tucker-Lewis Index (TLI)                       0.690       0.467
                                                                  
  Robust Comparative Fit Index (CFI)                         0.842
  Robust Tucker-Lewis Index (TLI)                            0.684

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -2349.575   -2349.575
  Scaling correction factor                                  1.523
      for the MLR correction                                      
  Loglikelihood unrestricted model (H1)      -2308.613   -2308.613
  Scaling correction factor                                  1.283
      for the MLR correction                                      
                                                                  
  Akaike (AIC)                                4719.149    4719.149
  Bayesian (BIC)                              4760.634    4760.634
  Sample-size adjusted Bayesian (SABIC)       4728.896    4728.896

Root Mean Square Error of Approximation:

  RMSEA                                          0.181       0.204
  90 Percent confidence interval - lower         0.148       0.167
  90 Percent confidence interval - upper         0.217       0.243
  P-value H_0: RMSEA <= 0.050                    0.000       0.000
  P-value H_0: RMSEA >= 0.080                    1.000       1.000
                                                                  
  Robust RMSEA                                               0.182
  90 Percent confidence interval - lower                     0.153
  90 Percent confidence interval - upper                     0.214
  P-value H_0: Robust RMSEA <= 0.050                         0.000
  P-value H_0: Robust RMSEA >= 0.080                         1.000

Standardized Root Mean Square Residual:

  SRMR                                           0.072       0.072

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Resilience =~                                                         
    SemanticsTotal    1.000                               0.556    0.555
    QFSSSTotal        0.777    0.154    5.039    0.000    0.432    0.513
    CERQTotal         0.898    0.175    5.142    0.000    0.499    0.697
    SSTEMTotal        0.474    0.046   10.284    0.000    0.263    0.564

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ACOPE ~                                                               
    Resilience        0.831    0.162    5.120    0.000    0.462    0.658

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .SemanticsTotal    0.695    0.089    7.855    0.000    0.695    0.692
   .QFSSSTotal        0.521    0.040   12.929    0.000    0.521    0.737
   .CERQTotal         0.264    0.038    7.043    0.000    0.264    0.515
   .SSTEMTotal        0.149    0.021    6.953    0.000    0.149    0.682
   .ACOPE             0.279    0.040    7.011    0.000    0.279    0.567
    Resilience        0.309    0.086    3.610    0.000    1.000    1.000

R-Square:
                   Estimate
    SemanticsTotal    0.308
    QFSSSTotal        0.263
    CERQTotal         0.485
    SSTEMTotal        0.318
    ACOPE             0.433

Model 3 Visualization

Latent variable academic resilience is impacted by four indicators tested (P < .05). Regression of resilience predicting coping (.66)

Code
semPlot::semPaths(fit3, whatLabels = "standardized")

SEM Mediation Model QFSSS

A mediation model was created to test whether social support impacts coping after mediation by cognitive emotion regulation.

In the model created, the paths are defined as follows: the indirect effect of social support on coping is the product of the a-path and the b-path (a*b), while the direct effect of social support on coping is the c’-path, and the c-path represents the total effect of social support on coping.

An initial examination to test for mediation was conducted using the Baron-Kenny test of joint significance. However, it is important to note that the Baron-Kenny test of joint significance only asseses a- and b- paths separately, and does not assess the significance of the product of the a- and b-paths (indirect effect). The indirect effect must be significant inorder to infer that mediation has occured.

Following the Baron-Kenny test of joint significance, both the a-path (b = .33, p < .001) and the b-path (b = .43, p < .001) appear to be statistically significant, indicating mediation has occurred. The direct path between social support and coping also appears to be significant (c= -.08, p = .17). These results suggest that social support is positively associated with cognitive emotion regulation, which is in turn positively associated with coping.

The Sobel test was used to evaluate whether mediation has occured. In this case, the total effect of social support on coping was found to be statistically significant (c = .31, SE = .04, p < .001)

Code
model4 <- ' # direct effect
             ACOPE ~ c * QFSSSTotal
           # mediator
             CERQTotal ~ a * QFSSSTotal
             ACOPE ~ b * CERQTotal
           # indirect effect (a*b)
             ab := a * b
           # total effect
             total := c + (a*b)
         '
fit4 <- sem(model4, data = fifedata.clean, estimator = "MLR", missing = "ML", fixed.x = FALSE)

summary(fit4, standardized=TRUE, fit.measures = TRUE)
lavaan 0.6.17 ended normally after 2 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         9

  Number of observations                           468
  Number of missing patterns                         1

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                 0.000       0.000
  Degrees of freedom                                 0           0

Model Test Baseline Model:

  Test statistic                               243.927     161.387
  Degrees of freedom                                 3           3
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.511

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    1.000       1.000
  Tucker-Lewis Index (TLI)                       1.000       1.000
                                                                  
  Robust Comparative Fit Index (CFI)                         1.000
  Robust Tucker-Lewis Index (TLI)                            1.000

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1466.918   -1466.918
  Loglikelihood unrestricted model (H1)      -1466.918   -1466.918
                                                                  
  Akaike (AIC)                                2951.835    2951.835
  Bayesian (BIC)                              2989.171    2989.171
  Sample-size adjusted Bayesian (SABIC)       2960.607    2960.607

Root Mean Square Error of Approximation:

  RMSEA                                          0.000          NA
  90 Percent confidence interval - lower         0.000          NA
  90 Percent confidence interval - upper         0.000          NA
  P-value H_0: RMSEA <= 0.050                       NA          NA
  P-value H_0: RMSEA >= 0.080                       NA          NA
                                                                  
  Robust RMSEA                                               0.000
  90 Percent confidence interval - lower                     0.000
  90 Percent confidence interval - upper                     0.000
  P-value H_0: Robust RMSEA <= 0.050                            NA
  P-value H_0: Robust RMSEA >= 0.080                            NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000       0.000

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ACOPE ~                                                               
    QFSSSTotal (c)    0.170    0.037    4.644    0.000    0.170    0.204
  CERQTotal ~                                                           
    QFSSSTotal (a)    0.333    0.041    8.026    0.000    0.333    0.390
  ACOPE ~                                                               
    CERQTotal  (b)    0.425    0.045    9.457    0.000    0.425    0.434

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .ACOPE             1.199    0.163    7.339    0.000    1.199    1.709
   .CERQTotal         1.868    0.134   13.968    0.000    1.868    2.608
    QFSSSTotal        3.216    0.039   82.740    0.000    3.216    3.825

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .ACOPE             0.345    0.034   10.078    0.000    0.345    0.701
   .CERQTotal         0.435    0.031   13.942    0.000    0.435    0.848
    QFSSSTotal        0.707    0.043   16.557    0.000    0.707    1.000

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab                0.141    0.024    5.844    0.000    0.141    0.170
    total             0.312    0.043    7.260    0.000    0.312    0.373
Code
lavInspect(fit4, "r2")
    ACOPE CERQTotal 
    0.299     0.152 

Bootstrap model

To confirm results from the Sobel test, a bootstrap mediation test was conducted. Unlike the Sobel Test, which assumes a normal distribution of indirect effects, the bootstrap mediation test uses resampling to generate a distribution of possible indirect effects based on the observed sample values. This test does not require the strict assumptions of normality that the Sobel Test requires, and can be seen as more rigorous evidence of mediation.

The indirect effect of social support on coping through cognitive emotion regulation continues to be positive and significant, (ab= .14, 95% CI [.11, .25]).

The total effect of social support on coping continues to be positive and significant (c= .31, 95% CI [.27, .41]).

Code
library(lavaan)
fit4 <- sem(model4, data = fifedata.clean, estimator = "ML", se = "bootstrap", bootstrap = 10)
summary(fit4, standardized=TRUE, ci = .95)
lavaan 0.6.17 ended normally after 1 iteration

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         5

  Number of observations                           468

Model Test User Model:
                                                      
  Test statistic                                 0.000
  Degrees of freedom                                 0

Parameter Estimates:

  Standard errors                            Bootstrap
  Number of requested bootstrap draws               10
  Number of successful bootstrap draws              10

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
  ACOPE ~                                                               
    QFSSSTotal (c)    0.170    0.045    3.750    0.000    0.104    0.254
  CERQTotal ~                                                           
    QFSSSTotal (a)    0.333    0.045    7.364    0.000    0.286    0.432
  ACOPE ~                                                               
    CERQTotal  (b)    0.425    0.047    9.042    0.000    0.344    0.515
   Std.lv  Std.all
                  
    0.170    0.204
                  
    0.333    0.390
                  
    0.425    0.434

Variances:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
   .ACOPE             0.345    0.038    8.986    0.000    0.263    0.391
   .CERQTotal         0.435    0.031   14.107    0.000    0.366    0.474
   Std.lv  Std.all
    0.345    0.701
    0.435    0.848

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
    ab                0.141    0.029    4.948    0.000    0.109    0.217
    total             0.312    0.058    5.337    0.000    0.240    0.402
   Std.lv  Std.all
    0.141    0.170
    0.312    0.373
Code
lavInspect(fit4, "r2")
    ACOPE CERQTotal 
    0.299     0.152 

Visualize Bootstrap model 4

Code
semPlot::semPaths(fit4, whatLabels = "standardized", rotation = 1)