# Demographic baseline comparisons
chisq.test(queervibe_data$Sexuality, queervibe_data$Group)
Warning in chisq.test(queervibe_data$Sexuality, queervibe_data$Group) :
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: queervibe_data$Sexuality and queervibe_data$Group
X-squared = 4.2526, df = 3, p-value = 0.2354
chisq.test(queervibe_data$Gender, queervibe_data$Group)
Warning in chisq.test(queervibe_data$Gender, queervibe_data$Group) :
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: queervibe_data$Gender and queervibe_data$Group
X-squared = 2.2411, df = 2, p-value = 0.3261
chisq.test(queervibe_data$Employment, queervibe_data$Group)
Warning in chisq.test(queervibe_data$Employment, queervibe_data$Group) :
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: queervibe_data$Employment and queervibe_data$Group
X-squared = 1.4092, df = 2, p-value = 0.4943
chisq.test(queervibe_data$Disability, queervibe_data$Group)
Pearson's Chi-squared test with Yates' continuity correction
data: queervibe_data$Disability and queervibe_data$Group
X-squared = 1.148e-30, df = 1, p-value = 1
table(queervibe_data$Sexuality, queervibe_data$Group)
Intervention Control
Straight 1 2
Gay 3 8
Bisexual 4 2
Other 15 10
table(queervibe_data$Gender, queervibe_data$Group)
Intervention Control
Trans Male 13 12
Non-Binary 8 10
Other 2 0
table(queervibe_data$Employment, queervibe_data$Group)
Intervention Control
Employed 0 1
Student 21 18
Unemployed 2 3
table(queervibe_data$Disability, queervibe_data$Group)
Intervention Control
Yes 6 5
No 17 17
# Descriptive statistics by Group and Time
## For the variables in the queervibe_long
queervibe_long %>% group_by(Group, Time) %>%
summarise_at(vars(AICS, CORE, CSE, FS, TPIM, RSES, SAMA), list(mean = mean, sd = sd, min = min, max = max)) %>%
as.tibble()
queervibe_data %>% summarise_at(vars(Age), list(mean = mean, sd = sd, min = min, max = max)) %>%
as.tibble()
# For the variables in the queervibe_SSES
queervibe_SSES %>% group_by(Group, Time) %>%
summarise_at(vars(Score), list(mean = mean, sd = sd, min = min, max = max)) %>%
as.tibble()
baselinefiltered <- queervibe_long %>% filter(Time == "Baseline")
t.test(AICS ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: AICS by Group
t = -1.2737, df = 43, p-value = 0.2096
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-11.574081 2.613607
sample estimates:
mean in group Intervention mean in group Control
31.56522 36.04545
t.test(CORE ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: CORE by Group
t = 0.41837, df = 43, p-value = 0.6778
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-12.09510 18.42711
sample estimates:
mean in group Intervention mean in group Control
60.34783 57.18182
t.test(CSE ~ Group, data = baselinefiltered, var.equal = TRUE) # Yes
Two Sample t-test
data: CSE by Group
t = -2.2388, df = 43, p-value = 0.0304
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-9.8570653 -0.5144762
sample estimates:
mean in group Intervention mean in group Control
51.08696 56.27273
t.test(FS ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: FS by Group
t = -0.50995, df = 43, p-value = 0.6127
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-6.403871 3.818890
sample estimates:
mean in group Intervention mean in group Control
35.43478 36.72727
t.test(TPIM ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: TPIM by Group
t = 0.32231, df = 43, p-value = 0.7488
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-8.945261 12.348423
sample estimates:
mean in group Intervention mean in group Control
121.5652 119.8636
t.test(RSES ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: RSES by Group
t = -0.7381, df = 43, p-value = 0.4645
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-4.270736 1.982198
sample estimates:
mean in group Intervention mean in group Control
21.17391 22.31818
t.test(SAMA ~ Group, data = baselinefiltered, var.equal = TRUE) # No
Two Sample t-test
data: SAMA by Group
t = 0.085642, df = 43, p-value = 0.9321
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-4.545230 4.948392
sample estimates:
mean in group Intervention mean in group Control
31.56522 31.36364
t.test(Age ~ Group, data = queervibe_data, var.equal = TRUE)
Two Sample t-test
data: Age by Group
t = 0.72142, df = 43, p-value = 0.4746
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-0.6457884 1.3651560
sample estimates:
mean in group Intervention mean in group Control
18.08696 17.72727
cohen.d(baselinefiltered$AICS, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$AICS, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.2 0.39 0.98
Multivariate (Mahalanobis) distance between groups
[1] 0.39
r equivalent of difference between two means
data
0.19
cohen.d(baselinefiltered$CORE, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$CORE, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.71 -0.13 0.46
Multivariate (Mahalanobis) distance between groups
[1] 0.13
r equivalent of difference between two means
data
-0.06
cohen.d(baselinefiltered$CSE, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$CSE, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] 0.08 0.68 1.28
Multivariate (Mahalanobis) distance between groups
[1] 0.68
r equivalent of difference between two means
data
0.32
cohen.d(baselinefiltered$FS, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$FS, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.43 0.16 0.74
Multivariate (Mahalanobis) distance between groups
[1] 0.16
r equivalent of difference between two means
data
0.08
cohen.d(baselinefiltered$TPIM, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$TPIM, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.68 -0.1 0.49
Multivariate (Mahalanobis) distance between groups
[1] 0.098
r equivalent of difference between two means
data
-0.05
cohen.d(baselinefiltered$RSES, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$RSES, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.36 0.23 0.81
Multivariate (Mahalanobis) distance between groups
[1] 0.23
r equivalent of difference between two means
data
0.11
cohen.d(baselinefiltered$SAMA, baselinefiltered$Group)
Call: cohen.d(x = baselinefiltered$SAMA, group = baselinefiltered$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.61 -0.03 0.56
Multivariate (Mahalanobis) distance between groups
[1] 0.026
r equivalent of difference between two means
data
-0.01
cohen.d(queervibe_data$Age, queervibe_data$Group)
Call: cohen.d(x = queervibe_data$Age, group = queervibe_data$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.81 -0.22 0.37
Multivariate (Mahalanobis) distance between groups
[1] 0.22
r equivalent of difference between two means
data
-0.11
# For SSES
baselinefilteredSSES <- queervibe_SSES %>% filter(Time == "Baseline")
t.test(Score ~ Group, data = baselinefilteredSSES, var.equal = TRUE) # No
Two Sample t-test
data: Score by Group
t = 0.027055, df = 43, p-value = 0.9785
alternative hypothesis: true difference in means between group Intervention and group Control is not equal to 0
95 percent confidence interval:
-8.720233 8.957387
sample estimates:
mean in group Intervention mean in group Control
53.39130 53.27273
cohen.d(baselinefilteredSSES$Score, baselinefilteredSSES$Group)
Call: cohen.d(x = baselinefilteredSSES$Score, group = baselinefilteredSSES$Group)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.59 -0.01 0.58
Multivariate (Mahalanobis) distance between groups
[1] 0.0083
r equivalent of difference between two means
data
0
The below analyis relies on the lme4 package (lmer) function. Summaries for the main and interaction effects are gathered using the Anova function (car). Due to the small sample size, REML and Kenward-Roger estimates were used.
The results of this suggest that there is a significant Time:Group interaction.Examining the estimated marginal means shows that this difference occured between baseline and post test for the intervention group only. No differences were shown for the intervention group when comparing the baseline - follow up, or post test - follow up. No differences were shown for the control group.
lme_sama <- lme4::lmer(SAMA ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA, pairwise comparisons and effect size
Anova(lme_sama, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: SAMA
F Df Df.res Pr(>F)
Time 0.5365 2 86 0.586735
Group 1.3903 1 43 0.244844
Time:Group 6.4748 2 86 0.002402 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
emm_sama <- emmeans(lme_sama, pairwise ~ Time | Group, adjust = "holm")
emm_sama
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 31.6 1.75 56.6 28.1 35.1
Post Intervention 34.9 1.75 56.6 31.4 38.4
Follow Up 33.3 1.75 56.6 29.8 36.9
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 31.4 1.79 56.6 27.8 34.9
Post Intervention 29.0 1.79 56.6 25.5 32.6
Follow Up 31.1 1.79 56.6 27.6 34.7
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention -3.304 1.11 86 -2.985 0.0111
Baseline - Follow Up -1.783 1.11 86 -1.610 0.2221
Post Intervention - Follow Up 1.522 1.11 86 1.374 0.2221
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention 2.318 1.13 86 2.048 0.1309
Baseline - Follow Up 0.227 1.13 86 0.201 0.8414
Post Intervention - Follow Up -2.091 1.13 86 -1.847 0.1364
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 3 tests
eff_size(emm_sama, sigma = sigma(lme_sama), edf = df.residual(lme_sama))
Since 'object' is a list, we are using the contrasts already present.
Group = Intervention:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) -0.8801 0.300 86 -1.4765 -0.2837
(Baseline - Follow Up) -0.4748 0.296 86 -1.0640 0.1144
(Post Intervention - Follow Up) 0.4053 0.296 86 -0.1831 0.9937
Group = Control:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) 0.6174 0.304 86 0.0131 1.2217
(Baseline - Follow Up) 0.0605 0.302 86 -0.5389 0.6600
(Post Intervention - Follow Up) -0.5569 0.304 86 -1.1603 0.0465
sigma used for effect sizes: 3.755
Degrees-of-freedom method: inherited from kenward-roger when re-gridding
Confidence level used: 0.95
# Output as regression
summary(lme_sama)
Linear mixed model fit by REML ['lmerMod']
Formula: SAMA ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 836.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.9781 -0.5900 0.0329 0.5141 2.4128
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 56.28 7.502
Residual 14.10 3.755
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 31.5652 1.7492 18.046
TimePost Intervention 3.3043 1.1072 2.985
TimeFollow Up 1.7826 1.1072 1.610
GroupControl -0.2016 2.5017 -0.081
TimePost Intervention:GroupControl -5.6225 1.5835 -3.551
TimeFollow Up:GroupControl -2.0099 1.5835 -1.269
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.316
TimeFollwUp -0.316 0.500
GroupContrl -0.699 0.221 0.221
TmPIntrv:GC 0.221 -0.699 -0.350 -0.316
TmFlUp:GrpC 0.221 -0.350 -0.699 -0.316 0.500
tab_model(lme_sama)
# Calculate descriptives
#queervibe_long %>% group_by(Group, Time) %>% summarise_at(vars(SAMA), list(Mean = mean, sd = SD))
The results of this suggest no significant main, or interaction effects.
lme_aics <- lme4::lmer(AICS ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA, pairwise comparisons and effect size
Anova(lme_aics, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: AICS
F Df Df.res Pr(>F)
Time 0.1120 2 86 0.8942
Group 0.6574 1 43 0.4219
Time:Group 0.8428 2 86 0.4340
# emmeans(lme_aics, pairwise ~ Time | Group, adjust = "holm") unncessary
# Output as regression
summary(lme_aics)
Linear mixed model fit by REML ['lmerMod']
Formula: AICS ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 943.1
Scaled residuals:
Min 1Q Median 3Q Max
-4.8917 -0.3980 0.0144 0.4560 3.0879
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 115.9 10.765
Residual 33.8 5.814
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 31.565 2.551 12.373
TimePost Intervention 1.609 1.714 0.938
TimeFollow Up 1.652 1.714 0.964
GroupControl 4.480 3.649 1.228
TimePost Intervention:GroupControl -2.154 2.452 -0.879
TimeFollow Up:GroupControl -3.107 2.452 -1.267
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.336
TimeFollwUp -0.336 0.500
GroupContrl -0.699 0.235 0.235
TmPIntrv:GC 0.235 -0.699 -0.350 -0.336
TmFlUp:GrpC 0.235 -0.350 -0.699 -0.336 0.500
tab_model(lme_aics)
The results of this suggest a significant main effect of time and a significant time:group interaction.
lme_core <- lme4::lmer(CORE ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA, pairwise comparisons and effect size
Anova(lme_core, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: CORE
F Df Df.res Pr(>F)
Time 3.2188 2 86 0.044870 *
Group 1.2424 1 43 0.271206
Time:Group 6.5818 2 86 0.002189 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
emm_core <- emmeans(lme_core, pairwise ~ Time | Group, adjust = "holm")
emm_core
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 60.3 4.75 60.9 50.8 69.8
Post Intervention 46.5 4.75 60.9 37.0 56.0
Follow Up 50.0 4.75 60.9 40.5 59.5
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 57.2 4.86 60.9 47.5 66.9
Post Intervention 59.1 4.86 60.9 49.4 68.8
Follow Up 61.3 4.86 60.9 51.6 71.0
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention 13.83 3.37 86 4.100 0.0003
Baseline - Follow Up 10.35 3.37 86 3.068 0.0058
Post Intervention - Follow Up -3.48 3.37 86 -1.031 0.3052
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention -1.95 3.45 86 -0.567 1.0000
Baseline - Follow Up -4.09 3.45 86 -1.186 0.7162
Post Intervention - Follow Up -2.14 3.45 86 -0.620 1.0000
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 3 tests
eff_size(emm_core, sigma = sigma(lme_core), edf = df.residual(lme_core))
Since 'object' is a list, we are using the contrasts already present.
Group = Intervention:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) 1.209 0.304 86 0.604 1.814
(Baseline - Follow Up) 0.905 0.300 86 0.308 1.502
(Post Intervention - Follow Up) -0.304 0.296 86 -0.892 0.283
Group = Control:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) -0.171 0.302 86 -0.771 0.429
(Baseline - Follow Up) -0.358 0.302 86 -0.959 0.243
(Post Intervention - Follow Up) -0.187 0.302 86 -0.787 0.413
sigma used for effect sizes: 11.44
Degrees-of-freedom method: inherited from kenward-roger when re-gridding
Confidence level used: 0.95
# Output as regression
summary(lme_core)
Linear mixed model fit by REML ['lmerMod']
Formula: CORE ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 1112.1
Scaled residuals:
Min 1Q Median 3Q Max
-2.3816 -0.5154 -0.1033 0.5232 2.2256
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 388.2 19.70
Residual 130.8 11.44
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 60.348 4.750 12.704
TimePost Intervention -13.826 3.372 -4.100
TimeFollow Up -10.348 3.372 -3.068
GroupControl -3.166 6.794 -0.466
TimePost Intervention:GroupControl 15.781 4.823 3.272
TimeFollow Up:GroupControl 14.439 4.823 2.994
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.355
TimeFollwUp -0.355 0.500
GroupContrl -0.699 0.248 0.248
TmPIntrv:GC 0.248 -0.699 -0.350 -0.355
TmFlUp:GrpC 0.248 -0.350 -0.699 -0.355 0.500
tab_model(lme_core)
# Calculate descriptives
#queervibe_long %>% group_by(Group, Time) %>% summarise_at(vars(CORE), list(Mean = mean, sd = SD))
The results of this suggest a significant interaction time:group interaction. However, examining the adjusted emmeans does not suggest any significant differences. Note: this is common and both the intervention and control show similar increases between baseline and post test.
lme_fs <- lme4::lmer(FS ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA, pairwise comparisons and effect size
Anova(lme_fs, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: FS
F Df Df.res Pr(>F)
Time 0.2744 2 86 0.76066
Group 0.4830 1 43 0.49082
Time:Group 4.7585 2 86 0.01096 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
fs_emm <- emmeans(lme_fs, pairwise ~ Time | Group, adjust = "holm")
fs_emm
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 35.4 1.88 62.5 31.7 39.2
Post Intervention 38.4 1.88 62.5 34.7 42.2
Follow Up 37.5 1.88 62.5 33.7 41.2
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 36.7 1.92 62.5 32.9 40.6
Post Intervention 33.6 1.92 62.5 29.8 37.5
Follow Up 35.9 1.92 62.5 32.1 39.8
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention -3.000 1.38 86 -2.172 0.0979
Baseline - Follow Up -2.043 1.38 86 -1.479 0.2854
Post Intervention - Follow Up 0.957 1.38 86 0.692 0.4905
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention 3.091 1.41 86 2.188 0.0940
Baseline - Follow Up 0.818 1.41 86 0.579 0.5639
Post Intervention - Follow Up -2.273 1.41 86 -1.609 0.2225
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 3 tests
eff_size(fs_emm, sigma = sigma(lme_fs), edf = df.residual(lme_fs))
Since 'object' is a list, we are using the contrasts already present.
Group = Intervention:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) -0.640 0.298 86 -1.2321 -0.0488
(Baseline - Follow Up) -0.436 0.296 86 -1.0250 0.1525
(Post Intervention - Follow Up) 0.204 0.295 86 -0.3826 0.7910
Group = Control:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) 0.660 0.304 86 0.0548 1.2648
(Baseline - Follow Up) 0.175 0.302 86 -0.4251 0.7744
(Post Intervention - Follow Up) -0.485 0.303 86 -1.0876 0.1173
sigma used for effect sizes: 4.684
Degrees-of-freedom method: inherited from kenward-roger when re-gridding
Confidence level used: 0.95
# Output as regression
summary(lme_fs)
Linear mixed model fit by REML ['lmerMod']
Formula: FS ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 878.2
Scaled residuals:
Min 1Q Median 3Q Max
-2.51715 -0.48242 0.02973 0.63949 2.25402
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 59.31 7.702
Residual 21.94 4.684
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 35.435 1.880 18.852
TimePost Intervention 3.000 1.381 2.172
TimeFollow Up 2.043 1.381 1.479
GroupControl 1.292 2.688 0.481
TimePost Intervention:GroupControl -6.091 1.976 -3.083
TimeFollow Up:GroupControl -2.862 1.976 -1.449
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.367
TimeFollwUp -0.367 0.500
GroupContrl -0.699 0.257 0.257
TmPIntrv:GC 0.257 -0.699 -0.350 -0.367
TmFlUp:GrpC 0.257 -0.350 -0.699 -0.367 0.500
tab_model(lme_fs)
# Calculate descriptives
#queervibe_long %>% group_by(Group, Time) %>% summarise_at(vars(FS), list(Mean = mean, sd = SD))
The results of this suggest that there is a significant main effect of time, and an interaction between time and group. These differences are shown for the intervention group, with significant increases in self-esteem between baseline and post test and baseline and follow up. No difference between post test and follow up. The control group showed no differences.
lme_rses <- lme4::lmer(RSES ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA and pairwise comparisons
Anova(lme_rses, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: RSES
F Df Df.res Pr(>F)
Time 7.2064 2 86 0.0012779 **
Group 1.0536 1 43 0.3104122
Time:Group 9.4679 2 86 0.0001922 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
rses_emm <- emmeans(lme_rses, pairwise ~ Time | Group, adjust = "holm")
rses_emm
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 21.2 1.18 57.7 18.8 23.5
Post Intervention 25.4 1.18 57.7 23.0 27.7
Follow Up 23.8 1.18 57.7 21.5 26.2
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 22.3 1.20 57.7 19.9 24.7
Post Intervention 22.1 1.20 57.7 19.7 24.5
Follow Up 21.1 1.20 57.7 18.7 23.5
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention -4.217 0.769 86 -5.483 <.0001
Baseline - Follow Up -2.652 0.769 86 -3.448 0.0018
Post Intervention - Follow Up 1.565 0.769 86 2.035 0.0449
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention 0.182 0.786 86 0.231 0.8177
Baseline - Follow Up 1.182 0.786 86 1.503 0.4097
Post Intervention - Follow Up 1.000 0.786 86 1.272 0.4139
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 3 tests
eff_size(rses_emm, sigma = sigma(lme_rses), edf = df.residual(lme_rses))
Since 'object' is a list, we are using the contrasts already present.
Group = Intervention:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) -1.6169 0.312 86 -2.23680 -0.997
(Baseline - Follow Up) -1.0168 0.302 86 -1.61657 -0.417
(Post Intervention - Follow Up) 0.6001 0.297 86 0.00911 1.191
Group = Control:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) 0.0697 0.302 86 -0.52974 0.669
(Baseline - Follow Up) 0.4531 0.303 86 -0.14896 1.055
(Post Intervention - Follow Up) 0.3834 0.302 86 -0.21791 0.985
sigma used for effect sizes: 2.608
Degrees-of-freedom method: inherited from kenward-roger when re-gridding
Confidence level used: 0.95
# Output as regression
summary(lme_rses)
Linear mixed model fit by REML ['lmerMod']
Formula: RSES ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 739.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.98520 -0.48658 -0.01083 0.54138 2.55565
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 25.057 5.006
Residual 6.804 2.608
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 21.1739 1.1770 17.990
TimePost Intervention 4.2174 0.7692 5.483
TimeFollow Up 2.6522 0.7692 3.448
GroupControl 1.1443 1.6833 0.680
TimePost Intervention:GroupControl -4.3992 1.1001 -3.999
TimeFollow Up:GroupControl -3.8340 1.1001 -3.485
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.327
TimeFollwUp -0.327 0.500
GroupContrl -0.699 0.228 0.228
TmPIntrv:GC 0.228 -0.699 -0.350 -0.327
TmFlUp:GrpC 0.228 -0.350 -0.699 -0.327 0.500
tab_model(lme_rses)
# Calculate descriptives
#queervibe_long %>% group_by(Group, Time) %>% summarise_at(vars(RSES), list(Mean = mean, sd = SD))
The results of this suggest a significant interaction effect but the pairwise comparisons are not significant.
lme_cse <- lme4::lmer(CSE ~ Time*Group + (1|PTN), queervibe_long)
# ANOVA
Anova(lme_cse, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: CSE
F Df Df.res Pr(>F)
Time 0.4465 2 86 0.64134
Group 0.4547 1 43 0.50374
Time:Group 4.6371 2 86 0.01223 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
cse_emm <- emmeans(lme_cse, pairwise ~ Time | Group, adjust = "holm")
cse_emm
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 51.1 1.79 70.3 47.5 54.7
Post Intervention 54.3 1.79 70.3 50.7 57.8
Follow Up 54.1 1.79 70.3 50.5 57.7
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 56.3 1.83 70.3 52.6 59.9
Post Intervention 54.7 1.83 70.3 51.0 58.3
Follow Up 53.0 1.83 70.3 49.4 56.6
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention -3.174 1.50 86 -2.111 0.1130
Baseline - Follow Up -3.000 1.50 86 -1.995 0.1130
Post Intervention - Follow Up 0.174 1.50 86 0.116 0.9082
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Post Intervention 1.591 1.54 86 1.035 0.5540
Baseline - Follow Up 3.273 1.54 86 2.129 0.1084
Post Intervention - Follow Up 1.682 1.54 86 1.094 0.5540
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 3 tests
eff_size(cse_emm, sigma = sigma(lme_cse), edf = df.residual(lme_cse))
Since 'object' is a list, we are using the contrasts already present.
Group = Intervention:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) -0.6225 0.297 86 -1.2138 -0.0312
(Baseline - Follow Up) -0.5884 0.297 86 -1.1792 0.0024
(Post Intervention - Follow Up) 0.0341 0.295 86 -0.5521 0.6203
Group = Control:
contrast effect.size SE df lower.CL upper.CL
(Baseline - Post Intervention) 0.3120 0.302 86 -0.2886 0.9127
(Baseline - Follow Up) 0.6419 0.304 86 0.0372 1.2466
(Post Intervention - Follow Up) 0.3299 0.302 86 -0.2709 0.9306
sigma used for effect sizes: 5.099
Degrees-of-freedom method: inherited from kenward-roger when re-gridding
Confidence level used: 0.95
# Output as regression
summary(lme_cse)
Linear mixed model fit by REML ['lmerMod']
Formula: CSE ~ Time * Group + (1 | PTN)
Data: queervibe_long
REML criterion at convergence: 885.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.54665 -0.45160 -0.00223 0.46453 1.93023
Random effects:
Groups Name Variance Std.Dev.
PTN (Intercept) 47.47 6.890
Residual 26.00 5.099
Number of obs: 135, groups: PTN, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 51.087 1.787 28.584
TimePost Intervention 3.174 1.504 2.111
TimeFollow Up 3.000 1.504 1.995
GroupControl 5.186 2.556 2.029
TimePost Intervention:GroupControl -4.765 2.150 -2.216
TimeFollow Up:GroupControl -6.273 2.150 -2.917
Correlation of Fixed Effects:
(Intr) TmPstI TmFllU GrpCnt TPI:GC
TmPstIntrvn -0.421
TimeFollwUp -0.421 0.500
GroupContrl -0.699 0.294 0.294
TmPIntrv:GC 0.294 -0.699 -0.350 -0.421
TmFlUp:GrpC 0.294 -0.350 -0.699 -0.421 0.500
tab_model(lme_cse)
# Calculate descriptives
#queervibe_long %>% group_by(Group, Time) %>% summarise_at(vars(CSE), list(Mean = mean, sd = SD))
lme_sses <- lme4::lmer(Score ~ Time*Group + (1|PTN), queervibe_SSES)
Anova(lme_sses, type = "II", test.statistic = "F")
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)
Response: Score
F Df Df.res Pr(>F)
Time 2.8262 7 301 0.007246 **
Group 2.4995 1 43 0.121213
Time:Group 2.1653 7 301 0.037170 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
emmeans(lme_sses, pairwise ~ Time | Group, adjust = "holm")
$emmeans
Group = Intervention:
Time emmean SE df lower.CL upper.CL
Baseline 53.4 3.42 69 46.6 60.2
Tutorial One 61.1 3.42 69 54.3 68.0
Tutorial Two 61.7 3.42 69 54.8 68.5
Tutorial Three 66.0 3.42 69 59.1 72.8
Tutorial Four 63.4 3.42 69 56.6 70.2
Tutorial Five 62.0 3.42 69 55.2 68.9
Post Intervention 61.1 3.42 69 54.3 68.0
Follow Up 59.7 3.42 69 52.9 66.6
Group = Control:
Time emmean SE df lower.CL upper.CL
Baseline 53.3 3.50 69 46.3 60.3
Tutorial One 56.6 3.50 69 49.7 63.6
Tutorial Two 55.0 3.50 69 48.1 62.0
Tutorial Three 54.2 3.50 69 47.2 61.2
Tutorial Four 53.5 3.50 69 46.5 60.4
Tutorial Five 54.0 3.50 69 47.0 61.0
Post Intervention 53.0 3.50 69 46.0 59.9
Follow Up 54.0 3.50 69 47.1 61.0
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
$contrasts
Group = Intervention:
contrast estimate SE df t.ratio p.value
Baseline - Tutorial One -7.7391 2.40 301 -3.226 0.0335
Baseline - Tutorial Two -8.2609 2.40 301 -3.443 0.0164
Baseline - Tutorial Three -12.5652 2.40 301 -5.238 <.0001
Baseline - Tutorial Four -10.0000 2.40 301 -4.168 0.0011
Baseline - Tutorial Five -8.6522 2.40 301 -3.606 0.0094
Baseline - Post Intervention -7.7391 2.40 301 -3.226 0.0335
Baseline - Follow Up -6.3478 2.40 301 -2.646 0.1886
Tutorial One - Tutorial Two -0.5217 2.40 301 -0.217 1.0000
Tutorial One - Tutorial Three -4.8261 2.40 301 -2.012 0.9030
Tutorial One - Tutorial Four -2.2609 2.40 301 -0.942 1.0000
Tutorial One - Tutorial Five -0.9130 2.40 301 -0.381 1.0000
Tutorial One - Post Intervention 0.0000 2.40 301 0.000 1.0000
Tutorial One - Follow Up 1.3913 2.40 301 0.580 1.0000
Tutorial Two - Tutorial Three -4.3043 2.40 301 -1.794 1.0000
Tutorial Two - Tutorial Four -1.7391 2.40 301 -0.725 1.0000
Tutorial Two - Tutorial Five -0.3913 2.40 301 -0.163 1.0000
Tutorial Two - Post Intervention 0.5217 2.40 301 0.217 1.0000
Tutorial Two - Follow Up 1.9130 2.40 301 0.797 1.0000
Tutorial Three - Tutorial Four 2.5652 2.40 301 1.069 1.0000
Tutorial Three - Tutorial Five 3.9130 2.40 301 1.631 1.0000
Tutorial Three - Post Intervention 4.8261 2.40 301 2.012 0.9030
Tutorial Three - Follow Up 6.2174 2.40 301 2.592 0.2104
Tutorial Four - Tutorial Five 1.3478 2.40 301 0.562 1.0000
Tutorial Four - Post Intervention 2.2609 2.40 301 0.942 1.0000
Tutorial Four - Follow Up 3.6522 2.40 301 1.522 1.0000
Tutorial Five - Post Intervention 0.9130 2.40 301 0.381 1.0000
Tutorial Five - Follow Up 2.3043 2.40 301 0.961 1.0000
Post Intervention - Follow Up 1.3913 2.40 301 0.580 1.0000
Group = Control:
contrast estimate SE df t.ratio p.value
Baseline - Tutorial One -3.3636 2.45 301 -1.371 1.0000
Baseline - Tutorial Two -1.7727 2.45 301 -0.723 1.0000
Baseline - Tutorial Three -0.9091 2.45 301 -0.371 1.0000
Baseline - Tutorial Four -0.1818 2.45 301 -0.074 1.0000
Baseline - Tutorial Five -0.7273 2.45 301 -0.296 1.0000
Baseline - Post Intervention 0.3182 2.45 301 0.130 1.0000
Baseline - Follow Up -0.7727 2.45 301 -0.315 1.0000
Tutorial One - Tutorial Two 1.5909 2.45 301 0.649 1.0000
Tutorial One - Tutorial Three 2.4545 2.45 301 1.001 1.0000
Tutorial One - Tutorial Four 3.1818 2.45 301 1.297 1.0000
Tutorial One - Tutorial Five 2.6364 2.45 301 1.075 1.0000
Tutorial One - Post Intervention 3.6818 2.45 301 1.501 1.0000
Tutorial One - Follow Up 2.5909 2.45 301 1.056 1.0000
Tutorial Two - Tutorial Three 0.8636 2.45 301 0.352 1.0000
Tutorial Two - Tutorial Four 1.5909 2.45 301 0.649 1.0000
Tutorial Two - Tutorial Five 1.0455 2.45 301 0.426 1.0000
Tutorial Two - Post Intervention 2.0909 2.45 301 0.852 1.0000
Tutorial Two - Follow Up 1.0000 2.45 301 0.408 1.0000
Tutorial Three - Tutorial Four 0.7273 2.45 301 0.296 1.0000
Tutorial Three - Tutorial Five 0.1818 2.45 301 0.074 1.0000
Tutorial Three - Post Intervention 1.2273 2.45 301 0.500 1.0000
Tutorial Three - Follow Up 0.1364 2.45 301 0.056 1.0000
Tutorial Four - Tutorial Five -0.5455 2.45 301 -0.222 1.0000
Tutorial Four - Post Intervention 0.5000 2.45 301 0.204 1.0000
Tutorial Four - Follow Up -0.5909 2.45 301 -0.241 1.0000
Tutorial Five - Post Intervention 1.0455 2.45 301 0.426 1.0000
Tutorial Five - Follow Up -0.0455 2.45 301 -0.019 1.0000
Post Intervention - Follow Up -1.0909 2.45 301 -0.445 1.0000
Degrees-of-freedom method: kenward-roger
P value adjustment: holm method for 28 tests
emmip(lme_sses, ~ Time | Group)
# SSES_plot <- emmip(lme_sses, ~ Time | Group, CI = TRUE, CIarg = list(lwd = 1, alpha = 1, color = "black")) +
# theme_classic() +
# scale_linetype_manual(values=c("dashed")) +
# scale_x_discrete(guide = guide_axis(angle = 40)) +
# ylab("Estimated Marginal Mean SSES") +
# xlab("Time of Measurement")
# SSESplot <- ggplot(queervibe_SSES, aes(x = Time, y = Score)) +
# geom_point() +
# facet_wrap(~ Group)
SSESplot <- emmip(lme_sses, ~ Time | Group, CI = TRUE, plotit = FALSE)
SSES_plot1 <- ggplot(SSESplot,
aes(Time, yvar)) +
geom_line(group = "Group") +
geom_errorbar(aes(ymin= LCL, ymax= UCL), width=.2, position=position_dodge(.9)) +
geom_point() +
scale_x_discrete(guide = guide_axis(angle = 40)) +
ylab("Estimated Marginal Mean SSES") +
xlab("Time of Measurement") +
facet_wrap(~ Group) +
theme_classic()
ggsave("Figure2.png", plot = SSES_plot1, width = 30, height = 20, scale = 0.5, unit = "cm")
sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
Matrix products: default
Random number generation:
RNG: L'Ecuyer-CMRG
Normal: Inversion
Sample: Rounding
locale:
[1] LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8 LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C LC_TIME=English_United Kingdom.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sjPlot_2.8.11 car_3.1-0 carData_3.0-5 simr_1.0.6 mixedpower_0.1.0 lme4_1.1-30 Matrix_1.5-1 MVN_5.9 psych_2.2.9 forcats_0.5.2 stringr_1.4.1 dplyr_1.0.10
[13] purrr_0.3.5 readr_2.1.3 tidyr_1.2.1 tibble_3.1.8 ggplot2_3.3.6 tidyverse_1.3.2 devtools_2.4.5 usethis_2.1.6 emmeans_1.8.1-1
loaded via a namespace (and not attached):
[1] readxl_1.4.1 backports_1.4.1 systemfonts_1.0.4 plyr_1.8.7 splines_4.2.1 RLRsim_3.1-8 digest_0.6.29 htmltools_0.5.3 rsconnect_0.8.28 fansi_1.0.3
[11] magrittr_2.0.3 memoise_2.0.1 googlesheets4_1.0.1 tzdb_0.3.0 remotes_2.4.2 modelr_0.1.9 vroom_1.6.0 prettyunits_1.1.1 colorspace_2.0-3 rvest_1.0.3
[21] textshaping_0.3.6 haven_2.5.1 xfun_0.33 callr_3.7.2 crayon_1.5.2 jsonlite_1.8.2 iterators_1.0.14 glue_1.6.2 gtable_0.3.1 gargle_1.2.1
[31] sjstats_0.18.1 sjmisc_2.8.9 pkgbuild_1.3.1 abind_1.4-5 scales_1.2.1 mvtnorm_1.1-3 DBI_1.1.3 ggeffects_1.1.4 miniUI_0.1.1.1 Rcpp_1.0.9
[41] plotrix_3.8-2 xtable_1.8-4 performance_0.10.0 bit_4.0.4 profvis_0.3.7 datawizard_0.6.3 htmlwidgets_1.5.4 httr_1.4.4 ellipsis_0.3.2 farver_2.1.1
[51] urlchecker_1.0.1 pkgconfig_2.0.3 sass_0.4.2 dbplyr_2.2.1 binom_1.1-1.1 utf8_1.2.2 labeling_0.4.2 tidyselect_1.2.0 rlang_1.0.6 later_1.3.0
[61] effectsize_0.8.1 munsell_0.5.0 cellranger_1.1.0 tools_4.2.1 cachem_1.0.6 cli_3.4.1 generics_0.1.3 moments_0.14.1 sjlabelled_1.2.0 broom_1.0.1
[71] evaluate_0.17 fastmap_1.1.0 ragg_1.2.3 yaml_2.3.5 processx_3.7.0 knitr_1.40 bit64_4.0.5 fs_1.5.2 nlme_3.1-157 mime_0.12
[81] xml2_1.3.3 compiler_4.2.1 pbkrtest_0.5.1 rstudioapi_0.14 curl_4.3.3 reprex_2.0.2 bslib_0.4.0 stringi_1.7.8 gsl_2.1-7.1 parameters_0.19.0
[91] ps_1.7.1 lattice_0.20-45 nloptr_2.0.3 vctrs_0.4.2 pillar_1.8.1 lifecycle_1.0.3 jquerylib_0.1.4 estimability_1.4.1 insight_0.18.6 httpuv_1.6.6
[101] R6_2.5.1 promises_1.2.0.1 sessioninfo_1.2.2 boot_1.3-28 energy_1.7-10 MASS_7.3-57 assertthat_0.2.1 pkgload_1.3.0 withr_2.5.0 nortest_1.0-4
[111] mnormt_2.1.1 mgcv_1.8-40 bayestestR_0.13.0 parallel_4.2.1 hms_1.1.2 grid_4.2.1 coda_0.19-4 minqa_1.2.4 rmarkdown_2.17 googledrive_2.0.0
[121] shiny_1.7.2 lubridate_1.8.0