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: 34
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): ETH_22_TEXT, BORN_1, AHELP dbl (28): ...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 × 34
## ...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
## # ℹ 24 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 <dbl>, SSOSH <dbl>, MHSAS <dbl>, PR_PF <dbl>, PR_A <dbl>, PR_D <dbl>,
## # PR_SR <dbl>, PR_PI <dbl>, PR_INT <dbl>, ANG <dbl>, CSA <dbl>, IEQ <dbl>,
## # SLESQ <dbl>, OD <dbl>, PCL5 <dbl>, ESC <dbl>
#check Structure code
#str(AAFD)
library(lavaan)
library(semPlot)
library(tidyverse)
library(psych)
library(jtools)
library(interactions)
library(ggplot2)
library(tidySEM)
library(dplyr)
library(readr)
AsianData2 <- read_csv("AsianData2Final.csv")
## New names:
## Rows: 160 Columns: 158
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): AHELP, ETH_22_TEXT, BORN_1 dbl (152): ...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 1.2 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 1.2 0.39
## SLESQ_2 159 0.54 0.54 0.48 0.39 1.3 0.44
## SLESQ_3 159 0.43 0.49 0.43 0.32 1.1 0.28
## SLESQ_4 160 0.52 0.52 0.46 0.39 1.2 0.42
## SLESQ_5 159 0.39 0.38 0.31 0.27 1.1 0.33
## SLESQ_6 160 0.48 0.43 0.35 0.31 1.3 0.47
## SLESQ_7 160 0.56 0.51 0.45 0.40 1.4 0.49
## SLESQ_8 159 0.58 0.58 0.55 0.46 1.2 0.39
## SLESQ_9 160 0.54 0.48 0.41 0.36 1.6 0.50
## SLESQ_10 159 0.47 0.55 0.51 0.40 1.1 0.24
## SLESQ_11 159 0.51 0.55 0.51 0.40 1.1 0.33
## SLESQ_12 160 0.27 0.34 0.25 0.18 1.1 0.24
## SLESQ_13 160 0.56 0.53 0.48 0.42 1.2 0.41
##
## Non missing response frequency for each item
## 1 2 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: 34
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (3): ETH_22_TEXT, BORN_1, AHELP dbl (28): ...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 × 34
## ...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
## # ℹ 24 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 <dbl>, SSOSH <dbl>, MHSAS <dbl>, PR_PF <dbl>, PR_A <dbl>, PR_D <dbl>,
## # PR_SR <dbl>, PR_PI <dbl>, PR_INT <dbl>, ANG <dbl>, CSA <dbl>, IEQ <dbl>,
## # SLESQ <dbl>, OD <dbl>, PCL5 <dbl>, ESC <dbl>
str(AAFD)
## spc_tbl_ [160 × 34] (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 : num [1:160] 2.8 2.2 3.2 2.8 2.4 3 1.4 1.6 2.6 2 ...
## $ SSOSH : num [1:160] 3.1 2.8 3.6 2 1.4 3.4 1.5 1.3 2 3.1 ...
## $ MHSAS : num [1:160] 4.33 5.33 1.33 5.22 5.67 4 6.44 7 5.33 6.11 ...
## $ PR_PF : num [1:160] 5 5 4.5 5 5 5 5 5 5 4.75 ...
## $ PR_A : num [1:160] 2.5 2 4 1.25 1.25 1.75 2.25 2 2 2.75 ...
## $ PR_D : num [1:160] 3.5 2 4 1 1.25 1 2.25 2 2 3 ...
## $ PR_SR : num [1:160] 3.75 4 2.5 5 5 5 5 4 4 4.25 ...
## $ PR_PI : num [1:160] 1 2 2 1.25 1.5 1 1 2 1.5 1.75 ...
## $ PR_INT : num [1:160] 1 2 3 2 3 1 2 3 3 3 ...
## $ ANG : num [1:160] 2.6 3 4 1.2 1 1.2 2.8 1.6 1 1.8 ...
## $ CSA : num [1:160] 1.68 1.52 2.48 0.08 0.32 0.64 1.25 0.76 0.16 1.24 ...
## $ IEQ : num [1:160] 1.4 1 1.8 1 0.2 0 1.6 0.8 1 0.4 ...
## $ SLESQ : num [1:160] 1.31 1 1.08 1 1.08 1.15 1.15 1.08 1.08 1.15 ...
## $ OD : num [1:160] 2 2 1 1.33 2 1 2.33 2 1.33 1.67 ...
## $ PCL5 : num [1:160] 2 2 2 0.5 0 0.25 1.25 0.25 0.5 1 ...
## $ ESC : num [1:160] 4.12 4.12 4.5 4.88 2.38 5.88 2.25 2.75 3.62 3.75 ...
## - 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 = col_double(),
## .. SSOSH = col_double(),
## .. MHSAS = col_double(),
## .. PR_PF = col_double(),
## .. PR_A = col_double(),
## .. PR_D = col_double(),
## .. PR_SR = col_double(),
## .. PR_PI = col_double(),
## .. PR_INT = col_double(),
## .. ANG = col_double(),
## .. CSA = col_double(),
## .. IEQ = col_double(),
## .. SLESQ = col_double(),
## .. OD = col_double(),
## .. PCL5 = col_double(),
## .. ESC = 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 19 160 2.22 0.59 2.20 2.21 0.59 1.00 4.00
## SSOSH 20 160 2.32 0.80 2.20 2.28 0.89 1.00 5.00
## MHSAS 21 159 5.59 1.20 5.89 5.73 1.16 1.00 7.00
## PR_PF 22 160 4.50 0.68 5.00 4.62 0.00 2.75 5.00
## PR_A 23 160 2.56 0.94 2.50 2.52 0.74 1.00 5.00
## PR_D 24 160 2.63 1.11 2.50 2.58 1.11 1.00 5.00
## PR_SR 25 160 3.58 1.05 3.62 3.65 0.93 1.00 5.00
## PR_PI 26 160 2.01 0.98 1.75 1.89 1.11 1.00 5.00
## PR_INT 27 160 3.56 2.00 3.00 3.46 1.48 0.00 9.00
## ANG 28 160 2.67 0.99 2.60 2.63 1.19 1.00 5.00
## CSA 29 160 1.56 0.72 1.54 1.55 0.74 0.04 3.44
## IEQ 30 160 0.90 0.61 1.00 0.88 0.89 0.00 2.00
## SLESQ 31 160 1.22 0.19 1.15 1.19 0.12 1.00 1.85
## OD 32 160 2.03 0.68 2.00 1.97 0.49 1.00 5.00
## PCL5 33 160 1.50 1.07 1.50 1.44 1.11 0.00 4.00
## ESC 34 160 3.52 1.08 3.50 3.49 1.11 1.12 7.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 3.00 0.24 0.27 0.05
## SSOSH 4.00 0.56 -0.05 0.06
## MHSAS 6.00 -1.05 1.15 0.10
## PR_PF 2.25 -1.10 -0.17 0.05
## PR_A 4.00 0.25 -0.60 0.07
## PR_D 4.00 0.30 -0.71 0.09
## PR_SR 4.00 -0.44 -0.48 0.08
## PR_PI 4.00 0.84 -0.02 0.08
## PR_INT 9.00 0.40 -0.70 0.16
## ANG 4.00 0.30 -0.47 0.08
## CSA 3.40 0.07 -0.53 0.06
## IEQ 2.00 0.09 -1.12 0.05
## SLESQ 0.85 0.97 0.47 0.01
## OD 4.00 1.20 2.99 0.05
## PCL5 4.00 0.39 -0.80 0.08
## ESC 5.88 0.25 -0.05 0.09
#Just age, gender, ethinicity - Last Data frame
describe(AAFD[,c("AGE", "GEN", "ETH")])
## 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
#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
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
#data set with only variables of interest
d <- data.frame(AAFD$SLESQ, AAFD$CSA, AAFD$ESC, AAFD$PCL5)
d <- rename(d, stressful_life_events = AAFD.SLESQ, central_sensitization = AAFD.CSA, emotional_self_control = AAFD.ESC, trauma_symptoms = AAFD.PCL5)
d <- na.omit(d)
psych::describe(d)
## vars n mean sd median trimmed mad min max range
## stressful_life_events 1 160 1.22 0.19 1.15 1.19 0.12 1.00 1.85 0.85
## central_sensitization 2 160 1.56 0.72 1.54 1.55 0.74 0.04 3.44 3.40
## emotional_self_control 3 160 3.52 1.08 3.50 3.49 1.11 1.12 7.00 5.88
## trauma_symptoms 4 160 1.50 1.07 1.50 1.44 1.11 0.00 4.00 4.00
## skew kurtosis se
## stressful_life_events 0.97 0.47 0.01
## central_sensitization 0.07 -0.53 0.06
## emotional_self_control 0.25 -0.05 0.09
## trauma_symptoms 0.39 -0.80 0.08
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. stressful_life_events 1.22 0.19
##
## 2. central_sensitization 1.56 0.72 .39**
## [.25, .52]
##
## 3. emotional_self_control 3.52 1.08 -.05 -.02
## [-.20, .11] [-.18, .13]
##
## 4. trauma_symptoms 1.50 1.07 .35** .65** .10
## [.20, .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 = stressful_life_events, y = trauma_symptoms)
report(results.r)
## Effect sizes were labelled following Funder's (2019) recommendations.
##
## The Pearson's product-moment correlation between stressful_life_events and
## trauma_symptoms is positive, statistically significant, and large (r = 0.35,
## 95% CI [0.20, 0.48], t(158) = 4.65, p < .001)
#Pairs Panels
psych::pairs.panels(d)
model1 <- lm(stressful_life_events ~ central_sensitization * emotional_self_control, d)
summary(model1)
##
## Call:
## lm(formula = stressful_life_events ~ central_sensitization *
## emotional_self_control, data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.29732 -0.12314 -0.04028 0.10320 0.57090
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.118128 0.113215 9.876
## central_sensitization 0.079054 0.065780 1.202
## emotional_self_control -0.016786 0.030535 -0.550
## central_sensitization:emotional_self_control 0.006377 0.017821 0.358
## Pr(>|t|)
## (Intercept) <2e-16 ***
## central_sensitization 0.231
## emotional_self_control 0.583
## central_sensitization:emotional_self_control 0.721
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1738 on 156 degrees of freedom
## Multiple R-squared: 0.1566, Adjusted R-squared: 0.1404
## F-statistic: 9.655 on 3 and 156 DF, p-value: 6.966e-06
#graph interaction
interactions::interact_plot(model1, pred = central_sensitization, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
>> This is the same moderation as above but switched so that graph
has stressful_life_events as x axis
model1a <- lm(stressful_life_events ~ central_sensitization * emotional_self_control, d)
summary(model1a)
##
## Call:
## lm(formula = stressful_life_events ~ central_sensitization *
## emotional_self_control, data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.29732 -0.12314 -0.04028 0.10320 0.57090
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.118128 0.113215 9.876
## central_sensitization 0.079054 0.065780 1.202
## emotional_self_control -0.016786 0.030535 -0.550
## central_sensitization:emotional_self_control 0.006377 0.017821 0.358
## Pr(>|t|)
## (Intercept) <2e-16 ***
## central_sensitization 0.231
## emotional_self_control 0.583
## central_sensitization:emotional_self_control 0.721
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1738 on 156 degrees of freedom
## Multiple R-squared: 0.1566, Adjusted R-squared: 0.1404
## F-statistic: 9.655 on 3 and 156 DF, p-value: 6.966e-06
interactions::interact_plot(model1a, pred = stressful_life_events, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
## Warning: stressful_life_events 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(stressful_life_events ~ trauma_symptoms * emotional_self_control, d)
summary(model2)
##
## Call:
## lm(formula = stressful_life_events ~ trauma_symptoms * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.35589 -0.12119 -0.04134 0.09645 0.61521
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.226630 0.082650 14.841 <2e-16
## trauma_symptoms 0.027079 0.046323 0.585 0.560
## emotional_self_control -0.029332 0.022817 -1.286 0.201
## trauma_symptoms:emotional_self_control 0.009863 0.012395 0.796 0.427
##
## (Intercept) ***
## trauma_symptoms
## emotional_self_control
## trauma_symptoms:emotional_self_control
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1764 on 156 degrees of freedom
## Multiple R-squared: 0.1309, Adjusted R-squared: 0.1142
## F-statistic: 7.832 on 3 and 156 DF, p-value: 6.667e-05
interactions::interact_plot(model2, pred = trauma_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 stressful_life_events as x axis
model2a <- lm(stressful_life_events ~ trauma_symptoms * emotional_self_control, d)
summary(model2a)
##
## Call:
## lm(formula = stressful_life_events ~ trauma_symptoms * emotional_self_control,
## data = d)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.35589 -0.12119 -0.04134 0.09645 0.61521
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.226630 0.082650 14.841 <2e-16
## trauma_symptoms 0.027079 0.046323 0.585 0.560
## emotional_self_control -0.029332 0.022817 -1.286 0.201
## trauma_symptoms:emotional_self_control 0.009863 0.012395 0.796 0.427
##
## (Intercept) ***
## trauma_symptoms
## emotional_self_control
## trauma_symptoms:emotional_self_control
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1764 on 156 degrees of freedom
## Multiple R-squared: 0.1309, Adjusted R-squared: 0.1142
## F-statistic: 7.832 on 3 and 156 DF, p-value: 6.667e-05
interactions::interact_plot(model2a, pred = stressful_life_events, modx = emotional_self_control, main.title = "Figure 2") +
ylim(1, 10)
## Warning: stressful_life_events 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 = stressful_life_events; M = trauma_symptoms
LMedModel <- "
central_sensitization ~ b*trauma_symptoms + c_p*stressful_life_events
trauma_symptoms ~a*stressful_life_events
#intercepts
stressful_life_events ~ stressful_life_events.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 9 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 ~
## trm_symp (b) 0.395 0.049 8.040 0.000 0.302 0.493
## strssf__ (c_p) 0.736 0.242 3.038 0.002 0.266 1.220
## trauma_symptoms ~
## strssf__ (a) 1.976 0.408 4.848 0.000 1.183 2.781
## Std.lv Std.all
##
## 0.395 0.582
## 0.736 0.191
##
## 1.976 0.347
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## strss__ (s__.) 1.217 0.015 82.286 0.000 1.189 1.246
## .cntrl_s (cn_.) 0.072 0.271 0.265 0.791 -0.467 0.600
## .trm_sym -0.903 0.499 -1.809 0.070 -1.830 0.096
## Std.lv Std.all
## 1.217 6.515
## 0.072 0.100
## -0.903 -0.849
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .centrl_snstztn 0.285 0.029 9.701 0.000 0.221 0.336
## .trauma_symptms 0.995 0.101 9.809 0.000 0.792 1.187
## strssfl_lf_vnt 0.035 0.004 8.165 0.000 0.027 0.043
## Std.lv Std.all
## 0.285 0.548
## 0.995 0.879
## 0.035 1.000
##
## R-Square:
## Estimate
## centrl_snstztn 0.452
## trauma_symptms 0.121
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## indirect 0.780 0.207 3.776 0.000 0.433 1.241
## direct 0.736 0.242 3.036 0.002 0.266 1.220
## total_c 1.516 0.249 6.079 0.000 1.046 2.041
## Std.lv Std.all
## 0.780 0.202
## 0.736 0.191
## 1.516 0.393
Mel’s variables: (public stigma =IV, self stigma = Mediator, help-seeking attitudes = DV, familism = Moderator)
Combined <- '
#equations
trauma_symptoms ~ a1*stressful_life_events + a2*emotional_self_control + a3*stressful_life_events:emotional_self_control
central_sensitization ~ c_p1*stressful_life_events + c_p2*emotional_self_control + c_p3*stressful_life_events:emotional_self_control + b*trauma_symptoms
#intercepts
trauma_symptoms ~ trauma_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 21 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 596.947
## 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
## trauma_symptoms ~
## strss__ (a1) 1.183 1.398 0.846 0.398 -2.237 3.423
## emtnl__ (a2) -0.170 0.471 -0.362 0.718 -1.321 0.580
## st__:__ (a3) 0.230 0.376 0.611 0.541 -0.358 1.162
## central_sensitization ~
## strss__ (c_p1) 0.946 0.739 1.280 0.200 -0.373 2.523
## emtnl__ (c_p2) 0.034 0.241 0.139 0.889 -0.399 0.548
## st__:__ (c_p3) -0.066 0.192 -0.343 0.731 -0.515 0.268
## trm_sym (b) 0.402 0.051 7.945 0.000 0.305 0.503
## Std.lv Std.all
##
## 1.183 0.199
## -0.170 -0.165
## 0.230 0.305
##
## 0.946 0.245
## 0.034 0.050
## -0.066 -0.135
## 0.402 0.619
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower
## stressful_life_events ~~
## strssfl_lf_:__ 0.113 0.030 3.758 0.000 0.060
## ci.upper Std.lv Std.all
##
## 0.181 0.113 0.411
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .trm_sym (tr_.) -0.320 1.740 -0.184 0.854 -3.190 3.866
## .cntrl_s (cn_.) -0.030 0.930 -0.032 0.974 -1.959 1.702
## emtnl__ (e__.) 3.520 0.087 40.458 0.000 3.348 3.691
## strss__ 1.217 0.015 82.286 0.000 1.189 1.246
## st__:__ 4.275 0.117 36.636 0.000 4.052 4.510
## Std.lv Std.all
## -0.320 -0.288
## -0.030 -0.042
## 3.520 3.269
## 1.217 6.515
## 4.275 2.899
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## emtnl__ (e__.) 1.159 0.128 9.029 0.000 0.924 1.417
## .trm_sym 0.978 0.099 9.885 0.000 0.773 1.153
## .cntrl_s 0.282 0.030 9.551 0.000 0.216 0.332
## strss__ 0.035 0.004 8.165 0.000 0.027 0.043
## st__:__ 2.175 0.397 5.472 0.000 1.552 3.085
## Std.lv Std.all
## 1.159 1.000
## 0.978 0.791
## 0.282 0.541
## 0.035 1.000
## 2.175 1.000
##
## R-Square:
## Estimate
## trauma_symptms 0.209
## centrl_snstztn 0.459
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## imm 0.092 0.154 0.598 0.550 -0.141 0.499
## indirect.SDblw 0.701 0.264 2.654 0.008 0.201 1.228
## indirect.mean 0.800 0.213 3.762 0.000 0.447 1.279
## indirect.SDabv 0.899 0.270 3.329 0.001 0.487 1.531
## direct.SDbelow 0.785 0.336 2.338 0.019 0.160 1.469
## direct.Smean 0.713 0.252 2.833 0.005 0.215 1.212
## direct.SDabove 0.642 0.311 2.069 0.039 -0.068 1.196
## Std.lv Std.all
## 0.092 0.189
## 0.701 0.551
## 0.800 0.739
## 0.899 0.928
## 0.785 -0.061
## 0.713 -0.196
## 0.642 -0.331