data <- import("cham_attachment.sav")
finaldat <- na.omit(data)
finaldat$a22r <- 8-finaldat$a22
finaldat$pf7r <- 6-finaldat$pf7
finaldat$pf8r <- 6-finaldat$pf8
finaldat$pf9r <- 6-finaldat$pf9
finaldat$sds2r <- 5-finaldat$sds2
finaldat$sds5r <- 5-finaldat$sds5
finaldat$sds6r <- 5-finaldat$sds6
finaldat$sds11r <- 5-finaldat$sds11
finaldat$sds12r <- 5-finaldat$sds12
finaldat$sds14r <- 5-finaldat$sds14
finaldat$sds16r <- 5-finaldat$sds16
finaldat$sds17r <- 5-finaldat$sds17
finaldat$sds18r <- 5-finaldat$sds18
finaldat$sds20r <- 5-finaldat$sds20
aa_avg <- c("a2", "a4", "a6", "a8", "a10", "a12", "a14", "a16", "a18", "a20", "a22r", "a24", "a26", "a28", "a30", "a32", "a34", "a36")
rc_avg <- c("pf7r","pf8r","pf9r")
dep_avg <- c("sds1", "sds2r", "sds3", "sds4", "sds5r", "sds6r", "sds7", "sds8", "sds9", "sds10", "sds11r", "sds12r", "sds13", "sds14r", "sds15", "sds16r", "sds17r", "sds18r", "sds19", "sds20r")
finaldat <- finaldat %>% dplyr::mutate(attachmentanxiety = rowMeans(finaldat[ ,aa_avg], na.rm=TRUE))
finaldat <- finaldat %>% dplyr::mutate(reactive = rowMeans(finaldat[ ,rc_avg], na.rm=TRUE))
finaldat <- finaldat %>% dplyr::mutate(depression = rowMeans(finaldat[ ,dep_avg], na.rm=TRUE))
source("process.R")
##
## ********************* PROCESS for R Version 4.3.1 *********************
##
## Written by Andrew F. Hayes, Ph.D. www.afhayes.com
## Documentation available in Hayes (2022). www.guilford.com/p/hayes3
##
## ***********************************************************************
##
## PROCESS is now ready for use.
## Copyright 2020-2023 by Andrew F. Hayes ALL RIGHTS RESERVED
## Workshop schedule at http://haskayne.ucalgary.ca/CCRAM
##
mediation <- process(data = finaldat, y = "attachmentanxiety", x = "depression" , m = "reactive",
model = 4, effsize = 1, total = 1, stand = 1,
boot = 2000, modelbt = 1, seed = 32861 )
##
## ********************* PROCESS for R Version 4.3.1 *********************
##
## Written by Andrew F. Hayes, Ph.D. www.afhayes.com
## Documentation available in Hayes (2022). www.guilford.com/p/hayes3
##
## ***********************************************************************
##
## Model : 4
## Y : attachmentanxiety
## X : depression
## M : reactive
##
## Sample size: 185
##
## Custom seed: 32861
##
##
## ***********************************************************************
## Outcome Variable: reactive
##
## Model Summary:
## R R-sq MSE F df1 df2 p
## 0.3140 0.0986 0.7433 20.0146 1.0000 183.0000 0.0000
##
## Model:
## coeff se t p LLCI ULCI
## constant 4.4318 0.3069 14.4397 0.0000 3.8262 5.0373
## depression -0.7492 0.1675 -4.4738 0.0000 -1.0796 -0.4188
##
## Standardized coefficients:
## coeff
## depression -0.3140
##
## ***********************************************************************
## Outcome Variable: attachmentanxiety
##
## Model Summary:
## R R-sq MSE F df1 df2 p
## 0.3514 0.1235 0.6395 12.8230 2.0000 182.0000 0.0000
##
## Model:
## coeff se t p LLCI ULCI
## constant 3.0274 0.4164 7.2706 0.0000 2.2059 3.8490
## depression 0.6059 0.1636 3.7034 0.0003 0.2831 0.9287
## reactive -0.1451 0.0686 -2.1166 0.0357 -0.2804 -0.0098
##
## Standardized coefficients:
## coeff
## depression 0.2707
## reactive -0.1547
##
## ************************ TOTAL EFFECT MODEL ***************************
## Outcome Variable: attachmentanxiety
##
## Model Summary:
## R R-sq MSE F df1 df2 p
## 0.3193 0.1019 0.6516 20.7711 1.0000 183.0000 0.0000
##
## Model:
## coeff se t p LLCI ULCI
## constant 2.3843 0.2874 8.2966 0.0000 1.8173 2.9513
## depression 0.7146 0.1568 4.5575 0.0000 0.4053 1.0240
##
## Standardized coefficients:
## coeff
## depression 0.3193
##
## ***********************************************************************
## Bootstrapping progress:
##
|
| | 0%
|
| | 1%
|
|> | 1%
|
|> | 2%
|
|>> | 2%
|
|>> | 3%
|
|>> | 4%
|
|>>> | 4%
|
|>>> | 5%
|
|>>> | 6%
|
|>>>> | 6%
|
|>>>> | 7%
|
|>>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I c_cs
## 0.7146 0.1568 4.5575 0.0000 0.4053 1.0240 0.3193
##
## Direct effect of X on Y:
## effect se t p LLCI ULCI c'_cs
## 0.6059 0.1636 3.7034 0.0003 0.2831 0.9287 0.2707
##
## Indirect effect(s) of X on Y:
## Effect BootSE BootLLCI BootULCI
## reactive 0.1087 0.0624 -0.0064 0.2383
##
## Completely standardized indirect effect(s) of X on Y:
## Effect BootSE BootLLCI BootULCI
## reactive 0.0486 0.0273 -0.0028 0.1046
##
## ********** BOOTSTRAP RESULTS FOR REGRESSION MODEL PARAMETERS **********
##
## Outcome variable: reactive
##
## Coeff BootMean BootSE BootLLCI BootULCI
## constant 4.4318 4.4370 0.2930 3.8578 5.0013
## depression -0.7492 -0.7519 0.1575 -1.0647 -0.4425
## ----------
## Outcome variable: attachmentanxiety
##
## Coeff BootMean BootSE BootLLCI BootULCI
## constant 3.0274 3.0299 0.4395 2.1433 3.8507
## depression 0.6059 0.6056 0.1607 0.2904 0.9208
## reactive -0.1451 -0.1455 0.0755 -0.2815 0.0109
##
## ******************** ANALYSIS NOTES AND ERRORS ************************
##
## Level of confidence for all confidence intervals in output: 95
##
## Number of bootstraps for percentile bootstrap confidence intervals: 2000
describe(finaldat$depression)
describe(finaldat$attachmentanxiety)
\(\upsilon\) = (-0.62)2-(.122) * ((-.16)2-(.052)) * ((0.03)2/(0.062)) ((0.384-0.015) * (0.026-0.003) * ((0.0009)/(0.0036)))
(0.37)*(0.02)*(0.25)
## [1] 0.00185
ndf <- create_node_df(
n = 3,
label = c( "Depression","Reactive Coping", "Attachment Anxiety"),
shape = rep("rectangle", 3),
style = "empty",
fontsize = 6,
fixedsize = TRUE,
height = .5,
width = .75,
color = "gray80",
x = c(1, 2, 3),
y = c(1, 2, 1)
)
edf <- create_edge_df(
from = c(1, 1, 2),
to = c(2, 3, 3),
label = c("-0.62", "0.59", "-0.16"),
fontsize = 6,
minlen = 1,
color = "gray80",
)
graph <- create_graph(
nodes_df = ndf,
edges_df = edf
)
graph %>%
render_graph()