#Packages
library(lavaan)
## This is lavaan 0.6-16
## lavaan is FREE software! Please report any bugs.
library(semPlot)
## Warning: package 'semPlot' was built under R version 4.3.2
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(psych)
##
## Attaching package: 'psych'
##
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
##
## The following object is masked from 'package:lavaan':
##
## cor2cov
library(jtools)
## Warning: package 'jtools' was built under R version 4.3.2
library(interactions)
## Warning: package 'interactions' was built under R version 4.3.2
library(ggplot2)
library(tidySEM)
## Warning: package 'tidySEM' was built under R version 4.3.2
## Loading required package: OpenMx
##
## Attaching package: 'OpenMx'
##
## The following object is masked from 'package:psych':
##
## tr
##
## Registered S3 method overwritten by 'tidySEM':
## method from
## predict.MxModel OpenMx
##
## Attaching package: 'tidySEM'
##
## The following object is masked from 'package:jtools':
##
## get_data
library(dplyr)
library(report)
## Warning: package 'report' was built under R version 4.3.2
##
## Attaching package: 'report'
##
## The following object is masked from 'package:tidySEM':
##
## report
library(magrittr)
##
## Attaching package: 'magrittr'
##
## The following object is masked from 'package:purrr':
##
## set_names
##
## The following object is masked from 'package:tidyr':
##
## extract
library(readr)
AAFD <- read_csv("AsianData_FINAL_Dataset.csv")
## New names:
## Rows: 160 Columns: 49
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): ETH_22_TEXT, BORN_1, AHELP dbl (43): ...1, AGE, GEN, EDU, EMP, INS_1,
## INS_2, ETH, INC, BORN, BORN_2, PR... lgl (3): GEN_8_TEXT, EDU_11_TEXT,
## ETH_26_TEXT
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
head(AAFD)
## # A tibble: 6 × 49
## ...1 AGE GEN GEN_8_TEXT EDU EDU_11_TEXT EMP INS_1 INS_2 ETH
## <dbl> <dbl> <dbl> <lgl> <dbl> <lgl> <dbl> <dbl> <dbl> <dbl>
## 1 1 39 2 NA 5 NA 1 1 1 3
## 2 2 30 2 NA 6 NA 1 1 1 7
## 3 3 37 2 NA 4 NA 2 1 3 16
## 4 4 34 2 NA 6 NA 1 1 1 NA
## 5 5 28 2 NA 5 NA 2 1 3 1
## 6 6 64 2 NA 3 NA 1 1 1 2
## # ℹ 39 more variables: ETH_22_TEXT <chr>, ETH_26_TEXT <lgl>, INC <dbl>,
## # BORN <dbl>, BORN_1 <chr>, BORN_2 <dbl>, AHELP <chr>, PRE_HELP <dbl>,
## # SSRPH_AVG <dbl>, SSOSH_AVG <dbl>, MHSAS_AVG <dbl>, PR_PF_AVG <dbl>,
## # PR_A_AVG <dbl>, PR_D_AVG <dbl>, PR_SR_AVG <dbl>, PR_PI_AVG <dbl>,
## # ANG_AVG <dbl>, CSA_AVG <dbl>, IEQ_AVG <dbl>, SLESQ_AVG <dbl>, OD_AVG <dbl>,
## # PCL5_AVG <dbl>, ESC_AVG <dbl>, SSRPH_total <dbl>, SSOSH_total <dbl>,
## # MHSAS_total <dbl>, PR_PF_total <dbl>, PR_A_total <dbl>, PR_D_total <dbl>, …
#check Structure code
#str(AAFD)
library(readr)
AsianData2 <- read_csv("AsianData2Final.csv")
## New names:
## Rows: 160 Columns: 173
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): AHELP, ETH_22_TEXT, BORN_1 dbl (167): ...1, Progress,
## Duration..in.seconds., Consent, SSRPH_1, SSRPH_2,... lgl (3): GEN_8_TEXT,
## EDU_11_TEXT, ETH_26_TEXT
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
#stressful life events
psych::alpha(AsianData2[c('SLESQ_1','SLESQ_2','SLESQ_3','SLESQ_4','SLESQ_5','SLESQ_6','SLESQ_7','SLESQ_8','SLESQ_9', 'SLESQ_10','SLESQ_11','SLESQ_12','SLESQ_13')])
##
## Reliability analysis
## Call: psych::alpha(x = AsianData2[c("SLESQ_1", "SLESQ_2", "SLESQ_3",
## "SLESQ_4", "SLESQ_5", "SLESQ_6", "SLESQ_7", "SLESQ_8", "SLESQ_9",
## "SLESQ_10", "SLESQ_11", "SLESQ_12", "SLESQ_13")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.72 0.73 0.76 0.17 2.7 0.032 0.22 0.19 0.17
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.66 0.72 0.78
## Duhachek 0.66 0.72 0.78
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## SLESQ_1 0.72 0.72 0.75 0.18 2.6 0.032 0.013 0.18
## SLESQ_2 0.70 0.70 0.74 0.17 2.4 0.034 0.014 0.15
## SLESQ_3 0.71 0.71 0.74 0.17 2.5 0.033 0.013 0.18
## SLESQ_4 0.70 0.71 0.74 0.17 2.4 0.034 0.014 0.16
## SLESQ_5 0.72 0.73 0.75 0.18 2.7 0.033 0.011 0.18
## SLESQ_6 0.71 0.72 0.75 0.18 2.6 0.033 0.013 0.19
## SLESQ_7 0.70 0.71 0.74 0.17 2.4 0.035 0.013 0.17
## SLESQ_8 0.69 0.70 0.72 0.16 2.3 0.035 0.012 0.15
## SLESQ_9 0.71 0.71 0.74 0.17 2.5 0.034 0.013 0.18
## SLESQ_10 0.71 0.70 0.73 0.17 2.4 0.034 0.011 0.17
## SLESQ_11 0.70 0.70 0.73 0.17 2.4 0.034 0.013 0.17
## SLESQ_12 0.72 0.73 0.75 0.19 2.7 0.032 0.011 0.20
## SLESQ_13 0.70 0.71 0.73 0.17 2.4 0.035 0.013 0.15
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## SLESQ_1 159 0.39 0.40 0.31 0.24 0.189 0.39
## SLESQ_2 159 0.54 0.54 0.48 0.39 0.258 0.44
## SLESQ_3 159 0.43 0.49 0.43 0.32 0.088 0.28
## SLESQ_4 160 0.52 0.52 0.46 0.39 0.225 0.42
## SLESQ_5 159 0.39 0.38 0.31 0.27 0.126 0.33
## SLESQ_6 160 0.48 0.43 0.35 0.31 0.338 0.47
## SLESQ_7 160 0.56 0.51 0.45 0.40 0.394 0.49
## SLESQ_8 159 0.58 0.58 0.55 0.46 0.182 0.39
## SLESQ_9 160 0.54 0.48 0.41 0.36 0.556 0.50
## SLESQ_10 159 0.47 0.55 0.51 0.40 0.063 0.24
## SLESQ_11 159 0.51 0.55 0.51 0.40 0.126 0.33
## SLESQ_12 160 0.27 0.34 0.25 0.18 0.062 0.24
## SLESQ_13 160 0.56 0.53 0.48 0.42 0.219 0.41
##
## Non missing response frequency for each item
## 0 1 miss
## SLESQ_1 0.81 0.19 0.01
## SLESQ_2 0.74 0.26 0.01
## SLESQ_3 0.91 0.09 0.01
## SLESQ_4 0.78 0.22 0.00
## SLESQ_5 0.87 0.13 0.01
## SLESQ_6 0.66 0.34 0.00
## SLESQ_7 0.61 0.39 0.00
## SLESQ_8 0.82 0.18 0.01
## SLESQ_9 0.44 0.56 0.00
## SLESQ_10 0.94 0.06 0.01
## SLESQ_11 0.87 0.13 0.01
## SLESQ_12 0.94 0.06 0.00
## SLESQ_13 0.78 0.22 0.00
#trauma symptoms
psych::alpha(AsianData2[c('PCL5_1','PCL5_2','PCL5_3','PCL5_4')])
##
## Reliability analysis
## Call: psych::alpha(x = AsianData2[c("PCL5_1", "PCL5_2", "PCL5_3", "PCL5_4")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.86 0.86 0.84 0.61 6.4 0.018 1.5 1.1 0.59
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.82 0.86 0.89
## Duhachek 0.83 0.86 0.90
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## PCL5_1 0.79 0.79 0.72 0.55 3.7 0.029 0.0043 0.53
## PCL5_2 0.81 0.81 0.76 0.59 4.3 0.026 0.0116 0.56
## PCL5_3 0.83 0.83 0.78 0.61 4.8 0.024 0.0149 0.56
## PCL5_4 0.87 0.87 0.83 0.70 6.9 0.018 0.0041 0.71
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## PCL5_1 160 0.89 0.90 0.87 0.81 1.3 1.2
## PCL5_2 160 0.87 0.86 0.81 0.75 1.7 1.3
## PCL5_3 160 0.85 0.84 0.77 0.71 1.8 1.3
## PCL5_4 160 0.77 0.77 0.63 0.59 1.3 1.2
##
## Non missing response frequency for each item
## 0 1 2 3 4 miss
## PCL5_1 0.31 0.27 0.24 0.14 0.04 0
## PCL5_2 0.25 0.24 0.22 0.17 0.11 0
## PCL5_3 0.22 0.25 0.21 0.19 0.12 0
## PCL5_4 0.35 0.30 0.14 0.15 0.06 0
#central sensitization
psych::alpha(AsianData2[c('CSA_1','CSA_2','CSA_3','CSA_4','CSA_5','CSA_6','CSA_7','CSA_8','CSA_9','CSA_10','CSA_11','CSA_12','CSA_13','CSA_14','CSA_15','CSA_16','CSA_17','CSA_18','CSA_19','CSA_20','CSA_21','CSA_22','CSA_23','CSA_24','CSA_25')])
##
## Reliability analysis
## Call: psych::alpha(x = AsianData2[c("CSA_1", "CSA_2", "CSA_3", "CSA_4",
## "CSA_5", "CSA_6", "CSA_7", "CSA_8", "CSA_9", "CSA_10", "CSA_11",
## "CSA_12", "CSA_13", "CSA_14", "CSA_15", "CSA_16", "CSA_17",
## "CSA_18", "CSA_19", "CSA_20", "CSA_21", "CSA_22", "CSA_23",
## "CSA_24", "CSA_25")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.94 0.94 0.95 0.38 15 0.0069 1.6 0.72 0.39
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.92 0.94 0.95
## Duhachek 0.92 0.94 0.95
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## CSA_1 0.94 0.94 0.95 0.38 15 0.0071 0.0096 0.39
## CSA_2 0.94 0.94 0.95 0.38 14 0.0073 0.0103 0.38
## CSA_3 0.94 0.94 0.95 0.37 14 0.0073 0.0109 0.38
## CSA_4 0.94 0.94 0.95 0.38 15 0.0072 0.0108 0.39
## CSA_5 0.94 0.94 0.95 0.38 15 0.0071 0.0109 0.39
## CSA_6 0.94 0.94 0.95 0.38 15 0.0071 0.0108 0.39
## CSA_7 0.94 0.94 0.95 0.38 15 0.0072 0.0111 0.39
## CSA_8 0.93 0.93 0.95 0.37 14 0.0073 0.0100 0.38
## CSA_9 0.94 0.94 0.95 0.38 14 0.0072 0.0108 0.38
## CSA_10 0.94 0.94 0.95 0.38 15 0.0072 0.0111 0.38
## CSA_11 0.94 0.94 0.95 0.39 15 0.0070 0.0087 0.39
## CSA_12 0.94 0.94 0.95 0.38 15 0.0072 0.0102 0.38
## CSA_13 0.94 0.94 0.95 0.37 14 0.0073 0.0104 0.38
## CSA_14 0.94 0.94 0.95 0.38 15 0.0072 0.0109 0.39
## CSA_15 0.94 0.94 0.95 0.38 14 0.0073 0.0105 0.38
## CSA_16 0.93 0.93 0.95 0.37 14 0.0074 0.0102 0.38
## CSA_17 0.93 0.93 0.95 0.37 14 0.0074 0.0096 0.38
## CSA_18 0.94 0.94 0.95 0.38 14 0.0073 0.0103 0.38
## CSA_19 0.94 0.94 0.95 0.38 15 0.0071 0.0106 0.39
## CSA_20 0.94 0.94 0.95 0.38 15 0.0072 0.0110 0.38
## CSA_21 0.94 0.94 0.95 0.39 15 0.0070 0.0102 0.39
## CSA_22 0.94 0.94 0.95 0.38 15 0.0072 0.0111 0.39
## CSA_23 0.94 0.94 0.95 0.38 14 0.0072 0.0109 0.38
## CSA_24 0.94 0.94 0.95 0.38 15 0.0072 0.0110 0.39
## CSA_25 0.94 0.94 0.95 0.38 15 0.0070 0.0105 0.39
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## CSA_1 160 0.55 0.54 0.52 0.51 2.29 1.06
## CSA_2 160 0.68 0.68 0.67 0.65 2.20 1.05
## CSA_3 160 0.69 0.69 0.68 0.65 1.42 1.19
## CSA_4 160 0.65 0.64 0.63 0.60 1.59 1.30
## CSA_5 160 0.58 0.58 0.56 0.54 1.40 1.20
## CSA_6 160 0.59 0.60 0.58 0.56 0.74 0.89
## CSA_7 160 0.63 0.63 0.60 0.59 1.15 1.21
## CSA_8 159 0.71 0.70 0.70 0.67 1.96 1.18
## CSA_9 160 0.68 0.68 0.67 0.64 1.38 1.15
## CSA_10 159 0.66 0.66 0.64 0.61 1.60 1.04
## CSA_11 160 0.41 0.43 0.40 0.37 0.53 0.79
## CSA_12 159 0.65 0.64 0.62 0.60 2.13 1.29
## CSA_13 160 0.69 0.69 0.69 0.66 1.91 1.14
## CSA_14 159 0.63 0.62 0.60 0.58 1.77 1.29
## CSA_15 160 0.69 0.68 0.67 0.65 2.26 1.22
## CSA_16 160 0.74 0.74 0.74 0.71 1.96 1.15
## CSA_17 158 0.76 0.75 0.75 0.72 2.23 1.12
## CSA_18 159 0.69 0.69 0.68 0.65 1.99 1.26
## CSA_19 160 0.60 0.61 0.59 0.56 0.93 1.09
## CSA_20 160 0.66 0.66 0.65 0.62 1.27 1.16
## CSA_21 159 0.48 0.49 0.46 0.43 1.29 1.09
## CSA_22 159 0.62 0.63 0.61 0.58 1.24 1.13
## CSA_23 159 0.67 0.68 0.67 0.64 1.64 1.03
## CSA_24 160 0.63 0.63 0.61 0.59 1.49 1.30
## CSA_25 160 0.53 0.55 0.53 0.49 0.65 0.90
##
## Non missing response frequency for each item
## 0 1 2 3 4 miss
## CSA_1 0.04 0.21 0.31 0.31 0.13 0.00
## CSA_2 0.06 0.18 0.39 0.26 0.12 0.00
## CSA_3 0.28 0.28 0.26 0.12 0.06 0.00
## CSA_4 0.26 0.24 0.23 0.17 0.09 0.00
## CSA_5 0.28 0.29 0.22 0.14 0.06 0.00
## CSA_6 0.52 0.26 0.18 0.04 0.00 0.00
## CSA_7 0.40 0.26 0.18 0.10 0.06 0.00
## CSA_8 0.12 0.25 0.28 0.25 0.10 0.01
## CSA_9 0.26 0.32 0.25 0.11 0.06 0.00
## CSA_10 0.16 0.30 0.33 0.18 0.03 0.01
## CSA_11 0.63 0.23 0.11 0.03 0.00 0.00
## CSA_12 0.13 0.20 0.25 0.25 0.18 0.01
## CSA_13 0.14 0.21 0.35 0.22 0.08 0.00
## CSA_14 0.20 0.24 0.28 0.14 0.13 0.01
## CSA_15 0.11 0.15 0.29 0.29 0.17 0.00
## CSA_16 0.11 0.25 0.32 0.21 0.11 0.00
## CSA_17 0.06 0.20 0.32 0.27 0.15 0.01
## CSA_18 0.15 0.18 0.36 0.14 0.16 0.01
## CSA_19 0.47 0.26 0.17 0.07 0.03 0.00
## CSA_20 0.34 0.24 0.26 0.12 0.04 0.00
## CSA_21 0.30 0.27 0.28 0.13 0.02 0.01
## CSA_22 0.35 0.24 0.27 0.12 0.03 0.01
## CSA_23 0.14 0.31 0.35 0.16 0.04 0.01
## CSA_24 0.31 0.19 0.29 0.11 0.10 0.00
## CSA_25 0.59 0.22 0.16 0.03 0.01 0.00
#emotional self control
psych::alpha(AsianData2[c('ESC_1r', 'ESC_2r','ESC_3r','ESC_4','ESC_5','ESC_6','ESC_7','ESC_8')])
##
## Reliability analysis
## Call: psych::alpha(x = AsianData2[c("ESC_1r", "ESC_2r", "ESC_3r", "ESC_4",
## "ESC_5", "ESC_6", "ESC_7", "ESC_8")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.86 0.87 0.88 0.45 6.5 0.016 3.5 1.1 0.45
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.83 0.86 0.89
## Duhachek 0.83 0.86 0.90
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## ESC_1r 0.84 0.84 0.85 0.44 5.4 0.019 0.013 0.45
## ESC_2r 0.85 0.85 0.85 0.44 5.5 0.019 0.011 0.45
## ESC_3r 0.84 0.84 0.85 0.43 5.4 0.019 0.013 0.45
## ESC_4 0.84 0.85 0.86 0.44 5.5 0.019 0.023 0.41
## ESC_5 0.86 0.86 0.87 0.47 6.3 0.017 0.019 0.49
## ESC_6 0.84 0.84 0.86 0.44 5.4 0.020 0.022 0.41
## ESC_7 0.85 0.86 0.87 0.46 6.0 0.018 0.022 0.47
## ESC_8 0.86 0.86 0.87 0.47 6.2 0.017 0.019 0.49
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## ESC_1r 160 0.75 0.77 0.75 0.66 3.0 1.5
## ESC_2r 160 0.73 0.75 0.74 0.65 2.8 1.2
## ESC_3r 160 0.75 0.77 0.76 0.67 2.7 1.4
## ESC_4 160 0.77 0.76 0.71 0.67 3.4 1.7
## ESC_5 160 0.64 0.63 0.55 0.52 4.7 1.5
## ESC_6 160 0.77 0.77 0.72 0.68 3.3 1.5
## ESC_7 160 0.69 0.68 0.61 0.57 3.7 1.6
## ESC_8 160 0.65 0.64 0.56 0.52 4.6 1.5
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## ESC_1r 0.17 0.26 0.28 0.12 0.12 0.04 0.01 0
## ESC_2r 0.15 0.28 0.30 0.18 0.06 0.02 0.01 0
## ESC_3r 0.22 0.26 0.24 0.17 0.08 0.03 0.01 0
## ESC_4 0.12 0.28 0.17 0.12 0.17 0.09 0.05 0
## ESC_5 0.02 0.09 0.11 0.17 0.32 0.21 0.09 0
## ESC_6 0.11 0.22 0.26 0.16 0.16 0.05 0.03 0
## ESC_7 0.10 0.18 0.19 0.22 0.16 0.11 0.04 0
## ESC_8 0.03 0.06 0.17 0.21 0.21 0.20 0.12 0
AAFD <- read_csv("AsianData_FINAL_Dataset.csv")
## New names:
## Rows: 160 Columns: 49
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): ETH_22_TEXT, BORN_1, AHELP dbl (43): ...1, AGE, GEN, EDU, EMP, INS_1,
## INS_2, ETH, INC, BORN, BORN_2, PR... lgl (3): GEN_8_TEXT, EDU_11_TEXT,
## ETH_26_TEXT
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
head(AAFD)
## # A tibble: 6 × 49
## ...1 AGE GEN GEN_8_TEXT EDU EDU_11_TEXT EMP INS_1 INS_2 ETH
## <dbl> <dbl> <dbl> <lgl> <dbl> <lgl> <dbl> <dbl> <dbl> <dbl>
## 1 1 39 2 NA 5 NA 1 1 1 3
## 2 2 30 2 NA 6 NA 1 1 1 7
## 3 3 37 2 NA 4 NA 2 1 3 16
## 4 4 34 2 NA 6 NA 1 1 1 NA
## 5 5 28 2 NA 5 NA 2 1 3 1
## 6 6 64 2 NA 3 NA 1 1 1 2
## # ℹ 39 more variables: ETH_22_TEXT <chr>, ETH_26_TEXT <lgl>, INC <dbl>,
## # BORN <dbl>, BORN_1 <chr>, BORN_2 <dbl>, AHELP <chr>, PRE_HELP <dbl>,
## # SSRPH_AVG <dbl>, SSOSH_AVG <dbl>, MHSAS_AVG <dbl>, PR_PF_AVG <dbl>,
## # PR_A_AVG <dbl>, PR_D_AVG <dbl>, PR_SR_AVG <dbl>, PR_PI_AVG <dbl>,
## # ANG_AVG <dbl>, CSA_AVG <dbl>, IEQ_AVG <dbl>, SLESQ_AVG <dbl>, OD_AVG <dbl>,
## # PCL5_AVG <dbl>, ESC_AVG <dbl>, SSRPH_total <dbl>, SSOSH_total <dbl>,
## # MHSAS_total <dbl>, PR_PF_total <dbl>, PR_A_total <dbl>, PR_D_total <dbl>, …
str(AAFD)
## spc_tbl_ [160 × 49] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
## $ ...1 : num [1:160] 1 2 3 4 5 6 7 8 9 10 ...
## $ AGE : num [1:160] 39 30 37 34 28 64 35 40 28 28 ...
## $ GEN : num [1:160] 2 2 2 2 2 2 2 2 1 2 ...
## $ GEN_8_TEXT : logi [1:160] NA NA NA NA NA NA ...
## $ EDU : num [1:160] 5 6 4 6 5 3 6 7 7 6 ...
## $ EDU_11_TEXT: logi [1:160] NA NA NA NA NA NA ...
## $ EMP : num [1:160] 1 1 2 1 2 1 1 1 1 4 ...
## $ INS_1 : num [1:160] 1 1 1 1 1 1 1 1 1 1 ...
## $ INS_2 : num [1:160] 1 1 3 1 3 1 1 1 1 3 ...
## $ ETH : num [1:160] 3 7 16 NA 1 2 1 16 1 6 ...
## $ ETH_22_TEXT: chr [1:160] NA NA NA NA ...
## $ ETH_26_TEXT: logi [1:160] NA NA NA NA NA NA ...
## $ INC : num [1:160] 9 9 5 8 3 6 7 9 8 1 ...
## $ BORN : num [1:160] 1 2 2 1 1 1 2 2 1 1 ...
## $ BORN_1 : chr [1:160] NA "Philippines" "India" NA ...
## $ BORN_2 : num [1:160] NA 1999 1993 NA NA ...
## $ AHELP : chr [1:160] "Housemates" "My girlfriend" "A missionary." "I have talked to a phone psychologist from my work" ...
## $ PRE_HELP : num [1:160] 1 2 1 1 2 2 1 1 2 2 ...
## $ SSRPH_AVG : num [1:160] 2.8 2.2 3.2 2.8 2.4 3 1.4 1.6 2.6 2 ...
## $ SSOSH_AVG : num [1:160] 3.1 2.8 3.6 2 1.4 3.4 1.5 1.3 2 3.1 ...
## $ MHSAS_AVG : num [1:160] 4.33 5.33 1.33 5.22 5.67 4 6.44 7 5.33 6.11 ...
## $ PR_PF_AVG : num [1:160] 5 5 4.5 5 5 5 5 5 5 4.75 ...
## $ PR_A_AVG : num [1:160] 2.5 2 4 1.25 1.25 1.75 2.25 2 2 2.75 ...
## $ PR_D_AVG : num [1:160] 3.5 2 4 1 1.25 1 2.25 2 2 3 ...
## $ PR_SR_AVG : num [1:160] 3.75 4 2.5 5 5 5 5 4 4 4.25 ...
## $ PR_PI_AVG : num [1:160] 1 2 2 1.25 1.5 1 1 2 1.5 1.75 ...
## $ ANG_AVG : num [1:160] 2.6 3 4 1.2 1 1.2 2.8 1.6 1 1.8 ...
## $ CSA_AVG : num [1:160] 1.68 1.52 2.48 0.08 0.32 0.64 1.25 0.76 0.16 1.24 ...
## $ IEQ_AVG : num [1:160] 1.4 1 1.8 1 0.2 0 1.6 0.8 1 0.4 ...
## $ SLESQ_AVG : num [1:160] 0.31 0 0.08 0 0.08 0.15 0.15 0.08 0.08 0.15 ...
## $ OD_AVG : num [1:160] 2 2 1 1.33 2 1 2.33 2 1.33 1.67 ...
## $ PCL5_AVG : num [1:160] 2 2 2 0.5 0 0.25 1.25 0.25 0.5 1 ...
## $ ESC_AVG : num [1:160] 4.12 4.12 4.5 4.88 2.38 5.88 2.25 2.75 3.62 3.75 ...
## $ SSRPH_total: num [1:160] 14 11 16 14 12 15 7 8 13 10 ...
## $ SSOSH_total: num [1:160] 31 28 36 20 14 34 15 13 20 31 ...
## $ MHSAS_total: num [1:160] 39 48 12 47 51 36 58 63 48 55 ...
## $ PR_PF_total: num [1:160] 20 20 18 20 20 20 20 20 20 19 ...
## $ PR_A_total : num [1:160] 10 8 16 5 5 7 9 8 8 11 ...
## $ PR_D_total : num [1:160] 14 8 16 4 5 4 9 6 8 12 ...
## $ PR_SR_total: num [1:160] 15 16 10 20 20 20 20 16 16 17 ...
## $ PR_PI_total: num [1:160] 4 8 8 5 6 4 4 8 6 7 ...
## $ PR_INT : num [1:160] 1 2 3 2 3 1 2 3 3 3 ...
## $ ANG_total : num [1:160] 13 15 20 6 5 6 14 8 5 9 ...
## $ CSA_total : num [1:160] 42 38 62 2 8 16 30 19 4 31 ...
## $ IEQ_total : num [1:160] 7 5 9 5 1 0 8 4 5 2 ...
## $ SLESQ_total: num [1:160] 4 0 1 0 1 2 2 1 1 2 ...
## $ OD_total : num [1:160] 6 6 3 4 6 3 7 6 4 5 ...
## $ PCL5_total : num [1:160] 8 8 8 2 0 1 5 1 2 4 ...
## $ ESC_total : num [1:160] 33 33 36 39 19 47 18 22 29 30 ...
## - attr(*, "spec")=
## .. cols(
## .. ...1 = col_double(),
## .. AGE = col_double(),
## .. GEN = col_double(),
## .. GEN_8_TEXT = col_logical(),
## .. EDU = col_double(),
## .. EDU_11_TEXT = col_logical(),
## .. EMP = col_double(),
## .. INS_1 = col_double(),
## .. INS_2 = col_double(),
## .. ETH = col_double(),
## .. ETH_22_TEXT = col_character(),
## .. ETH_26_TEXT = col_logical(),
## .. INC = col_double(),
## .. BORN = col_double(),
## .. BORN_1 = col_character(),
## .. BORN_2 = col_double(),
## .. AHELP = col_character(),
## .. PRE_HELP = col_double(),
## .. SSRPH_AVG = col_double(),
## .. SSOSH_AVG = col_double(),
## .. MHSAS_AVG = col_double(),
## .. PR_PF_AVG = col_double(),
## .. PR_A_AVG = col_double(),
## .. PR_D_AVG = col_double(),
## .. PR_SR_AVG = col_double(),
## .. PR_PI_AVG = col_double(),
## .. ANG_AVG = col_double(),
## .. CSA_AVG = col_double(),
## .. IEQ_AVG = col_double(),
## .. SLESQ_AVG = col_double(),
## .. OD_AVG = col_double(),
## .. PCL5_AVG = col_double(),
## .. ESC_AVG = col_double(),
## .. SSRPH_total = col_double(),
## .. SSOSH_total = col_double(),
## .. MHSAS_total = col_double(),
## .. PR_PF_total = col_double(),
## .. PR_A_total = col_double(),
## .. PR_D_total = col_double(),
## .. PR_SR_total = col_double(),
## .. PR_PI_total = col_double(),
## .. PR_INT = col_double(),
## .. ANG_total = col_double(),
## .. CSA_total = col_double(),
## .. IEQ_total = col_double(),
## .. SLESQ_total = col_double(),
## .. OD_total = col_double(),
## .. PCL5_total = col_double(),
## .. ESC_total = col_double()
## .. )
## - attr(*, "problems")=<externalptr>
#total - Second data frame
psych::describe(AAFD)
## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning -Inf
## vars n mean sd median trimmed mad min max
## ...1 1 160 80.94 46.76 80.50 80.93 60.05 1.00 161.00
## AGE 2 159 32.27 10.03 30.00 31.05 8.90 18.00 64.00
## GEN 3 160 1.73 1.06 2.00 1.52 1.48 1.00 7.00
## GEN_8_TEXT 4 0 NaN NA NA NaN NA Inf -Inf
## EDU 5 160 5.66 1.43 6.00 5.72 0.74 2.00 10.00
## EDU_11_TEXT 6 0 NaN NA NA NaN NA Inf -Inf
## EMP 7 160 1.68 0.92 1.00 1.54 0.00 1.00 4.00
## INS_1 8 160 1.07 0.26 1.00 1.00 0.00 1.00 2.00
## INS_2 9 148 1.50 0.91 1.00 1.32 0.00 1.00 4.00
## ETH 10 142 7.09 5.62 7.00 6.60 5.93 1.00 22.00
## ETH_22_TEXT* 11 1 1.00 NA 1.00 1.00 0.00 1.00 1.00
## ETH_26_TEXT 12 0 NaN NA NA NaN NA Inf -Inf
## INC 13 160 5.82 2.66 6.00 6.00 2.97 1.00 9.00
## BORN 14 160 1.28 0.45 1.00 1.23 0.00 1.00 2.00
## BORN_1* 15 45 10.00 5.23 10.00 10.00 5.93 1.00 19.00
## BORN_2 16 45 1909.27 411.11 1999.00 1996.70 11.86 25.00 2014.00
## AHELP* 17 160 56.76 28.72 67.50 58.18 29.65 1.00 99.00
## PRE_HELP 18 159 1.36 0.48 1.00 1.33 0.00 1.00 2.00
## SSRPH_AVG 19 160 2.22 0.59 2.20 2.21 0.59 1.00 4.00
## SSOSH_AVG 20 160 2.32 0.80 2.20 2.28 0.89 1.00 5.00
## MHSAS_AVG 21 159 5.59 1.20 5.89 5.73 1.16 1.00 7.00
## PR_PF_AVG 22 160 4.50 0.68 5.00 4.62 0.00 2.75 5.00
## PR_A_AVG 23 160 2.56 0.94 2.50 2.52 0.74 1.00 5.00
## PR_D_AVG 24 160 2.63 1.11 2.50 2.58 1.11 1.00 5.00
## PR_SR_AVG 25 160 3.58 1.05 3.62 3.65 0.93 1.00 5.00
## PR_PI_AVG 26 160 2.01 0.98 1.75 1.89 1.11 1.00 5.00
## ANG_AVG 27 160 2.67 0.99 2.60 2.63 1.19 1.00 5.00
## CSA_AVG 28 160 1.56 0.72 1.54 1.55 0.74 0.04 3.44
## IEQ_AVG 29 160 0.90 0.61 1.00 0.88 0.89 0.00 2.00
## SLESQ_AVG 30 160 0.22 0.19 0.15 0.19 0.12 0.00 0.85
## OD_AVG 31 160 2.03 0.68 2.00 1.97 0.49 1.00 5.00
## PCL5_AVG 32 160 1.50 1.07 1.50 1.44 1.11 0.00 4.00
## ESC_AVG 33 160 3.52 1.08 3.50 3.49 1.11 1.12 7.00
## SSRPH_total 34 160 11.06 3.00 11.00 11.04 2.97 5.00 20.00
## SSOSH_total 35 160 23.19 7.96 22.00 22.74 8.90 10.00 50.00
## MHSAS_total 36 160 50.03 11.30 53.00 51.42 10.38 7.00 63.00
## PR_PF_total 37 160 17.94 2.74 20.00 18.40 0.00 11.00 20.00
## PR_A_total 38 160 10.19 3.72 10.00 10.08 2.97 4.00 20.00
## PR_D_total 39 160 10.49 4.47 10.00 10.27 4.45 4.00 20.00
## PR_SR_total 40 160 14.31 4.20 14.50 14.59 3.71 4.00 20.00
## PR_PI_total 41 160 8.02 3.87 7.00 7.55 4.45 4.00 20.00
## PR_INT 42 160 3.56 2.00 3.00 3.46 1.48 0.00 9.00
## ANG_total 43 160 13.35 4.93 13.00 13.17 5.93 5.00 25.00
## CSA_total 44 160 38.91 17.96 38.50 38.78 18.53 1.00 86.00
## IEQ_total 45 160 4.47 3.05 5.00 4.40 4.45 0.00 10.00
## SLESQ_total 46 160 2.82 2.43 2.00 2.52 1.48 0.00 11.00
## OD_total 47 160 6.08 2.05 6.00 5.90 1.48 3.00 15.00
## PCL5_total 48 160 6.01 4.27 6.00 5.74 4.45 0.00 16.00
## ESC_total 49 160 28.16 8.64 28.00 27.95 8.90 9.00 56.00
## range skew kurtosis se
## ...1 160.00 0.00 -1.23 3.70
## AGE 46.00 1.09 0.69 0.80
## GEN 6.00 2.65 8.57 0.08
## GEN_8_TEXT -Inf NA NA NA
## EDU 8.00 -0.38 0.97 0.11
## EDU_11_TEXT -Inf NA NA NA
## EMP 3.00 1.02 -0.28 0.07
## INS_1 1.00 3.20 8.27 0.02
## INS_2 3.00 1.52 0.86 0.07
## ETH 21.00 0.69 -0.72 0.47
## ETH_22_TEXT* 0.00 NA NA NA
## ETH_26_TEXT -Inf NA NA NA
## INC 8.00 -0.24 -1.17 0.21
## BORN 1.00 0.96 -1.08 0.04
## BORN_1* 18.00 0.04 -1.28 0.78
## BORN_2 1989.00 -4.27 16.62 61.28
## AHELP* 98.00 -0.46 -1.17 2.27
## PRE_HELP 1.00 0.56 -1.70 0.04
## SSRPH_AVG 3.00 0.24 0.27 0.05
## SSOSH_AVG 4.00 0.56 -0.05 0.06
## MHSAS_AVG 6.00 -1.05 1.15 0.10
## PR_PF_AVG 2.25 -1.10 -0.17 0.05
## PR_A_AVG 4.00 0.25 -0.60 0.07
## PR_D_AVG 4.00 0.30 -0.71 0.09
## PR_SR_AVG 4.00 -0.44 -0.48 0.08
## PR_PI_AVG 4.00 0.84 -0.02 0.08
## ANG_AVG 4.00 0.30 -0.47 0.08
## CSA_AVG 3.40 0.07 -0.53 0.06
## IEQ_AVG 2.00 0.09 -1.12 0.05
## SLESQ_AVG 0.85 0.97 0.47 0.01
## OD_AVG 4.00 1.20 2.99 0.05
## PCL5_AVG 4.00 0.39 -0.80 0.08
## ESC_AVG 5.88 0.25 -0.05 0.09
## SSRPH_total 15.00 0.20 0.26 0.24
## SSOSH_total 40.00 0.57 0.00 0.63
## MHSAS_total 56.00 -1.20 1.70 0.89
## PR_PF_total 9.00 -1.04 -0.30 0.22
## PR_A_total 16.00 0.24 -0.58 0.29
## PR_D_total 16.00 0.31 -0.71 0.35
## PR_SR_total 16.00 -0.44 -0.48 0.33
## PR_PI_total 16.00 0.82 -0.03 0.31
## PR_INT 9.00 0.40 -0.70 0.16
## ANG_total 20.00 0.30 -0.47 0.39
## CSA_total 85.00 0.05 -0.59 1.42
## IEQ_total 10.00 0.09 -1.12 0.24
## SLESQ_total 11.00 0.97 0.47 0.19
## OD_total 12.00 1.20 2.99 0.16
## PCL5_total 16.00 0.39 -0.80 0.34
## ESC_total 47.00 0.25 -0.05 0.68
#Just age, gender, ethinicity - Last Data frame
describe(AAFD[,c("AGE", "GEN", "ETH", "BORN")])
## vars n mean sd median trimmed mad min max range skew kurtosis se
## AGE 1 159 32.27 10.03 30 31.05 8.90 18 64 46 1.09 0.69 0.80
## GEN 2 160 1.73 1.06 2 1.52 1.48 1 7 6 2.65 8.57 0.08
## ETH 3 142 7.09 5.62 7 6.60 5.93 1 22 21 0.69 -0.72 0.47
## BORN 4 160 1.28 0.45 1 1.23 0.00 1 2 1 0.96 -1.08 0.04
#percentages - Percentages rounded (no decimal points) - Shown in R console/First Data frame
round(prop.table(table(AAFD$GEN))*100, 0)
##
## 1 2 3 4 5 7
## 48 45 1 1 4 1
round(prop.table(table(AAFD$ETH))*100, 0)
##
## 1 2 3 6 7 8 9 10 11 15 16 17 18 22
## 21 6 14 1 18 14 1 1 1 1 14 4 2 1
DataAge <- table(AAFD$AGE)
print(DataAge)
##
## 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 44
## 3 2 2 5 8 10 6 10 6 9 6 10 9 2 10 6 4 6 4 4 3 6 3 2 1 1
## 47 48 49 50 51 53 54 55 57 58 59 64
## 3 1 2 2 3 3 1 1 1 1 1 2
DataBorn <- table(AAFD$BORN)
print(DataBorn)
##
## 1 2
## 115 45
DataGender <- table(AAFD$GEN)
print(DataGender)
##
## 1 2 3 4 5 7
## 77 72 1 2 6 2
DataGenTEXT <- table(AAFD$GEN_8_TEXT)
print(DataGenTEXT)
## < table of extent 0 >
DataEthnicity <- table(AAFD$ETH)
print(DataEthnicity)
##
## 1 2 3 6 7 8 9 10 11 15 16 17 18 22
## 30 9 20 2 26 20 2 2 1 1 20 5 3 1
DataEthTEXT <- table(AAFD$ETH_22_TEXT)
print(DataEthTEXT)
##
## Pakistan
## 1
DataEthTEXT <- table(AAFD$ETH_26_TEXT)
print(DataEthTEXT)
## < table of extent 0 >
DataINC <- table(AAFD$INC)
print(DataINC)
##
## 1 2 3 4 5 6 7 8 9
## 13 8 13 19 22 20 8 12 45
DataEDU <- table(AAFD$EDU)
print(DataEDU)
##
## 2 3 4 5 6 7 9 10
## 7 2 29 9 80 27 5 1
DataEthnicity <- table(AAFD$BORN)
print(DataEthnicity)
##
## 1 2
## 115 45
DataEmploy <- table(AAFD$EMP)
print(DataEmploy)
##
## 1 2 3 4
## 95 29 29 7
DataInsure1 <- table(AAFD$INS_1)
print(DataInsure1)
##
## 1 2
## 148 12
DataInsure2 <- table(AAFD$INS_2)
print(DataInsure2)
##
## 1 2 3 4
## 109 11 21 7
DataCBorn <- table(AAFD$BORN_1)
print(DataCBorn)
##
## bangladesh Bangladesh bd China France Hong Kong
## 2 1 1 5 1 3
## India Japan korea Korea Liberia pakistan
## 6 2 1 2 1 1
## Philippines S. Korea south korea South Korea Thailand Viet nam
## 7 1 1 5 2 1
## Vietnam
## 2
DataImm <- table(AAFD$BORN_2)
print(DataImm)
##
## 25 1969 1972 1974 1979 1980 1984 1988 1990 1991 1992 1993 1994 1996 1998 1999
## 2 1 1 1 1 1 1 3 2 2 2 1 1 1 1 4
## 2000 2001 2003 2004 2005 2006 2007 2009 2011 2012 2014
## 4 2 1 1 2 1 1 1 5 1 1
DataPreHelp <- table(AAFD$PRE_HELP)
print(DataPreHelp)
##
## 1 2
## 101 58
#Data sets with only variables of interest
#Totals of Stressful life events & Central sensitization, Averages of Emotional self control and Trauma Symptoms
d <- data.frame(AAFD$SLESQ_total, AAFD$CSA_total, AAFD$ESC_total, AAFD$PCL5_total)
d <- rename(d, trauma_exposure = AAFD.SLESQ_total, central_sensitization = AAFD.CSA_total, emotional_self_control = AAFD.ESC_total, PTSD_symptoms = AAFD.PCL5_total)
d <- na.omit(d)
psych::describe(d)
## vars n mean sd median trimmed mad min max range
## trauma_exposure 1 160 2.82 2.43 2.0 2.52 1.48 0 11 11
## central_sensitization 2 160 38.91 17.96 38.5 38.78 18.53 1 86 85
## emotional_self_control 3 160 28.16 8.64 28.0 27.95 8.90 9 56 47
## PTSD_symptoms 4 160 6.01 4.27 6.0 5.74 4.45 0 16 16
## skew kurtosis se
## trauma_exposure 0.97 0.47 0.19
## central_sensitization 0.05 -0.59 1.42
## emotional_self_control 0.25 -0.05 0.68
## PTSD_symptoms 0.39 -0.80 0.34
apaTables::apa.cor.table(d)
## Registered S3 methods overwritten by 'broom':
## method from
## tidy.glht jtools
## tidy.summary.glht jtools
##
##
## Means, standard deviations, and correlations with confidence intervals
##
##
## Variable M SD 1 2 3
## 1. trauma_exposure 2.82 2.43
##
## 2. central_sensitization 38.91 17.96 .39**
## [.25, .52]
##
## 3. emotional_self_control 28.16 8.64 -.05 -.02
## [-.20, .11] [-.18, .13]
##
## 4. PTSD_symptoms 6.01 4.27 .35** .65** .10
## [.21, .48] [.55, .73] [-.06, .25]
##
##
## Note. M and SD are used to represent mean and standard deviation, respectively.
## Values in square brackets indicate the 95% confidence interval.
## The confidence interval is a plausible range of population correlations
## that could have caused the sample correlation (Cumming, 2014).
## * indicates p < .05. ** indicates p < .01.
##
# Pearson's Correlation Coefficent:
results.r <- d %$%
cor.test(x = trauma_exposure, y = PTSD_symptoms)
report(results.r)
## Effect sizes were labelled following Funder's (2019) recommendations.
##
## The Pearson's product-moment correlation between trauma_exposure and
## PTSD_symptoms is positive, statistically significant, and large (r = 0.35, 95%
## CI [0.21, 0.48], t(158) = 4.70, p < .001)
##Pairs Panels
psych::pairs.panels(d)
model1 <- lm(trauma_exposure ~ central_sensitization * emotional_self_control, d)
summary(model1)
##
## Call:
## lm(formula = trauma_exposure ~ central_sensitization * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.8641 -1.6072 -0.5105 1.2785 7.3678
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.5328932 1.4703310 1.043
## central_sensitization 0.0415838 0.0342292 1.215
## emotional_self_control -0.0275044 0.0495192 -0.555
## central_sensitization:emotional_self_control 0.0004052 0.0011577 0.350
## Pr(>|t|)
## (Intercept) 0.299
## central_sensitization 0.226
## emotional_self_control 0.579
## central_sensitization:emotional_self_control 0.727
##
## Residual standard error: 2.257 on 156 degrees of freedom
## Multiple R-squared: 0.1565, Adjusted R-squared: 0.1402
## F-statistic: 9.645 on 3 and 156 DF, p-value: 7.053e-06
interactions::interact_plot(model1, pred = central_sensitization, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
## Warning: Removed 14 rows containing missing values (`geom_path()`).
>> This is the same moderation as above but switched so that graph
has trauma_exposure as x axis
model1a <- lm(trauma_exposure ~ central_sensitization * emotional_self_control, d)
summary(model1a)
##
## Call:
## lm(formula = trauma_exposure ~ central_sensitization * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.8641 -1.6072 -0.5105 1.2785 7.3678
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.5328932 1.4703310 1.043
## central_sensitization 0.0415838 0.0342292 1.215
## emotional_self_control -0.0275044 0.0495192 -0.555
## central_sensitization:emotional_self_control 0.0004052 0.0011577 0.350
## Pr(>|t|)
## (Intercept) 0.299
## central_sensitization 0.226
## emotional_self_control 0.579
## central_sensitization:emotional_self_control 0.727
##
## Residual standard error: 2.257 on 156 degrees of freedom
## Multiple R-squared: 0.1565, Adjusted R-squared: 0.1402
## F-statistic: 9.645 on 3 and 156 DF, p-value: 7.053e-06
interactions::interact_plot(model1a, pred = trauma_exposure, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
## Warning: trauma_exposure and emotional_self_control are not included in an
## interaction with one another in the model.
## `geom_path()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
model2 <- lm(trauma_exposure ~ PTSD_symptoms * emotional_self_control, d)
summary(model2)
##
## Call:
## lm(formula = trauma_exposure ~ PTSD_symptoms * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.6341 -1.5494 -0.4761 1.2399 7.9515
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.945139 1.072266 2.747 0.00673 **
## PTSD_symptoms 0.090438 0.150273 0.602 0.54816
## emotional_self_control -0.048229 0.037003 -1.303 0.19437
## PTSD_symptoms:emotional_self_control 0.003979 0.005027 0.792 0.42975
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.287 on 156 degrees of freedom
## Multiple R-squared: 0.1334, Adjusted R-squared: 0.1168
## F-statistic: 8.006 on 3 and 156 DF, p-value: 5.361e-05
interactions::interact_plot(model2, pred = PTSD_symptoms, modx = emotional_self_control, main.title = "Figure 3") +
ylim(1, 10)
>> This is the same moderation as above but switched so that graph
has trauma_exposure as x axis
model2a <- lm(trauma_exposure ~ PTSD_symptoms * emotional_self_control, d)
summary(model2a)
##
## Call:
## lm(formula = trauma_exposure ~ PTSD_symptoms * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.6341 -1.5494 -0.4761 1.2399 7.9515
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.945139 1.072266 2.747 0.00673 **
## PTSD_symptoms 0.090438 0.150273 0.602 0.54816
## emotional_self_control -0.048229 0.037003 -1.303 0.19437
## PTSD_symptoms:emotional_self_control 0.003979 0.005027 0.792 0.42975
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.287 on 156 degrees of freedom
## Multiple R-squared: 0.1334, Adjusted R-squared: 0.1168
## F-statistic: 8.006 on 3 and 156 DF, p-value: 5.361e-05
interactions::interact_plot(model2a, pred = trauma_exposure, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
## Warning: trauma_exposure and emotional_self_control are not included in an
## interaction with one another in the model.
## `geom_path()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
# Y = central_sensitization; X = trauma_exposure; M = PTSD_symptoms
LMedModel <- "
central_sensitization ~ b*PTSD_symptoms + c_p*trauma_exposure
PTSD_symptoms ~a*trauma_exposure
#intercepts
trauma_exposure ~ trauma_exposure.mean*1
central_sensitization ~ central_sensitization.mean*1
indirect := a*b
direct := c_p
total_c := c_p + (a*b)
"
set.seed(230925) #required for reproducible results because lavaan introduces randomness into the calculations
LMed_fit <- lavaan::sem(LMedModel, data = d, se = "bootstrap", missing = "fiml")
LMed_Sum <- lavaan::summary(LMed_fit, standardized = T, rsq = T, ci = TRUE)
LMed_ParEsts <- lavaan::parameterEstimates(LMed_fit, boot.ci.type = "bca.simple",
standardized = TRUE)
LMed_Sum
## lavaan 0.6.16 ended normally after 8 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 9
##
## Number of observations 160
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 0.000
## Degrees of freedom 0
##
## Parameter Estimates:
##
## Standard errors Bootstrap
## Number of requested bootstrap draws 1000
## Number of successful bootstrap draws 1000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## central_sensitization ~
## PTSD_sym (b) 2.445 0.305 8.027 0.000 1.857 3.059
## trm_xpsr (c_p) 1.396 0.467 2.991 0.003 0.467 2.332
## PTSD_symptoms ~
## trm_xpsr (a) 0.614 0.125 4.896 0.000 0.371 0.865
## Std.lv Std.all
##
## 2.445 0.581
## 1.396 0.189
##
## 0.614 0.350
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## trm_xps (tr_.) 2.819 0.192 14.686 0.000 2.456 3.194
## .cntrl_s (cn_.) 20.273 1.834 11.052 0.000 16.616 23.785
## .PTSD_sy 4.281 0.460 9.302 0.000 3.390 5.232
## Std.lv Std.all
## 2.819 1.162
## 20.273 1.132
## 4.281 1.006
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .centrl_snstztn 176.360 18.208 9.686 0.000 136.579 209.075
## .PTSD_symptoms 15.880 1.620 9.801 0.000 12.639 18.946
## trauma_exposur 5.886 0.720 8.176 0.000 4.575 7.346
## Std.lv Std.all
## 176.360 0.550
## 15.880 0.877
## 5.886 1.000
##
## R-Square:
## Estimate
## centrl_snstztn 0.450
## PTSD_symptoms 0.123
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## indirect 1.501 0.396 3.793 0.000 0.839 2.363
## direct 1.396 0.467 2.990 0.003 0.467 2.332
## total_c 2.897 0.474 6.116 0.000 1.999 3.884
## Std.lv Std.all
## 1.501 0.203
## 1.396 0.189
## 2.897 0.392
Mel’s variables: (public stigma =IV, self stigma = Mediator, help-seeking attitudes = DV, familism = Moderator)
Combined <- '
#equations
PTSD_symptoms ~ a1*trauma_exposure + a2*emotional_self_control + a3*trauma_exposure:emotional_self_control
central_sensitization ~ c_p1*trauma_exposure + c_p2*emotional_self_control + c_p3*trauma_exposure:emotional_self_control + b*PTSD_symptoms
#intercepts
PTSD_symptoms ~ PTSD_symptoms.mean*1
central_sensitization ~ central_sensitization.mean*1
#means, variances of W for simple slopes
emotional_self_control ~ emotional_self_control.mean*1
emotional_self_control ~~ emotional_self_control.var*emotional_self_control
#index of moderated mediation, there will be an a and b path in the product
#if the a and/or b path is moderated, select the label that represents the moderation
imm := a3*b
#Note that we first create the indirect product, then add to it the product of the imm and the W level
indirect.SDbelow := a1*b + imm*(emotional_self_control.mean - sqrt(emotional_self_control.var))
indirect.mean := a1*b + imm*(emotional_self_control.mean)
indirect.SDabove := a1*b + imm*(emotional_self_control.mean + sqrt(emotional_self_control.var))
#direct effect is also moderated so calculate with c_p1 + c_p3
direct.SDbelow := c_p1 + c_p3*(emotional_self_control.mean - sqrt(emotional_self_control.var))
direct.Smean := c_p1 + c_p3*(emotional_self_control.mean)
direct.SDabove := c_p1 + c_p3*(emotional_self_control.mean + sqrt(emotional_self_control.var))
'
set.seed(230925) #required for reproducible results because lavaan introduces randomness into the calculations
Combined_fit <- lavaan::sem(Combined, data = d, se = "bootstrap", missing = 'fiml', fixed.x = FALSE, bootstrap = 1000)
cFITsum <- lavaan::summary(Combined_fit, standardized = TRUE, rsq=T, ci=TRUE)
cParamEsts <- lavaan::parameterEstimates(Combined_fit, boot.ci.type = "bca.simple", standardized=TRUE)
cFITsum
## lavaan 0.6.16 ended normally after 25 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 18
##
## Number of observations 160
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 145.173
## Degrees of freedom 2
## P-value (Chi-square) 0.000
##
## Parameter Estimates:
##
## Standard errors Bootstrap
## Number of requested bootstrap draws 1000
## Number of successful bootstrap draws 1000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## PTSD_symptoms ~
## trm_xps (a1) 0.376 0.432 0.870 0.384 -0.677 1.073
## emtnl__ (a2) 0.031 0.058 0.533 0.594 -0.095 0.134
## trm_:__ (a3) 0.009 0.015 0.594 0.552 -0.014 0.045
## central_sensitization ~
## trm_xps (c_p1) 1.763 1.417 1.244 0.213 -0.763 4.805
## emtnl__ (c_p2) -0.104 0.189 -0.549 0.583 -0.490 0.284
## trm_:__ (c_p3) -0.015 0.046 -0.318 0.751 -0.122 0.066
## PTSD_sy (b) 2.488 0.314 7.935 0.000 1.883 3.114
## Std.lv Std.all
##
## 0.376 0.215
## 0.031 0.062
## 0.009 0.156
##
## 1.763 0.239
## -0.104 -0.050
## -0.015 -0.063
## 2.488 0.590
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## trauma_exposure ~~
## trm_xpsr:mtn__ 165.771 24.538 6.756 0.000 121.887 217.775
## Std.lv Std.all
##
## 165.771 0.895
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .PTSD_sy (PTSD) 3.408 1.680 2.029 0.042 0.356 7.107
## .cntrl_s (cn_.) 23.045 5.861 3.932 0.000 11.546 35.049
## emtnl__ (e__.) 28.163 0.696 40.475 0.000 26.788 29.531
## trm_xps 2.819 0.192 14.686 0.000 2.456 3.194
## trm_:__ 78.325 5.946 13.172 0.000 67.172 91.243
## Std.lv Std.all
## 3.408 0.803
## 23.045 1.287
## 28.163 3.271
## 2.819 1.162
## 78.325 1.026
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## emtnl__ (e__.) 74.124 8.206 9.033 0.000 59.063 90.582
## .PTSD_sy 15.602 1.580 9.874 0.000 12.339 18.420
## .cntrl_s 174.657 18.321 9.533 0.000 133.926 205.617
## trm_xps 5.886 0.720 8.176 0.000 4.575 7.346
## trm_:__ 5829.782 1265.143 4.608 0.000 3817.379 8845.415
## Std.lv Std.all
## 74.124 1.000
## 15.602 0.866
## 174.657 0.545
## 5.886 1.000
## 5829.782 1.000
##
## R-Square:
## Estimate
## PTSD_symptoms 0.134
## centrl_snstztn 0.455
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## imm 0.022 0.037 0.581 0.561 -0.034 0.119
## indirect.SDblw 1.356 0.503 2.694 0.007 0.406 2.366
## indirect.mean 1.542 0.408 3.779 0.000 0.862 2.459
## indirect.SDabv 1.727 0.522 3.312 0.001 0.931 2.993
## direct.SDbelow 1.477 0.644 2.294 0.022 0.282 2.762
## direct.Smean 1.350 0.485 2.786 0.005 0.386 2.302
## direct.SDabove 1.224 0.599 2.045 0.041 -0.126 2.305
## Std.lv Std.all
## 0.022 0.092
## 1.356 0.335
## 1.542 0.427
## 1.727 0.519
## 1.477 0.097
## 1.350 0.034
## 1.224 -0.028