# Descriptive Statistics
mydata.wide %>%
select(perpetration.PA, victimization.PA, alcohol.PA) %>%
tbl_summary(statistic = list(
all_continuous() ~ "{mean}({sd}) [{min} - {max}]",
all_categorical() ~ "{n} ({p}%)"),
missing_text = "(Missing or prefer not to answer)",
label = list(
perpetration.PA ~ "Men's self-report of IPV Perpetration",
victimization.PA ~ "Men's self-report of IPV Victimization",
alcohol.PA ~ "Men's alcohol consumption"))
| Characteristic |
N = 781 |
| Men's self-report of IPV Perpetration |
1.31(0.80) [1.00 - 7.00] |
| Men's self-report of IPV Victimization |
1.33(0.83) [1.00 - 7.00] |
| Men's alcohol consumption |
3.4(4.3) [0.0 - 21.0] |
mydata.wide %>%
select(perpetration.PB, victimization.PB, alcohol.PB) %>%
tbl_summary(statistic = list(
all_continuous() ~ "{mean}({sd}) [{min} - {max}]",
all_categorical() ~ "{n} ({p}%)"),
missing_text = "(Missing or prefer not to answer)",
label = list(
perpetration.PB ~ "Women's self-report of IPV Perpetration",
victimization.PB ~ "Women's self-report of IPV Victimization",
alcohol.PB ~ "Women's alcohol consumption"))
| Characteristic |
N = 781 |
| Women's self-report of IPV Perpetration |
1.32(0.81) [1.00 - 10.00] |
| Women's self-report of IPV Victimization |
1.31(0.85) [1.00 - 10.00] |
| Women's alcohol consumption |
2.3(3.5) [0.0 - 21.0] |
describe(mydata.long$restrictiveness)
## mydata.long$restrictiveness
## n missing distinct Info Mean Gmd .05 .10
## 1562 0 12 0.924 71.31 12.01 51.28 60.30
## .25 .50 .75 .90 .95
## 61.11 74.08 81.85 81.85 81.85
##
## lowest : 46.41 51.28 54.63 60.30 61.11, highest: 66.35 74.08 77.81 78.49 81.85
##
## Value 46.41 51.28 54.63 60.30 61.11 62.27 62.82 66.35 74.08 77.81 78.49
## Frequency 32 100 18 200 118 124 20 40 154 62 44
## Proportion 0.020 0.064 0.012 0.128 0.076 0.079 0.013 0.026 0.099 0.040 0.028
##
## Value 81.85
## Frequency 650
## Proportion 0.416
# Gender Differences and Visualizations
ggboxplot(mydata.long, x = "role.f", y = "alcohol",
color = "role.f", palette = c("#00AFBB", "#E7B800"),
order = c("men", "women"),
ylab = "Alcohol Consumption", xlab = "Gender")

t.test(mydata.wide$alcohol.PA, mydata.wide$alcohol.PB, paired = TRUE, alternative = "two.sided")
##
## Paired t-test
##
## data: mydata.wide$alcohol.PA and mydata.wide$alcohol.PB
## t = 7.76, df = 780, p-value = 2.662e-14
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 0.8079329 1.3551059
## sample estimates:
## mean difference
## 1.081519
t.test(mydata.wide$victimization.PA, mydata.wide$victimization.PB, paired = TRUE, alternative = "two.sided")
##
## Paired t-test
##
## data: mydata.wide$victimization.PA and mydata.wide$victimization.PB
## t = 1.0462, df = 780, p-value = 0.2958
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.02244131 0.07365770
## sample estimates:
## mean difference
## 0.02560819
t.test(mydata.wide$perpetration.PA, mydata.wide$perpetration.PB, paired = TRUE, alternative = "two.sided")
##
## Paired t-test
##
## data: mydata.wide$perpetration.PA and mydata.wide$perpetration.PB
## t = -0.49998, df = 780, p-value = 0.6172
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.05361429 0.03184733
## sample estimates:
## mean difference
## -0.01088348
ggplot(data=subset(mydata.long, !is.na(role.f)), aes(x=alcohol, y=role.f)) +
geom_boxplot(fill='#94AEBC', color='black') +
coord_flip() +
theme_classic() +
labs(x = "alcohol consumption composite", y = "gender", title ='alcohol consumption by partner')

# Correlations
comp <- mydata.wide[,c("StringencyIndex", "perpetration.PA", "victimization.PA", "alcohol.PA",
"perpetration.PB", "victimization.PB", "alcohol.PB")]
### calculating correlations and CIs
cor1 <- cor.mtest(comp, use="pairwise.complete.obs", conf.level = 0.95)
cor1b <- cor(comp, use="pairwise.complete.obs")
rownames(cor1b) <- c(
"Restrictiveness",
"Men's self-report of perpetration",
"Men's self-report of victimization",
"Men's alcohol consumption",
"Women's self-report of perpetration",
"Women's self-report of victimization",
"Women's alcohol consumption")
colnames(cor1b) <- c(
"Restrictiveness",
"Men's self-report of perpetration",
"Men's self-report of victimization",
"Men's alcohol consumption",
"Women's self-report of perpetration",
"Women's self-report of victimization",
"Women's alcohol consumption")
### correlation Matrix
corrplot(cor1b, method="color", type="upper",
addCoef.col = "black", tl.col="black", tl.srt=40, p.mat = cor1$p, tl.cex = 0.8,
insig = "pch",sig.level =.05, pch.cex = 1,
diag=FALSE, number.cex = .65,
col=colorRampPalette(c("#728393", "white", "hotpink"))(50), cl.pos = 'n')

# APIM on Distinguishable Dyads - Simple Model without Moderation - Victimization
## MODEL 1: victimization
model1 <- '
victimization.PA ~ a1*alcohol.PA
victimization.PB ~ a2*alcohol.PB
victimization.PA ~ p12a*alcohol.PB
victimization.PB ~ p21a*alcohol.PA
alcohol.PA ~ mx1a*1
alcohol.PB ~ mx2a*1
victimization.PA ~ my1a*1 + my1b*1
victimization.PB ~ my2a*1 + my2b*1
victimization.PA ~~ vy1*victimization.PA
victimization.PB ~~ vy2*victimization.PB
alcohol.PA ~~ vx1a*alcohol.PA
alcohol.PB ~~ vx2a*alcohol.PB
alcohol.PB ~~ cxa*alcohol.PA
victimization.PB ~~ cy*victimization.PA'
model1.fit <- lavaan::sem(model1,fixed.x=FALSE, data = mydata.wide, missing="fiml")
summary(model1.fit, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE,estimates = TRUE, ci = TRUE)
## lavaan 0.6.17 ended normally after 35 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
##
## Number of observations 781
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 0.000
## Degrees of freedom 0
##
## Model Test Baseline Model:
##
## Test statistic 715.066
## Degrees of freedom 6
## P-value 0.000
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000
## Tucker-Lewis Index (TLI) 1.000
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) 1.000
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -5921.197
## Loglikelihood unrestricted model (H1) -5921.197
##
## Akaike (AIC) 11870.394
## Bayesian (BIC) 11935.642
## Sample-size adjusted Bayesian (SABIC) 11891.185
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: RMSEA <= 0.050 NA
## P-value H_0: RMSEA >= 0.080 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
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Observed
## Observed information based on Hessian
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## victimization.PA ~
## alch.PA (a1) -0.011 0.008 -1.313 0.189 -0.026 0.005
## victimization.PB ~
## alch.PB (a2) 0.017 0.010 1.622 0.105 -0.003 0.037
## victimization.PA ~
## alch.PB (p12a) 0.025 0.010 2.514 0.012 0.005 0.044
## victimization.PB ~
## alch.PA (p21a) -0.008 0.008 -0.929 0.353 -0.024 0.009
## Std.lv Std.all
##
## -0.011 -0.055
##
## 0.017 0.068
##
## 0.025 0.104
##
## -0.008 -0.039
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## alcohol.PA ~~
## alchl.PB (cxa) 7.688 0.601 12.783 0.000 6.509 8.866
## .victimization.PA ~~
## .vctmz.PB (cy) 0.474 0.030 15.562 0.000 0.414 0.534
## Std.lv Std.all
##
## 7.688 0.514
##
## 0.474 0.670
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## alch.PA (mx1a) 3.377 0.153 22.022 0.000 3.076 3.677
## alch.PB (mx2a) 2.295 0.125 18.392 0.000 2.051 2.540
## .vctm.PA (my1a) 1.313 0.039 33.861 0.000 1.237 1.389
## .vctm.PB (my2a) 1.297 0.040 32.540 0.000 1.219 1.375
## Std.lv Std.all
## 3.377 0.788
## 2.295 0.658
## 1.313 1.577
## 1.297 1.519
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .vctm.PA (vy1) 0.688 0.035 19.761 0.000 0.620 0.756
## .vctm.PB (vy2) 0.727 0.037 19.761 0.000 0.655 0.799
## alch.PA (vx1a) 18.362 0.929 19.761 0.000 16.541 20.184
## alch.PB (vx2a) 12.164 0.616 19.761 0.000 10.957 13.370
## Std.lv Std.all
## 0.688 0.992
## 0.727 0.997
## 18.362 1.000
## 12.164 1.000
##
## R-Square:
## Estimate
## victimizatn.PA 0.008
## victimizatn.PB 0.003
# Rsquare for victimization.a = .008, for victimization.b = .003
# significant partner effect (men's victimization is positively predicted by women's alcohol consumption)
parameterEstimates(model1.fit, standardized = TRUE)
## lhs op rhs label est se z pvalue
## 1 victimization.PA ~ alcohol.PA a1 -0.011 0.008 -1.313 0.189
## 2 victimization.PB ~ alcohol.PB a2 0.017 0.010 1.622 0.105
## 3 victimization.PA ~ alcohol.PB p12a 0.025 0.010 2.514 0.012
## 4 victimization.PB ~ alcohol.PA p21a -0.008 0.008 -0.929 0.353
## 5 alcohol.PA ~1 mx1a 3.377 0.153 22.022 0.000
## 6 alcohol.PB ~1 mx2a 2.295 0.125 18.392 0.000
## 7 victimization.PA ~1 my1a 1.313 0.039 33.861 0.000
## 8 victimization.PB ~1 my2a 1.297 0.040 32.540 0.000
## 9 victimization.PA ~~ victimization.PA vy1 0.688 0.035 19.761 0.000
## 10 victimization.PB ~~ victimization.PB vy2 0.727 0.037 19.761 0.000
## 11 alcohol.PA ~~ alcohol.PA vx1a 18.362 0.929 19.761 0.000
## 12 alcohol.PB ~~ alcohol.PB vx2a 12.164 0.616 19.761 0.000
## 13 alcohol.PA ~~ alcohol.PB cxa 7.688 0.601 12.783 0.000
## 14 victimization.PA ~~ victimization.PB cy 0.474 0.030 15.562 0.000
## ci.lower ci.upper std.lv std.all std.nox
## 1 -0.026 0.005 -0.011 -0.055 -0.055
## 2 -0.003 0.037 0.017 0.068 0.068
## 3 0.005 0.044 0.025 0.104 0.104
## 4 -0.024 0.009 -0.008 -0.039 -0.039
## 5 3.076 3.677 3.377 0.788 0.788
## 6 2.051 2.540 2.295 0.658 0.658
## 7 1.237 1.389 1.313 1.577 1.577
## 8 1.219 1.375 1.297 1.519 1.519
## 9 0.620 0.756 0.688 0.992 0.992
## 10 0.655 0.799 0.727 0.997 0.997
## 11 16.541 20.184 18.362 1.000 1.000
## 12 10.957 13.370 12.164 1.000 1.000
## 13 6.509 8.866 7.688 0.514 0.514
## 14 0.414 0.534 0.474 0.670 0.670
semPaths(model1.fit,
fade = F, "std.all", layout='tree2', rotation = 2, style = "ram",
intercepts = F, residuals = F, optimizeLatRes = T, curve = 2.75,
# labels and their sizes:
sizeMan=12, sizeMan2=12,
# position and size of parameter estimates:
edge.label.position = 0.45, edge.label.cex=.75, label.cex = 1.2)

# APIM on Distinguishable Dyads - Simple Model without Moderation - Perpetration
## MODEL 2: perpetration
model2 <- '
perpetration.PA ~ a1*alcohol.PA
perpetration.PB ~ a2*alcohol.PB
perpetration.PA ~ p12a*alcohol.PB
perpetration.PB ~ p21a*alcohol.PA
alcohol.PA ~ mx1a*1
alcohol.PB ~ mx2a*1
perpetration.PA ~ my1a*1 + my1b*1
perpetration.PB ~ my2a*1 + my2b*1
perpetration.PA ~~ vy1*perpetration.PA
perpetration.PB ~~ vy2*perpetration.PB
alcohol.PA ~~ vx1a*alcohol.PA
alcohol.PB ~~ vx2a*alcohol.PB
alcohol.PB ~~ cxa*alcohol.PA
perpetration.PB ~~ cy*perpetration.PA'
model2.fit <- lavaan::sem(model2,fixed.x=FALSE, data = mydata.wide, missing="fiml")
summary(model2.fit, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE,estimates = TRUE, ci = TRUE)
## lavaan 0.6.17 ended normally after 37 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
##
## Number of observations 781
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 0.000
## Degrees of freedom 0
##
## Model Test Baseline Model:
##
## Test statistic 804.867
## Degrees of freedom 6
## P-value 0.000
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000
## Tucker-Lewis Index (TLI) 1.000
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) 1.000
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -5802.539
## Loglikelihood unrestricted model (H1) -5802.539
##
## Akaike (AIC) 11633.077
## Bayesian (BIC) 11698.325
## Sample-size adjusted Bayesian (SABIC) 11653.868
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: RMSEA <= 0.050 NA
## P-value H_0: RMSEA >= 0.080 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
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Observed
## Observed information based on Hessian
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## perpetration.PA ~
## alch.PA (a1) -0.004 0.008 -0.490 0.624 -0.019 0.011
## perpetration.PB ~
## alch.PB (a2) 0.019 0.010 2.026 0.043 0.001 0.038
## perpetration.PA ~
## alch.PB (p12a) 0.012 0.010 1.209 0.227 -0.007 0.030
## perpetration.PB ~
## alch.PA (p21a) -0.015 0.008 -1.959 0.050 -0.031 0.000
## Std.lv Std.all
##
## -0.004 -0.020
##
## 0.019 0.084
##
## 0.012 0.050
##
## -0.015 -0.081
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## alcohol.PA ~~
## alchl.PB (cxa) 7.688 0.601 12.783 0.000 6.509 8.866
## .perpetration.PA ~~
## .prptr.PB (cy) 0.460 0.028 16.248 0.000 0.405 0.516
## Std.lv Std.all
##
## 7.688 0.514
##
## 0.460 0.715
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## alch.PA (mx1a) 3.377 0.153 22.022 0.000 3.076 3.677
## alch.PB (mx2a) 2.295 0.125 18.392 0.000 2.051 2.540
## .prpt.PA (my1a) 1.294 0.038 34.461 0.000 1.221 1.368
## .prpt.PB (my2a) 1.326 0.038 35.339 0.000 1.252 1.399
## Std.lv Std.all
## 3.377 0.788
## 2.295 0.658
## 1.294 1.610
## 1.326 1.647
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower ci.upper
## .prpt.PA (vy1) 0.645 0.033 19.761 0.000 0.581 0.709
## .prpt.PB (vy2) 0.644 0.033 19.761 0.000 0.580 0.708
## alch.PA (vx1a) 18.362 0.929 19.761 0.000 16.541 20.184
## alch.PB (vx2a) 12.164 0.616 19.761 0.000 10.957 13.370
## Std.lv Std.all
## 0.645 0.998
## 0.644 0.993
## 18.362 1.000
## 12.164 1.000
##
## R-Square:
## Estimate
## perpetratin.PA 0.002
## perpetratin.PB 0.007
# Rsquare for perpetration.a = .002, for perpetration.b = .007
# significant actor effect (women's perpetration positively predicted by their own alcohol consumption)
# significant partner effect (women's perpetration negatively predicted by the man's alcohol consumption)
parameterEstimates(model2.fit, standardized = TRUE)
## lhs op rhs label est se z pvalue ci.lower
## 1 perpetration.PA ~ alcohol.PA a1 -0.004 0.008 -0.490 0.624 -0.019
## 2 perpetration.PB ~ alcohol.PB a2 0.019 0.010 2.026 0.043 0.001
## 3 perpetration.PA ~ alcohol.PB p12a 0.012 0.010 1.209 0.227 -0.007
## 4 perpetration.PB ~ alcohol.PA p21a -0.015 0.008 -1.959 0.050 -0.031
## 5 alcohol.PA ~1 mx1a 3.377 0.153 22.022 0.000 3.076
## 6 alcohol.PB ~1 mx2a 2.295 0.125 18.392 0.000 2.051
## 7 perpetration.PA ~1 my1a 1.294 0.038 34.461 0.000 1.221
## 8 perpetration.PB ~1 my2a 1.326 0.038 35.339 0.000 1.252
## 9 perpetration.PA ~~ perpetration.PA vy1 0.645 0.033 19.761 0.000 0.581
## 10 perpetration.PB ~~ perpetration.PB vy2 0.644 0.033 19.761 0.000 0.580
## 11 alcohol.PA ~~ alcohol.PA vx1a 18.362 0.929 19.761 0.000 16.541
## 12 alcohol.PB ~~ alcohol.PB vx2a 12.164 0.616 19.761 0.000 10.957
## 13 alcohol.PA ~~ alcohol.PB cxa 7.688 0.601 12.783 0.000 6.509
## 14 perpetration.PA ~~ perpetration.PB cy 0.460 0.028 16.248 0.000 0.405
## ci.upper std.lv std.all std.nox
## 1 0.011 -0.004 -0.020 -0.020
## 2 0.038 0.019 0.084 0.084
## 3 0.030 0.012 0.050 0.050
## 4 0.000 -0.015 -0.081 -0.081
## 5 3.677 3.377 0.788 0.788
## 6 2.540 2.295 0.658 0.658
## 7 1.368 1.294 1.610 1.610
## 8 1.399 1.326 1.647 1.647
## 9 0.709 0.645 0.998 0.998
## 10 0.708 0.644 0.993 0.993
## 11 20.184 18.362 1.000 1.000
## 12 13.370 12.164 1.000 1.000
## 13 8.866 7.688 0.514 0.514
## 14 0.516 0.460 0.715 0.715
semPaths(model2.fit,
fade = F, "std.all", layout='tree2', rotation = 2, style = "ram",
intercepts = F, residuals = F, optimizeLatRes = T, curve = 2.75,
# labels and their sizes:
sizeMan=12, sizeMan2=12,
# position and size of parameter estimates:
edge.label.position = 0.45, edge.label.cex=.75, label.cex = 1.2)

# APIM on Distinguishable Dyads -With Moderation
# NOT 100% CONFIDENT IN THE CODE BELOW
# Rshiny app hs a bug for the moderated APIM model code
# Testing if restrictiveness moderates the path actor or partner effect paths for Model 1
mydata.wide$restrictxalcohol.PA = mydata.wide$StringencyIndex * mydata.wide$alcohol.PA
mydata.wide$restrictxalcohol.PB = mydata.wide$StringencyIndex * mydata.wide$alcohol.PB
model1.mod <- '
victimization.PA ~ a1*alcohol.PA + m1*StringencyIndex
victimization.PB ~ a2*alcohol.PB + m1*StringencyIndex
victimization.PA ~ p12a*alcohol.PB
victimization.PB ~ p21a*alcohol.PA
victimization.PA ~ a3*restrictxalcohol.PA
victimization.PB ~ a4*restrictxalcohol.PB
IndMedMod1:= a3*a1
IndMedMod2:= a4*a2
alcohol.PA ~ mx1a*1
alcohol.PB ~ mx2a*1
victimization.PA ~ my1a*1 + my1b*1
victimization.PB ~ my2a*1 + my2b*1
victimization.PA ~~ vy1*victimization.PA
victimization.PB ~~ vy2*victimization.PB
alcohol.PA ~~ vx1a*alcohol.PA
alcohol.PB ~~ vx2a*alcohol.PB
alcohol.PB ~~ cxa*alcohol.PA
victimization.PB ~~ cy*victimization.PA'
model1.mod.fit <- lavaan::sem(model1.mod,fixed.x=FALSE, data = mydata.wide, missing="fiml")
summary(model1.mod.fit, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE,estimates = TRUE, ci = TRUE)
## lavaan 0.6.17 ended normally after 52 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 27
## Number of equality constraints 1
##
## Number of observations 781
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 6014.009
## Degrees of freedom 9
## P-value (Chi-square) 0.000
##
## Model Test Baseline Model:
##
## Test statistic 6965.379
## Degrees of freedom 18
## P-value 0.000
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.136
## Tucker-Lewis Index (TLI) -0.729
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) -24.831
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -19809.778
## Loglikelihood unrestricted model (H1) -16802.773
##
## Akaike (AIC) 39671.556
## Bayesian (BIC) 39792.730
## Sample-size adjusted Bayesian (SABIC) 39710.168
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.924
## 90 Percent confidence interval - lower 0.905
## 90 Percent confidence interval - upper 0.944
## P-value H_0: RMSEA <= 0.050 0.000
## P-value H_0: RMSEA >= 0.080 1.000
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 1.004
## P-value H_0: Robust RMSEA <= 0.050 0.578
## P-value H_0: Robust RMSEA >= 0.080 0.419
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.278
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Observed
## Observed information based on Hessian
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower
## victimization.PA ~
## alch.PA (a1) 0.016 0.035 0.446 0.656 -0.053
## StrngnI (m1) -0.009 0.003 -3.102 0.002 -0.014
## victimization.PB ~
## alch.PB (a2) -0.061 0.045 -1.376 0.169 -0.149
## StrngnI (m1) -0.009 0.003 -3.102 0.002 -0.014
## victimization.PA ~
## alch.PB (p12a) 0.023 0.010 2.348 0.019 0.004
## victimization.PB ~
## alch.PA (p21a) -0.007 0.008 -0.789 0.430 -0.023
## victimization.PA ~
## rstr.PA (a3) -0.000 0.000 -0.763 0.446 -0.001
## victimization.PB ~
## rstr.PB (a4) 0.001 0.001 1.781 0.075 -0.000
## ci.upper Std.lv Std.all
##
## 0.084 0.016 0.079
## -0.003 -0.009 -0.115
##
## 0.026 -0.061 -0.231
## -0.003 -0.009 -0.105
##
## 0.043 0.023 0.096
##
## 0.010 -0.007 -0.030
##
## 0.001 -0.000 -0.132
##
## 0.002 0.001 0.294
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower
## alcohol.PA ~~
## alchl.PB (cxa) 7.688 0.601 12.783 0.000 6.509
## .victimization.PA ~~
## .vctmz.PB (cy) 0.469 0.030 15.571 0.000 0.410
## StringencyIndex ~~
## rstrc.PA 415.770 0.045 9203.304 0.000 415.682
## rstrc.PB 228.896 0.017 13673.400 0.000 228.863
## restrictxalcohol.PA ~~
## rstrc.PB 38855.780 0.000 630680285.461 0.000 38855.780
## ci.upper Std.lv Std.all
##
## 8.866 7.688 0.514
##
## 0.529 0.469 0.671
##
## 415.859 415.770 0.119
## 228.929 228.896 0.082
##
## 38855.780 38855.780 0.491
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower
## alch.PA (mx1a) 3.377 0.153 22.022 0.000 3.076
## alch.PB (mx2a) 2.295 0.125 18.392 0.000 2.051
## .vctm.PA (my1a) 1.941 0.206 9.427 0.000 1.537
## .vctm.PB (my2a) 1.922 0.206 9.350 0.000 1.519
## StrngnI 71.311 0.397 179.597 0.000 70.533
## rstr.PA 240.581 11.252 21.382 0.000 218.529
## rstr.PB 162.753 8.997 18.090 0.000 145.120
## ci.upper Std.lv Std.all
## 3.677 3.377 0.788
## 2.540 2.295 0.658
## 2.344 1.941 2.295
## 2.325 1.922 2.077
## 72.089 71.311 6.426
## 262.634 240.581 0.765
## 180.386 162.753 0.647
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower
## .vctm.PA (vy1) 0.674 0.034 19.751 0.000 0.607
## .vctm.PB (vy2) 0.725 0.037 19.735 0.000 0.653
## alch.PA (vx1a) 18.362 0.929 19.761 0.000 16.541
## alch.PB (vx2a) 12.164 0.616 19.761 0.000 10.957
## StrngnI 123.130 6.138 20.062 0.000 111.101
## rstr.PA 98872.173 0.000 1189358850.725 0.000 98872.173
## rstr.PB 63215.376 0.000 5538390630.687 0.000 63215.376
## ci.upper Std.lv Std.all
## 0.741 0.674 0.943
## 0.797 0.725 0.846
## 20.184 18.362 1.000
## 13.370 12.164 1.000
## 135.160 123.130 1.000
## 98872.173 98872.173 1.000
## 63215.376 63215.376 1.000
##
## R-Square:
## Estimate
## victimizatn.PA 0.057
## victimizatn.PB 0.154
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower
## IndMedMod1 -0.000 0.000 -0.283 0.777 -0.000
## IndMedMod2 -0.000 0.000 -0.781 0.435 -0.000
## ci.upper Std.lv Std.all
## 0.000 -0.000 -0.010
## 0.000 -0.000 -0.068
parameterEstimates(model1.mod.fit, standardized = TRUE)
## lhs op rhs label est se
## 1 victimization.PA ~ alcohol.PA a1 0.016 0.035
## 2 victimization.PA ~ StringencyIndex m1 -0.009 0.003
## 3 victimization.PB ~ alcohol.PB a2 -0.061 0.045
## 4 victimization.PB ~ StringencyIndex m1 -0.009 0.003
## 5 victimization.PA ~ alcohol.PB p12a 0.023 0.010
## 6 victimization.PB ~ alcohol.PA p21a -0.007 0.008
## 7 victimization.PA ~ restrictxalcohol.PA a3 0.000 0.000
## 8 victimization.PB ~ restrictxalcohol.PB a4 0.001 0.001
## 9 alcohol.PA ~1 mx1a 3.377 0.153
## 10 alcohol.PB ~1 mx2a 2.295 0.125
## 11 victimization.PA ~1 my1a 1.941 0.206
## 12 victimization.PB ~1 my2a 1.922 0.206
## 13 victimization.PA ~~ victimization.PA vy1 0.674 0.034
## 14 victimization.PB ~~ victimization.PB vy2 0.725 0.037
## 15 alcohol.PA ~~ alcohol.PA vx1a 18.362 0.929
## 16 alcohol.PB ~~ alcohol.PB vx2a 12.164 0.616
## 17 alcohol.PA ~~ alcohol.PB cxa 7.688 0.601
## 18 victimization.PA ~~ victimization.PB cy 0.469 0.030
## 19 StringencyIndex ~~ StringencyIndex 123.130 6.138
## 20 StringencyIndex ~~ restrictxalcohol.PA 415.770 0.045
## 21 StringencyIndex ~~ restrictxalcohol.PB 228.896 0.017
## 22 restrictxalcohol.PA ~~ restrictxalcohol.PA 98872.173 0.000
## 23 restrictxalcohol.PA ~~ restrictxalcohol.PB 38855.780 0.000
## 24 restrictxalcohol.PB ~~ restrictxalcohol.PB 63215.376 0.000
## 25 StringencyIndex ~1 71.311 0.397
## 26 restrictxalcohol.PA ~1 240.581 11.252
## 27 restrictxalcohol.PB ~1 162.753 8.997
## 28 IndMedMod1 := a3*a1 IndMedMod1 0.000 0.000
## 29 IndMedMod2 := a4*a2 IndMedMod2 0.000 0.000
## z pvalue ci.lower ci.upper std.lv std.all std.nox
## 1 4.460000e-01 0.656 -0.053 0.084 0.016 0.079 0.079
## 2 -3.102000e+00 0.002 -0.014 -0.003 -0.009 -0.115 -0.010
## 3 -1.376000e+00 0.169 -0.149 0.026 -0.061 -0.231 -0.735
## 4 -3.102000e+00 0.002 -0.014 -0.003 -0.009 -0.105 -0.009
## 5 2.348000e+00 0.019 0.004 0.043 0.023 0.096 0.305
## 6 -7.890000e-01 0.430 -0.023 0.010 -0.007 -0.030 -0.030
## 7 -7.630000e-01 0.446 -0.001 0.001 0.000 -0.132 0.000
## 8 1.781000e+00 0.075 0.000 0.002 0.001 0.294 0.001
## 9 2.202200e+01 0.000 3.076 3.677 3.377 0.788 0.788
## 10 1.839200e+01 0.000 2.051 2.540 2.295 0.658 0.658
## 11 9.427000e+00 0.000 1.537 2.344 1.941 2.295 2.295
## 12 9.350000e+00 0.000 1.519 2.325 1.922 2.077 2.077
## 13 1.975100e+01 0.000 0.607 0.741 0.674 0.943 0.943
## 14 1.973500e+01 0.000 0.653 0.797 0.725 0.846 0.846
## 15 1.976100e+01 0.000 16.541 20.184 18.362 1.000 1.000
## 16 1.976100e+01 0.000 10.957 13.370 12.164 1.000 1.000
## 17 1.278300e+01 0.000 6.509 8.866 7.688 0.514 0.514
## 18 1.557100e+01 0.000 0.410 0.529 0.469 0.671 0.671
## 19 2.006200e+01 0.000 111.101 135.160 123.130 1.000 123.130
## 20 9.203304e+03 0.000 415.682 415.859 415.770 0.119 415.770
## 21 1.367340e+04 0.000 228.863 228.929 228.896 0.082 228.896
## 22 1.189359e+09 0.000 98872.173 98872.173 98872.173 1.000 98872.173
## 23 6.306803e+08 0.000 38855.780 38855.780 38855.780 0.491 38855.780
## 24 5.538391e+09 0.000 63215.376 63215.376 63215.376 1.000 63215.376
## 25 1.795970e+02 0.000 70.533 72.089 71.311 6.426 71.311
## 26 2.138200e+01 0.000 218.529 262.634 240.581 0.765 240.581
## 27 1.809000e+01 0.000 145.120 180.386 162.753 0.647 162.753
## 28 -2.830000e-01 0.777 0.000 0.000 0.000 -0.010 0.000
## 29 -7.810000e-01 0.435 0.000 0.000 0.000 -0.068 -0.001
##################################################################################################
# Testing if restrictiveness moderates the path actor or partner effect paths for Model 2
model2.mod <- '
perpetration.PA ~ a1*alcohol.PA + m1*StringencyIndex
perpetration.PB ~ a2*alcohol.PB + m1*StringencyIndex
perpetration.PA ~ p12a*alcohol.PB
perpetration.PB ~ p21a*alcohol.PA
perpetration.PA ~ a3*restrictxalcohol.PA
perpetration.PB ~ a4*restrictxalcohol.PB
IndMedMod1:= a3*a1
IndMedMod2:= a4*a2
alcohol.PA ~ mx1a*1
alcohol.PB ~ mx2a*1
perpetration.PA ~ my1a*1 + my1b*1
perpetration.PB ~ my2a*1 + my2b*1
perpetration.PA ~~ vy1*perpetration.PA
perpetration.PB ~~ vy2*perpetration.PB
alcohol.PA ~~ vx1a*alcohol.PA
alcohol.PB ~~ vx2a*alcohol.PB
alcohol.PB ~~ cxa*alcohol.PA
perpetration.PB ~~ cy*perpetration.PA'
model2.mod.fit <- lavaan::sem(model2.mod,fixed.x=FALSE, data = mydata.wide, missing="fiml")
summary(model2.mod.fit, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE,estimates = TRUE, ci = TRUE)
## lavaan 0.6.17 ended normally after 47 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 27
## Number of equality constraints 1
##
## Number of observations 781
## Number of missing patterns 1
##
## Model Test User Model:
##
## Test statistic 6011.554
## Degrees of freedom 9
## P-value (Chi-square) 0.000
##
## Model Test Baseline Model:
##
## Test statistic 7051.649
## Degrees of freedom 18
## P-value 0.000
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.147
## Tucker-Lewis Index (TLI) -0.707
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) 145.075
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -19691.658
## Loglikelihood unrestricted model (H1) -16685.881
##
## Akaike (AIC) 39435.316
## Bayesian (BIC) 39556.491
## Sample-size adjusted Bayesian (SABIC) 39473.928
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.924
## 90 Percent confidence interval - lower 0.905
## 90 Percent confidence interval - upper 0.944
## P-value H_0: RMSEA <= 0.050 0.000
## P-value H_0: RMSEA >= 0.080 1.000
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 1.002
## P-value H_0: Robust RMSEA <= 0.050 0.582
## P-value H_0: Robust RMSEA >= 0.080 0.415
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.264
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Observed
## Observed information based on Hessian
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) ci.lower
## perpetration.PA ~
## alch.PA (a1) -0.027 0.032 -0.827 0.408 -0.090
## StrngnI (m1) -0.010 0.003 -3.797 0.000 -0.015
## perpetration.PB ~
## alch.PB (a2) 0.030 0.040 0.742 0.458 -0.049
## StrngnI (m1) -0.010 0.003 -3.797 0.000 -0.015
## perpetration.PA ~
## alch.PB (p12a) 0.011 0.010 1.200 0.230 -0.007
## perpetration.PB ~
## alch.PA (p21a) -0.015 0.008 -1.958 0.050 -0.030
## perpetration.PA ~
## rstr.PA (a3) 0.000 0.000 0.738 0.460 -0.001
## perpetration.PB ~
## rstr.PB (a4) -0.000 0.001 -0.292 0.771 -0.001
## ci.upper Std.lv Std.all
##
## 0.037 -0.027 -0.141
## -0.005 -0.010 -0.139
##
## 0.109 0.030 0.129
## -0.005 -0.010 -0.140
##
## 0.030 0.011 0.049
##
## 0.000 -0.015 -0.080
##
## 0.001 0.000 0.123
##
## 0.001 -0.000 -0.050
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) ci.lower
## alcohol.PA ~~
## alchl.PB (cxa) 7.688 0.601 12.783 0.000 6.509
## .perpetration.PA ~~
## .prptr.PB (cy) 0.448 0.028 16.163 0.000 0.394
## StringencyIndex ~~
## rstrc.PA 415.832 0.045 9200.247 0.000 415.744
## rstrc.PB 228.886 0.017 13687.536 0.000 228.853
## restrictxalcohol.PA ~~
## rstrc.PB 38856.054 0.000 631059595.295 0.000 38856.054
## ci.upper Std.lv Std.all
##
## 8.866 7.688 0.514
##
## 0.502 0.448 0.709
##
## 415.921 415.832 0.119
## 228.918 228.886 0.082
##
## 38856.054 38856.054 0.491
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) ci.lower
## alch.PA (mx1a) 3.377 0.153 22.022 0.000 3.076
## alch.PB (mx2a) 2.295 0.125 18.392 0.000 2.051
## .prpt.PA (my1a) 2.023 0.196 10.346 0.000 1.640
## .prpt.PB (my2a) 2.055 0.195 10.535 0.000 1.673
## StrngnI 71.311 0.397 179.597 0.000 70.533
## rstr.PA 240.581 11.252 21.382 0.000 218.529
## rstr.PB 162.753 8.997 18.090 0.000 145.120
## ci.upper Std.lv Std.all
## 3.677 3.377 0.788
## 2.540 2.295 0.658
## 2.406 2.023 2.483
## 2.437 2.055 2.542
## 72.089 71.311 6.426
## 262.634 240.581 0.765
## 180.386 162.753 0.647
##
## Variances:
## Estimate Std.Err z-value P(>|z|) ci.lower
## .prpt.PA (vy1) 0.633 0.032 19.752 0.000 0.571
## .prpt.PB (vy2) 0.630 0.032 19.755 0.000 0.568
## alch.PA (vx1a) 18.362 0.929 19.761 0.000 16.541
## alch.PB (vx2a) 12.164 0.616 19.761 0.000 10.957
## StrngnI 123.131 6.138 20.062 0.000 111.101
## rstr.PA 98872.828 0.000 1188236219.299 0.000 98872.827
## rstr.PB 63215.479 0.000 5550204650.267 0.000 63215.479
## ci.upper Std.lv Std.all
## 0.696 0.633 0.954
## 0.693 0.630 0.964
## 20.184 18.362 1.000
## 13.370 12.164 1.000
## 135.160 123.131 1.000
## 98872.828 98872.828 1.000
## 63215.479 63215.479 1.000
##
## R-Square:
## Estimate
## perpetratin.PA 0.046
## perpetratin.PB 0.036
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) ci.lower
## IndMedMod1 -0.000 0.000 -0.393 0.694 -0.000
## IndMedMod2 -0.000 0.000 -0.211 0.833 -0.000
## ci.upper Std.lv Std.all
## 0.000 -0.000 -0.017
## 0.000 -0.000 -0.006
parameterEstimates(model2.mod.fit, standardized = TRUE)
## lhs op rhs label est se
## 1 perpetration.PA ~ alcohol.PA a1 -0.027 0.032
## 2 perpetration.PA ~ StringencyIndex m1 -0.010 0.003
## 3 perpetration.PB ~ alcohol.PB a2 0.030 0.040
## 4 perpetration.PB ~ StringencyIndex m1 -0.010 0.003
## 5 perpetration.PA ~ alcohol.PB p12a 0.011 0.010
## 6 perpetration.PB ~ alcohol.PA p21a -0.015 0.008
## 7 perpetration.PA ~ restrictxalcohol.PA a3 0.000 0.000
## 8 perpetration.PB ~ restrictxalcohol.PB a4 0.000 0.001
## 9 alcohol.PA ~1 mx1a 3.377 0.153
## 10 alcohol.PB ~1 mx2a 2.295 0.125
## 11 perpetration.PA ~1 my1a 2.023 0.196
## 12 perpetration.PB ~1 my2a 2.055 0.195
## 13 perpetration.PA ~~ perpetration.PA vy1 0.633 0.032
## 14 perpetration.PB ~~ perpetration.PB vy2 0.630 0.032
## 15 alcohol.PA ~~ alcohol.PA vx1a 18.362 0.929
## 16 alcohol.PB ~~ alcohol.PB vx2a 12.164 0.616
## 17 alcohol.PA ~~ alcohol.PB cxa 7.688 0.601
## 18 perpetration.PA ~~ perpetration.PB cy 0.448 0.028
## 19 StringencyIndex ~~ StringencyIndex 123.131 6.138
## 20 StringencyIndex ~~ restrictxalcohol.PA 415.832 0.045
## 21 StringencyIndex ~~ restrictxalcohol.PB 228.886 0.017
## 22 restrictxalcohol.PA ~~ restrictxalcohol.PA 98872.828 0.000
## 23 restrictxalcohol.PA ~~ restrictxalcohol.PB 38856.054 0.000
## 24 restrictxalcohol.PB ~~ restrictxalcohol.PB 63215.479 0.000
## 25 StringencyIndex ~1 71.311 0.397
## 26 restrictxalcohol.PA ~1 240.581 11.252
## 27 restrictxalcohol.PB ~1 162.753 8.997
## 28 IndMedMod1 := a3*a1 IndMedMod1 0.000 0.000
## 29 IndMedMod2 := a4*a2 IndMedMod2 0.000 0.000
## z pvalue ci.lower ci.upper std.lv std.all std.nox
## 1 -8.270000e-01 0.408 -0.090 0.037 -0.027 -0.141 -0.141
## 2 -3.797000e+00 0.000 -0.015 -0.005 -0.010 -0.139 -0.013
## 3 7.420000e-01 0.458 -0.049 0.109 0.030 0.129 0.410
## 4 -3.797000e+00 0.000 -0.015 -0.005 -0.010 -0.140 -0.013
## 5 1.200000e+00 0.230 -0.007 0.030 0.011 0.049 0.157
## 6 -1.958000e+00 0.050 -0.030 0.000 -0.015 -0.080 -0.080
## 7 7.380000e-01 0.460 -0.001 0.001 0.000 0.123 0.000
## 8 -2.920000e-01 0.771 -0.001 0.001 0.000 -0.050 0.000
## 9 2.202200e+01 0.000 3.076 3.677 3.377 0.788 0.788
## 10 1.839200e+01 0.000 2.051 2.540 2.295 0.658 0.658
## 11 1.034600e+01 0.000 1.640 2.406 2.023 2.483 2.483
## 12 1.053500e+01 0.000 1.673 2.437 2.055 2.542 2.542
## 13 1.975200e+01 0.000 0.571 0.696 0.633 0.954 0.954
## 14 1.975500e+01 0.000 0.568 0.693 0.630 0.964 0.964
## 15 1.976100e+01 0.000 16.541 20.184 18.362 1.000 1.000
## 16 1.976100e+01 0.000 10.957 13.370 12.164 1.000 1.000
## 17 1.278300e+01 0.000 6.509 8.866 7.688 0.514 0.514
## 18 1.616300e+01 0.000 0.394 0.502 0.448 0.709 0.709
## 19 2.006200e+01 0.000 111.101 135.160 123.131 1.000 123.131
## 20 9.200247e+03 0.000 415.744 415.921 415.832 0.119 415.832
## 21 1.368754e+04 0.000 228.853 228.918 228.886 0.082 228.886
## 22 1.188236e+09 0.000 98872.827 98872.828 98872.828 1.000 98872.828
## 23 6.310596e+08 0.000 38856.054 38856.054 38856.054 0.491 38856.054
## 24 5.550205e+09 0.000 63215.479 63215.479 63215.479 1.000 63215.479
## 25 1.795970e+02 0.000 70.533 72.089 71.311 6.426 71.311
## 26 2.138200e+01 0.000 218.529 262.634 240.581 0.765 240.581
## 27 1.809000e+01 0.000 145.120 180.386 162.753 0.647 162.753
## 28 -3.930000e-01 0.694 0.000 0.000 0.000 -0.017 0.000
## 29 -2.110000e-01 0.833 0.000 0.000 0.000 -0.006 0.000