##
## Attaching package: 'olsrr'
## The following object is masked from 'package:datasets':
##
## rivers
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
## Loading required package: ggplot2
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
##
## format.pval, units
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:Hmisc':
##
## src, summarize
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##
## Attaching package: 'reshape'
## The following object is masked from 'package:dplyr':
##
## rename
##
## Attaching package: 'tidyr'
## The following objects are masked from 'package:reshape':
##
## expand, smiths
## The following object is masked from 'package:mice':
##
## complete
##
## Attaching package: 'psych'
## The following object is masked from 'package:Hmisc':
##
## describe
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
##
## Attaching package: 'matrixStats'
## The following object is masked from 'package:dplyr':
##
## count
##
## Attaching package: 'e1071'
## The following object is masked from 'package:Hmisc':
##
## impute
## corrplot 0.84 loaded
## -------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## -------------------------------------------------------------------------
##
## Attaching package: 'plyr'
## The following object is masked from 'package:purrr':
##
## compact
## The following object is masked from 'package:matrixStats':
##
## count
## The following objects are masked from 'package:reshape':
##
## rename, round_any
## The following objects are masked from 'package:dplyr':
##
## arrange, count, desc, failwith, id, mutate, rename, summarise,
## summarize
## The following objects are masked from 'package:Hmisc':
##
## is.discrete, summarize
##
## Please cite as:
## Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
## R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
## Warning in checkMatrixPackageVersion(): Package version inconsistency detected.
## TMB was built with Matrix version 1.2.14
## Current Matrix version is 1.2.12
## Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
## Install package "strengejacke" from GitHub (`devtools::install_github("strengejacke/strengejacke")`) to load all sj-packages at once!
m.ptq2 <- lm(all_70$ptq_total ~ scale(all_70$NA_R_Mean))
summary(m.ptq2)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.747 -7.743 -1.659 5.664 32.574
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9489 22.196 < 2e-16 ***
## scale(all_70$NA_R_Mean) 3.5880 0.9526 3.767 0.000251 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.82 on 128 degrees of freedom
## Multiple R-squared: 0.09978, Adjusted R-squared: 0.09275
## F-statistic: 14.19 on 1 and 128 DF, p-value: 0.0002513
confint(m.ptq2, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.183978 22.939099
## scale(all_70$NA_R_Mean) 1.703132 5.472779
summary(influence.measures(m.ptq2))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_Mean)) :
##
## dfb.1_ dfb.s(_7 dffit cov.r cook.d hat
## 1 -0.10 0.26 -0.28 1.06_* 0.04 0.06_*
## 14 0.24 0.12 0.27 0.91_* 0.04 0.01
## 29 0.25 -0.38 0.46_* 0.92_* 0.10 0.03
## 33 0.01 -0.02 0.02 1.05_* 0.00 0.03
## 47 -0.01 0.02 -0.02 1.07_* 0.00 0.05_*
## 49 0.01 0.02 0.03 1.06_* 0.00 0.04
## 76 0.20 -0.14 0.25 0.95_* 0.03 0.01
## 108 0.03 0.05 0.06 1.05_* 0.00 0.03
## 110 0.00 0.01 -0.01 1.09_* 0.00 0.06_*
## 113 0.28 0.18 0.33 0.89_* 0.05 0.01
## 120 0.04 -0.07 0.08 1.05_* 0.00 0.03
ggplot(all_70, aes(x=all_70$NA_R_Mean, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#000066", method= "lm") +
annotate("rect", xmin = 57, xmax =63, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=60, y=65, label = "R^2 == 0.1", parse=T, colour="black") +
annotate("text", x=60, y=60, label = "beta == 3.59", parse=T) +
labs(x = "Mean NA", y = "RNT",
title = "Relationship Between Mean NA and Repetitive Negative Thinking") +
theme_classic()
ggsave("NA_Mean.jpeg")
## Saving 7 x 5 in image
m.ptq2_rr <- lm(all_70$ptq_total ~ scale(all_70$NA_R_Mean) + all_70$nd_resprate)
summary(m.ptq2_rr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_Mean) + all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.114 -7.562 -1.932 5.749 30.553
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.457 9.599 0.881 0.379985
## scale(all_70$NA_R_Mean) 3.614 0.950 3.804 0.000221 ***
## all_70$nd_resprate 15.112 11.452 1.320 0.189335
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.79 on 127 degrees of freedom
## Multiple R-squared: 0.112, Adjusted R-squared: 0.09797
## F-statistic: 8.005 on 2 and 127 DF, p-value: 0.0005316
confint(m.ptq2_rr, level=0.95)
## 2.5 % 97.5 %
## (Intercept) -10.537766 27.45070
## scale(all_70$NA_R_Mean) 1.733533 5.49337
## all_70$nd_resprate -7.548934 37.77287
summary(influence.measures(m.ptq2_rr))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_Mean) + all_70$nd_resprate) :
##
## dfb.1_ dfb.s(_7 dfb.a_70 dffit cov.r cook.d hat
## 14 -0.09 0.12 0.11 0.29 0.87_* 0.03 0.01
## 29 0.27 -0.41 -0.24 0.54_* 0.86_* 0.09 0.03
## 47 0.00 0.01 0.00 -0.01 1.08_* 0.00 0.05
## 49 0.01 0.04 -0.01 0.04 1.07_* 0.00 0.05
## 76 0.21 -0.15 -0.19 0.32 0.91_* 0.03 0.02
## 103 0.03 0.20 -0.01 0.28 0.93_* 0.03 0.02
## 110 0.02 0.05 -0.02 -0.05 1.11_* 0.00 0.08_*
## 113 -0.41 0.18 0.44 0.54_* 0.86_* 0.09 0.03
m.ptq4 <- lm(all_70$ptq_total ~ scale(all_70$PA_R_Mean))
summary(m.ptq4)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.444 -8.290 -1.089 6.398 34.960
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9830 21.425 <2e-16 ***
## scale(all_70$PA_R_Mean) -2.0907 0.9868 -2.119 0.0361 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.21 on 128 degrees of freedom
## Multiple R-squared: 0.03388, Adjusted R-squared: 0.02633
## F-statistic: 4.488 on 1 and 128 DF, p-value: 0.03606
confint(m.ptq4, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.116468 23.0066092
## scale(all_70$PA_R_Mean) -4.043258 -0.1380677
summary(influence.measures(m.ptq4))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_Mean)) :
##
## dfb.1_ dfb.s(_7 dffit cov.r cook.d hat
## 1 -0.12 -0.44 -0.46_* 1.12_* 0.10 0.12_*
## 3 0.00 -0.01 -0.01 1.07_* 0.00 0.05_*
## 9 -0.02 -0.05 -0.05 1.05_* 0.00 0.04
## 14 0.27 0.20 0.33 0.90_* 0.05 0.01
## 70 0.19 0.12 0.23 0.95_* 0.03 0.01
## 76 0.22 0.43 0.48_* 0.97 0.11 0.04
## 85 0.16 -0.35 0.38_* 1.01 0.07 0.04
## 103 0.23 0.12 0.25 0.93_* 0.03 0.01
## 113 0.29 0.00 0.29 0.87_* 0.04 0.01
ggplot(all_70, aes(x=all_70$PA_R_Mean, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#66CCCC", method= "lm") +
annotate("rect", xmin = 81, xmax = 89, ymin = 42, ymax = 53, fill = "white", colour="black") +
annotate("text", x=85, y=50, label = "R^2 == 0.03", parse=T, colour="black") +
annotate("text", x=85, y=45, label = "beta == -2.09", parse=T) +
labs(x = "Mean PA", y = "RNT",
title = "Relationship Between Mean PA and Repetitive Negative Thinking") +
theme_classic()
ggsave("Mean_PA.png")
## Saving 7 x 5 in image
m.ptq4_rr <- lm(all_70$ptq_total ~ scale(all_70$PA_R_Mean)+ all_70$nd_resprate)
summary(m.ptq4_rr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_Mean) + all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -19.271 -8.249 -1.308 6.211 32.740
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.4890 9.9663 0.751 0.4538
## scale(all_70$PA_R_Mean) -2.1950 0.9864 -2.225 0.0278 *
## all_70$nd_resprate 16.2718 11.8906 1.368 0.1736
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.17 on 127 degrees of freedom
## Multiple R-squared: 0.04792, Adjusted R-squared: 0.03292
## F-statistic: 3.196 on 2 and 127 DF, p-value: 0.04424
confint(m.ptq4_rr, level=0.95)
## 2.5 % 97.5 %
## (Intercept) -12.232566 27.210639
## scale(all_70$PA_R_Mean) -4.146989 -0.243066
## all_70$nd_resprate -7.257523 39.801119
summary(influence.measures(m.ptq4_rr))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_Mean) + all_70$nd_resprate) :
##
## dfb.1_ dfb.s(_7 dfb.a_70 dffit cov.r cook.d hat
## 1 0.01 -0.45 -0.02 -0.47_* 1.11_* 0.07 0.12_*
## 3 0.01 0.02 -0.01 0.02 1.08_* 0.00 0.06
## 9 -0.01 -0.02 0.01 -0.02 1.08_* 0.00 0.05
## 14 -0.08 0.19 0.11 0.34 0.85_* 0.04 0.01
## 70 -0.05 0.12 0.07 0.24 0.93_* 0.02 0.01
## 76 0.26 0.48 -0.24 0.57_* 0.92_* 0.10 0.05
## 85 0.24 -0.37 -0.23 0.48_* 0.99 0.08 0.06
## 103 0.05 0.12 -0.02 0.26 0.89_* 0.02 0.01
## 113 -0.42 -0.03 0.45 0.53_* 0.85_* 0.09 0.03
## 117 0.09 0.07 -0.10 -0.13 1.08_* 0.01 0.06
m.ptq1 <- lm(all_70$ptq_total ~ scale(all_70$NA_R_MSSD))
summary(m.ptq1)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -23.179 -7.240 -1.697 6.414 28.056
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9580 21.985 < 2e-16 ***
## scale(all_70$NA_R_MSSD) 3.2613 0.9617 3.391 0.000926 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.92 on 128 degrees of freedom
## Multiple R-squared: 0.08244, Adjusted R-squared: 0.07527
## F-statistic: 11.5 on 1 and 128 DF, p-value: 0.000926
confint(m.ptq1, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.165982 22.957095
## scale(all_70$NA_R_MSSD) 1.358433 5.164213
summary(influence.measures(m.ptq1))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD)) :
##
## dfb.1_ dfb.s(_7 dffit cov.r cook.d hat
## 8 0.04 0.09 0.10 1.06_* 0.00 0.05_*
## 14 0.22 0.32 0.39_* 0.95_* 0.07 0.02
## 19 0.22 -0.21 0.30 0.94_* 0.04 0.01
## 29 0.21 -0.08 0.22 0.94_* 0.02 0.01
## 85 0.22 -0.15 0.26 0.94_* 0.03 0.01
## 87 -0.04 -0.11 -0.12 1.09_* 0.01 0.07_*
## 103 0.23 -0.03 0.23 0.92_* 0.03 0.01
## 106 0.01 0.04 0.04 1.10_* 0.00 0.07_*
## 113 0.24 0.51 0.56_* 0.95_* 0.15 0.04
## 118 -0.11 -0.38 -0.40_* 1.10_* 0.08 0.10_*
## 122 -0.03 -0.07 -0.08 1.06_* 0.00 0.04
## 123 -0.01 -0.01 -0.02 1.06_* 0.00 0.04
## 124 -0.09 -0.29 -0.31 1.09_* 0.05 0.09_*
m.ptq1rr <- lm(all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + all_70$nd_resprate)
summary(m.ptq1rr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -23.843 -7.271 -1.550 6.253 27.615
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.1029 10.0620 1.700 0.09163 .
## scale(all_70$NA_R_MSSD) 3.1634 0.9962 3.176 0.00188 **
## all_70$nd_resprate 4.7460 12.0079 0.395 0.69333
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.96 on 127 degrees of freedom
## Multiple R-squared: 0.08357, Adjusted R-squared: 0.06913
## F-statistic: 5.79 on 2 and 127 DF, p-value: 0.003921
ggplot(all_70, aes(x=all_70$NA_R_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#000066", method= "lm", linetype = 2) +
annotate("rect", xmin = 50, xmax =180, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=120, y=65, label = "R^2 == 0.08", parse=T, colour="black") +
annotate("text", x=120, y=60, label = "beta == 3.26", parse=T) +
labs(x = "NA MSSD", y = "RNT",
title = "Relationship Between NA Instability and Repetitive Negative Thinking") +
theme_classic()
ggsave("NAMSSD.png")
## Saving 7 x 5 in image
m.ptq3 <- lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD))
summary(m.ptq3)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.768 -8.175 -0.772 6.137 32.119
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9829 21.427 <2e-16 ***
## scale(all_70$PA_R_MSSD) 2.0960 0.9867 2.124 0.0356 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.21 on 128 degrees of freedom
## Multiple R-squared: 0.03405, Adjusted R-squared: 0.0265
## F-statistic: 4.512 on 1 and 128 DF, p-value: 0.03558
confint(m.ptq3, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1166421 23.006435
## scale(all_70$PA_R_MSSD) 0.1435808 4.048421
summary(influence.measures(m.ptq3))
## Potentially influential observations of
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD)) :
##
## dfb.1_ dfb.s(_7 dffit cov.r cook.d hat
## 2 -0.09 -0.29 -0.30 1.10_* 0.04 0.09_*
## 14 0.23 0.31 0.39_* 0.94_* 0.07 0.02
## 29 0.19 0.00 0.19 0.95_* 0.02 0.01
## 76 0.14 0.37 0.40_* 1.05_* 0.08 0.07_*
## 85 0.21 -0.21 0.30 0.95_* 0.04 0.02
## 93 -0.08 -0.20 -0.22 1.07_* 0.02 0.06_*
## 103 0.23 -0.12 0.26 0.93_* 0.03 0.01
## 106 0.04 0.12 0.12 1.11_* 0.01 0.09_*
## 113 0.26 0.36 0.44_* 0.91_* 0.09 0.02
## 118 -0.06 -0.17 -0.18 1.09_* 0.02 0.07_*
## 123 0.01 0.03 0.03 1.06_* 0.00 0.04
## 124 -0.06 -0.21 -0.22 1.12_* 0.03 0.10_*
m.ptq3rr <- lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + all_70$nd_resprate)
summary(m.ptq3rr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.837 -8.040 -1.060 6.011 30.459
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 10.3999 9.9810 1.042 0.2994
## scale(all_70$PA_R_MSSD) 2.0335 0.9879 2.059 0.0416 *
## all_70$nd_resprate 12.7820 11.9079 1.073 0.2851
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.2 on 127 degrees of freedom
## Multiple R-squared: 0.04274, Adjusted R-squared: 0.02766
## F-statistic: 2.835 on 2 and 127 DF, p-value: 0.06245
ggplot(all_70, aes(x=all_70$PA_R_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#66CCCC", method= "lm", linetype = 2) +
annotate("rect", xmin = 50, xmax =180, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=120, y=65, label = "R^2 == 0.03", parse=T, colour="black") +
annotate("text", x=120, y=60, label = "beta == 2.1", parse=T) +
labs(x = "PA MSSD", y = "RNT",
title = "Relationship Between PA Instability and Repetitive Negative Thinking") +
theme_classic()
ggsave("PAMSSD.png")
## Saving 7 x 5 in image
{r} #sjt.lm(m.ptq2, m.ptq4, m.ptq1, m.ptq3, pred.labels = c("Mean NA", "Mean PA", "NA MSSD", "PA MSSD"), depvar.labels = c("RNT Equation 1", "RNT Equation 2", "RNT Equation 3", "RNT Equation 4"), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE) #m.NA_all <- lm(all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean))
summary(m.NA_all)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.577 -7.147 -1.766 5.873 30.421
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9114 23.108 < 2e-16 ***
## scale(all_70$NA_R_MSSD) 3.1371 0.9155 3.426 0.000824 ***
## scale(all_70$NA_R_Mean) 3.4758 0.9155 3.796 0.000226 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.39 on 127 degrees of freedom
## Multiple R-squared: 0.176, Adjusted R-squared: 0.163
## F-statistic: 13.56 on 2 and 127 DF, p-value: 4.6e-06
confint(m.NA_all, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.257983 22.865094
## scale(all_70$NA_R_MSSD) 1.325381 4.948763
## scale(all_70$NA_R_Mean) 1.664123 5.287505
m.NA_allrr <- lm(all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean) + all_70$nd_resprate)
summary(m.NA_allrr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean) +
## all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.139 -7.193 -1.671 5.652 30.840
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 16.0096 9.5727 1.672 0.096923 .
## scale(all_70$NA_R_MSSD) 3.0116 0.9481 3.176 0.001876 **
## scale(all_70$NA_R_Mean) 3.4905 0.9186 3.800 0.000224 ***
## all_70$nd_resprate 6.0566 11.4241 0.530 0.596934
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.42 on 126 degrees of freedom
## Multiple R-squared: 0.1778, Adjusted R-squared: 0.1582
## F-statistic: 9.082 on 3 and 126 DF, p-value: 1.731e-05
m.NA_interact <- lm(all_70$ptq_total ~ scale(all_70$NA_R_MSSD)*scale(all_70$NA_R_Mean))
summary(m.NA_interact)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NA_R_MSSD) * scale(all_70$NA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.581 -7.200 -1.823 6.034 30.406
##
## Coefficients:
## Estimate Std. Error
## (Intercept) 21.0527 0.9156
## scale(all_70$NA_R_MSSD) 3.1305 0.9194
## scale(all_70$NA_R_Mean) 3.5553 0.9817
## scale(all_70$NA_R_MSSD):scale(all_70$NA_R_Mean) 0.2485 1.0799
## t value Pr(>|t|)
## (Intercept) 22.992 < 2e-16 ***
## scale(all_70$NA_R_MSSD) 3.405 0.000889 ***
## scale(all_70$NA_R_Mean) 3.621 0.000423 ***
## scale(all_70$NA_R_MSSD):scale(all_70$NA_R_Mean) 0.230 0.818397
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.43 on 126 degrees of freedom
## Multiple R-squared: 0.1763, Adjusted R-squared: 0.1567
## F-statistic: 8.99 on 3 and 126 DF, p-value: 1.933e-05
confint(m.NA_interact, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.240681 22.864768
## scale(all_70$NA_R_MSSD) 1.310943 4.949969
## scale(all_70$NA_R_Mean) 1.612471 5.498080
## scale(all_70$NA_R_MSSD):scale(all_70$NA_R_Mean) -1.888626 2.385570
m.PA_all <- lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean))
summary(m.PA_all)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.382 -7.827 -1.544 6.494 31.953
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9670 21.781 <2e-16 ***
## scale(all_70$PA_R_MSSD) 2.2365 0.9726 2.299 0.0231 *
## scale(all_70$PA_R_Mean) -2.2315 0.9726 -2.294 0.0234 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.03 on 127 degrees of freedom
## Multiple R-squared: 0.07249, Adjusted R-squared: 0.05789
## F-statistic: 4.963 on 2 and 127 DF, p-value: 0.008407
confint(m.PA_all, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1481034 22.9749735
## scale(all_70$PA_R_MSSD) 0.3118447 4.1611565
## scale(all_70$PA_R_Mean) -4.1561346 -0.3068228
m.PA_allrr <- lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) + all_70$nd_resprate)
summary(m.PA_allrr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) +
## all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.015 -8.003 -1.080 6.229 30.017
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.6751 9.8279 0.883 0.3791
## scale(all_70$PA_R_MSSD) 2.1697 0.9718 2.233 0.0273 *
## scale(all_70$PA_R_Mean) -2.3225 0.9730 -2.387 0.0185 *
## all_70$nd_resprate 14.8498 11.7256 1.266 0.2077
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11 on 126 degrees of freedom
## Multiple R-squared: 0.08415, Adjusted R-squared: 0.06234
## F-statistic: 3.859 on 3 and 126 DF, p-value: 0.0111
m.PA_interact <- lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD)*scale(all_70$PA_R_Mean))
summary(m.PA_interact)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) * scale(all_70$PA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.768 -7.858 -1.046 6.487 32.359
##
## Coefficients:
## Estimate Std. Error
## (Intercept) 20.9708 0.9638
## scale(all_70$PA_R_MSSD) 1.9852 0.9816
## scale(all_70$PA_R_Mean) -1.9166 0.9894
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) 1.4517 0.9526
## t value Pr(>|t|)
## (Intercept) 21.758 <2e-16 ***
## scale(all_70$PA_R_MSSD) 2.022 0.0452 *
## scale(all_70$PA_R_Mean) -1.937 0.0550 .
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) 1.524 0.1300
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.97 on 126 degrees of freedom
## Multiple R-squared: 0.08928, Adjusted R-squared: 0.0676
## F-statistic: 4.117 on 3 and 126 DF, p-value: 0.00799
vcov(m.PA_interact)
## (Intercept)
## (Intercept) 0.928913388
## scale(all_70$PA_R_MSSD) 0.009814724
## scale(all_70$PA_R_Mean) -0.012294881
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) -0.056692261
## scale(all_70$PA_R_MSSD)
## (Intercept) 0.009814724
## scale(all_70$PA_R_MSSD) 0.963452272
## scale(all_70$PA_R_Mean) -0.093017356
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) -0.157090266
## scale(all_70$PA_R_Mean)
## (Intercept) -0.01229488
## scale(all_70$PA_R_MSSD) -0.09301736
## scale(all_70$PA_R_Mean) 0.97893358
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) 0.19678660
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean)
## (Intercept) -0.05669226
## scale(all_70$PA_R_MSSD) -0.15709027
## scale(all_70$PA_R_Mean) 0.19678660
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) 0.90739206
confint(m.PA_interact, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.06350453 22.87817432
## scale(all_70$PA_R_MSSD) 0.04270942 3.92765054
## scale(all_70$PA_R_Mean) -3.87466466 0.04136481
## scale(all_70$PA_R_MSSD):scale(all_70$PA_R_Mean) -0.43342064 3.33680052
m_all <-lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) + scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean))
summary(m_all)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) +
## scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.191 -7.295 -2.300 6.021 30.214
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.061 0.914 23.044 < 2e-16 ***
## scale(all_70$PA_R_MSSD) -1.557 1.569 -0.992 0.32295
## scale(all_70$PA_R_Mean) -0.534 1.072 -0.498 0.61933
## scale(all_70$NA_R_MSSD) 4.431 1.567 2.828 0.00546 **
## scale(all_70$NA_R_Mean) 3.203 1.071 2.992 0.00334 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.42 on 125 degrees of freedom
## Multiple R-squared: 0.1844, Adjusted R-squared: 0.1583
## F-statistic: 7.067 on 4 and 125 DF, p-value: 3.667e-05
confint(m_all, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.252698 22.870379
## scale(all_70$PA_R_MSSD) -4.663564 1.548730
## scale(all_70$PA_R_Mean) -2.655938 1.587975
## scale(all_70$NA_R_MSSD) 1.329690 7.531886
## scale(all_70$NA_R_Mean) 1.084274 5.321790
m_allrr <-lm(all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) + scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean) + all_70$nd_resprate)
summary(m_allrr)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PA_R_MSSD) + scale(all_70$PA_R_Mean) +
## scale(all_70$NA_R_MSSD) + scale(all_70$NA_R_Mean) + all_70$nd_resprate)
##
## Residuals:
## Min 1Q Median 3Q Max
## -19.954 -7.471 -2.164 5.881 30.395
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.8708 9.9550 1.795 0.07507 .
## scale(all_70$PA_R_MSSD) -1.4230 1.6295 -0.873 0.38420
## scale(all_70$PA_R_Mean) -0.5621 1.0796 -0.521 0.60351
## scale(all_70$NA_R_MSSD) 4.2443 1.6759 2.533 0.01257 *
## scale(all_70$NA_R_Mean) 3.1977 1.0745 2.976 0.00351 **
## all_70$nd_resprate 3.8253 11.8841 0.322 0.74808
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.46 on 124 degrees of freedom
## Multiple R-squared: 0.1851, Adjusted R-squared: 0.1522
## F-statistic: 5.633 on 5 and 124 DF, p-value: 0.0001028
sjt.lm(m.NA_all,m.PA_all, m_all, pred.labels = c(“NA MSSD”, “Mean NA”, “PA MSSD”, “Mean PA”), depvar.labels = c(“RNT Equation 5”, “RNT Equation 6”, “RNT Equation 7”), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE) ###```
## df AIC
## m.ptq1 3 994.5307
## m.ptq2 3 992.0504
## m.ptq3 3 1001.2116
## m.ptq4 3 1001.2349
## m.NA_all 4 982.5559
## m.PA_all 4 997.9322
## m_all 6 985.2131
## df BIC
## m.ptq1 3 1003.133
## m.ptq2 3 1000.653
## m.ptq3 3 1009.814
## m.ptq4 3 1009.838
## m.NA_all 4 994.026
## m.PA_all 4 1009.402
## m_all 6 1002.418
## model df.x AIC df.y BIC
## 1 NA_Mean 3 992.0504 3 1000.653
## 2 NA_Mean&MSSD 4 982.5559 4 994.026
## 3 NA_MSSD 3 994.5307 3 1003.133
## 4 PA_Mean 3 1001.2349 3 1009.838
## 5 PA_Mean&MSSD 4 997.9322 4 1009.402
## 6 PA_MSSD 3 1001.2116 3 1009.814
## 7 PA_NA_Mean&MSSD 6 985.2131 6 1002.418
print(model_fit)
## model df.x AIC BIC log_likelihood
## 1 NA_Mean 3 992.0504 1000.653 -494.2653
## 2 NA_Mean&MSSD 4 982.5559 994.026 -493.0252
## 3 NA_MSSD 3 994.5307 1003.133 -497.6058
## 4 PA_Mean 3 1001.2349 1009.838 -497.6175
## 5 PA_Mean&MSSD 4 997.9322 1009.402 -487.2779
## 6 PA_MSSD 3 1001.2116 1009.814 -494.9661
## 7 PA_NA_Mean&MSSD 6 985.2131 1002.418 -486.6065
## anxious_mean nervous_mean upset_mean sluggish_mean
## anxious_mean 1.00 0.93 0.75 0.63
## nervous_mean 0.93 1.00 0.83 0.63
## upset_mean 0.75 0.83 1.00 0.67
## sluggish_mean 0.63 0.63 0.67 1.00
## irritable_mean 0.76 0.78 0.88 0.77
## content_mean -0.46 -0.44 -0.61 -0.41
## relaxed_mean -0.62 -0.56 -0.47 -0.39
## excited_mean -0.14 -0.08 -0.16 -0.17
## happy_mean -0.39 -0.43 -0.57 -0.41
## attentive_mean -0.17 -0.27 -0.26 -0.49
## irritable_mean content_mean relaxed_mean excited_mean
## anxious_mean 0.76 -0.46 -0.62 -0.14
## nervous_mean 0.78 -0.44 -0.56 -0.08
## upset_mean 0.88 -0.61 -0.47 -0.16
## sluggish_mean 0.77 -0.41 -0.39 -0.17
## irritable_mean 1.00 -0.58 -0.47 -0.21
## content_mean -0.58 1.00 0.71 0.67
## relaxed_mean -0.47 0.71 1.00 0.52
## excited_mean -0.21 0.67 0.52 1.00
## happy_mean -0.52 0.90 0.69 0.74
## attentive_mean -0.33 0.55 0.38 0.58
## happy_mean attentive_mean
## anxious_mean -0.39 -0.17
## nervous_mean -0.43 -0.27
## upset_mean -0.57 -0.26
## sluggish_mean -0.41 -0.49
## irritable_mean -0.52 -0.33
## content_mean 0.90 0.55
## relaxed_mean 0.69 0.38
## excited_mean 0.74 0.58
## happy_mean 1.00 0.56
## attentive_mean 0.56 1.00
##
## n
## anxious_mean nervous_mean upset_mean sluggish_mean
## anxious_mean 130 85 130 85
## nervous_mean 85 85 85 85
## upset_mean 130 85 130 85
## sluggish_mean 85 85 85 85
## irritable_mean 130 85 130 85
## content_mean 130 85 130 85
## relaxed_mean 130 85 130 85
## excited_mean 130 85 130 85
## happy_mean 130 85 130 85
## attentive_mean 130 85 130 85
## irritable_mean content_mean relaxed_mean excited_mean
## anxious_mean 130 130 130 130
## nervous_mean 85 85 85 85
## upset_mean 130 130 130 130
## sluggish_mean 85 85 85 85
## irritable_mean 130 130 130 130
## content_mean 130 130 130 130
## relaxed_mean 130 130 130 130
## excited_mean 130 130 130 130
## happy_mean 130 130 130 130
## attentive_mean 130 130 130 130
## happy_mean attentive_mean
## anxious_mean 130 130
## nervous_mean 85 85
## upset_mean 130 130
## sluggish_mean 85 85
## irritable_mean 130 130
## content_mean 130 130
## relaxed_mean 130 130
## excited_mean 130 130
## happy_mean 130 130
## attentive_mean 130 130
##
## P
## anxious_mean nervous_mean upset_mean sluggish_mean
## anxious_mean 0.0000 0.0000 0.0000
## nervous_mean 0.0000 0.0000 0.0000
## upset_mean 0.0000 0.0000 0.0000
## sluggish_mean 0.0000 0.0000 0.0000
## irritable_mean 0.0000 0.0000 0.0000 0.0000
## content_mean 0.0000 0.0000 0.0000 0.0001
## relaxed_mean 0.0000 0.0000 0.0000 0.0002
## excited_mean 0.1113 0.4690 0.0735 0.1225
## happy_mean 0.0000 0.0000 0.0000 0.0001
## attentive_mean 0.0465 0.0135 0.0033 0.0000
## irritable_mean content_mean relaxed_mean excited_mean
## anxious_mean 0.0000 0.0000 0.0000 0.1113
## nervous_mean 0.0000 0.0000 0.0000 0.4690
## upset_mean 0.0000 0.0000 0.0000 0.0735
## sluggish_mean 0.0000 0.0001 0.0002 0.1225
## irritable_mean 0.0000 0.0000 0.0192
## content_mean 0.0000 0.0000 0.0000
## relaxed_mean 0.0000 0.0000 0.0000
## excited_mean 0.0192 0.0000 0.0000
## happy_mean 0.0000 0.0000 0.0000 0.0000
## attentive_mean 0.0001 0.0000 0.0000 0.0000
## happy_mean attentive_mean
## anxious_mean 0.0000 0.0465
## nervous_mean 0.0000 0.0135
## upset_mean 0.0000 0.0033
## sluggish_mean 0.0001 0.0000
## irritable_mean 0.0000 0.0001
## content_mean 0.0000 0.0000
## relaxed_mean 0.0000 0.0000
## excited_mean 0.0000 0.0000
## happy_mean 0.0000
## attentive_mean 0.0000
## anxious_mssd nervous_mssd upset_mssd sluggish_mssd
## anxious_mssd 1.00 0.43 0.63 0.33
## nervous_mssd 0.43 1.00 0.16 0.77
## upset_mssd 0.63 0.16 1.00 0.09
## sluggish_mssd 0.33 0.77 0.09 1.00
## irritable_mssd 0.70 0.24 0.72 0.25
## content_mssd 0.70 0.23 0.76 0.18
## relaxed_mssd 0.76 0.17 0.66 0.14
## excited_mssd 0.69 0.28 0.67 0.28
## happy_mssd 0.72 0.21 0.71 0.15
## attentive_mssd 0.62 0.35 0.47 0.37
## irritable_mssd content_mssd relaxed_mssd excited_mssd
## anxious_mssd 0.70 0.70 0.76 0.69
## nervous_mssd 0.24 0.23 0.17 0.28
## upset_mssd 0.72 0.76 0.66 0.67
## sluggish_mssd 0.25 0.18 0.14 0.28
## irritable_mssd 1.00 0.68 0.65 0.69
## content_mssd 0.68 1.00 0.68 0.75
## relaxed_mssd 0.65 0.68 1.00 0.72
## excited_mssd 0.69 0.75 0.72 1.00
## happy_mssd 0.69 0.89 0.72 0.76
## attentive_mssd 0.61 0.57 0.55 0.65
## happy_mssd attentive_mssd
## anxious_mssd 0.72 0.62
## nervous_mssd 0.21 0.35
## upset_mssd 0.71 0.47
## sluggish_mssd 0.15 0.37
## irritable_mssd 0.69 0.61
## content_mssd 0.89 0.57
## relaxed_mssd 0.72 0.55
## excited_mssd 0.76 0.65
## happy_mssd 1.00 0.54
## attentive_mssd 0.54 1.00
##
## n= 130
##
##
## P
## anxious_mssd nervous_mssd upset_mssd sluggish_mssd
## anxious_mssd 0.0000 0.0000 0.0002
## nervous_mssd 0.0000 0.0711 0.0000
## upset_mssd 0.0000 0.0711 0.3199
## sluggish_mssd 0.0002 0.0000 0.3199
## irritable_mssd 0.0000 0.0070 0.0000 0.0047
## content_mssd 0.0000 0.0098 0.0000 0.0402
## relaxed_mssd 0.0000 0.0502 0.0000 0.1185
## excited_mssd 0.0000 0.0013 0.0000 0.0014
## happy_mssd 0.0000 0.0141 0.0000 0.0861
## attentive_mssd 0.0000 0.0000 0.0000 0.0000
## irritable_mssd content_mssd relaxed_mssd excited_mssd
## anxious_mssd 0.0000 0.0000 0.0000 0.0000
## nervous_mssd 0.0070 0.0098 0.0502 0.0013
## upset_mssd 0.0000 0.0000 0.0000 0.0000
## sluggish_mssd 0.0047 0.0402 0.1185 0.0014
## irritable_mssd 0.0000 0.0000 0.0000
## content_mssd 0.0000 0.0000 0.0000
## relaxed_mssd 0.0000 0.0000 0.0000
## excited_mssd 0.0000 0.0000 0.0000
## happy_mssd 0.0000 0.0000 0.0000 0.0000
## attentive_mssd 0.0000 0.0000 0.0000 0.0000
## happy_mssd attentive_mssd
## anxious_mssd 0.0000 0.0000
## nervous_mssd 0.0141 0.0000
## upset_mssd 0.0000 0.0000
## sluggish_mssd 0.0861 0.0000
## irritable_mssd 0.0000 0.0000
## content_mssd 0.0000 0.0000
## relaxed_mssd 0.0000 0.0000
## excited_mssd 0.0000 0.0000
## happy_mssd 0.0000
## attentive_mssd 0.0000
means.pca <- prcomp(na.omit(indiv_means),
center = TRUE,
scale = TRUE)
summary(means.pca)
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6 PC7
## Standard deviation 2.4314 1.4561 0.8283 0.66576 0.53048 0.4940 0.38397
## Proportion of Variance 0.5912 0.2120 0.0686 0.04432 0.02814 0.0244 0.01474
## Cumulative Proportion 0.5912 0.8032 0.8718 0.91614 0.94428 0.9687 0.98342
## PC8 PC9 PC10
## Standard deviation 0.27510 0.22331 0.20058
## Proportion of Variance 0.00757 0.00499 0.00402
## Cumulative Proportion 0.99099 0.99598 1.00000
print(means.pca)
## Standard deviations (1, .., p=10):
## [1] 2.4314404 1.4560817 0.8282742 0.6657619 0.5304782 0.4939907 0.3839744
## [8] 0.2750958 0.2233084 0.2005800
##
## Rotation (n x k) = (10 x 10):
## PC1 PC2 PC3 PC4 PC5
## anxious_mean 0.3288094 -0.3162490 0.251999500 -0.37479636 0.14788507
## nervous_mean 0.3291338 -0.3326932 0.224616318 -0.16367606 0.09674457
## upset_mean 0.3428561 -0.2704493 -0.003171761 0.48517546 -0.05170728
## sluggish_mean 0.3018074 -0.2095316 -0.613274781 -0.19606325 0.12240297
## irritable_mean 0.3444031 -0.2761856 -0.178622381 0.26653394 0.12332698
## content_mean -0.3403434 -0.3094750 -0.126066245 -0.31309278 0.21995902
## relaxed_mean -0.3274357 -0.1575449 -0.459800059 0.39729640 0.25862471
## excited_mean -0.2104801 -0.5095268 0.006499109 0.06413939 -0.79977709
## happy_mean -0.3396801 -0.3249538 -0.094695226 -0.32434484 0.11799716
## attentive_mean -0.2712409 -0.3319176 0.491633576 0.35025206 0.40874123
## PC6 PC7 PC8 PC9
## anxious_mean -0.19218768 0.02887847 -0.40139279 -0.26993827
## nervous_mean -0.39526389 0.36301498 0.14659770 0.33977975
## upset_mean -0.16981279 -0.13475205 0.60574012 -0.33361373
## sluggish_mean 0.51781077 0.39352968 0.10012930 -0.04173951
## irritable_mean 0.13240365 -0.62407196 -0.40652534 0.24277066
## content_mean -0.06541904 -0.30833760 0.39282730 0.50463523
## relaxed_mean -0.49586590 0.28915957 -0.30339555 -0.01782858
## excited_mean 0.08903964 0.10741780 -0.14717361 0.09169001
## happy_mean -0.04270792 -0.25431502 0.06987057 -0.61336254
## attentive_mean 0.48210018 0.22359914 -0.04773894 0.01048353
## PC10
## anxious_mean -0.542468427
## nervous_mean 0.519066180
## upset_mean -0.214509289
## sluggish_mean -0.026793660
## irritable_mean 0.236125370
## content_mean -0.343173637
## relaxed_mean -0.099775777
## excited_mean -0.052414976
## happy_mean 0.450928801
## attentive_mean -0.001875378
biplot(means.pca, scale = 0)
screeplot(means.pca)
means.pca.oblique <- principal(indiv_means, nfactors = 1, rotate = "oblimin")
means.pca.oblique
## Principal Components Analysis
## Call: principal(r = indiv_means, nfactors = 1, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## PC1 h2 u2 com
## anxious_mean 0.80 0.64 0.36 1
## nervous_mean 0.81 0.66 0.34 1
## upset_mean 0.85 0.72 0.28 1
## sluggish_mean 0.74 0.55 0.45 1
## irritable_mean 0.85 0.73 0.27 1
## content_mean -0.83 0.68 0.32 1
## relaxed_mean -0.76 0.58 0.42 1
## excited_mean -0.52 0.27 0.73 1
## happy_mean -0.80 0.65 0.35 1
## attentive_mean -0.56 0.32 0.68 1
##
## PC1
## SS loadings 5.81
## Proportion Var 0.58
##
## Mean item complexity = 1
## Test of the hypothesis that 1 component is sufficient.
##
## The root mean square of the residuals (RMSR) is 0.18
## with the empirical chi square 400.19 with prob < 1.5e-63
##
## Fit based upon off diagonal values = 0.89
summary(means.pca.oblique)
##
## Factor analysis with Call: principal(r = indiv_means, nfactors = 1, rotate = "oblimin")
##
## Test of the hypothesis that 1 factor is sufficient.
## The degrees of freedom for the model is 35 and the objective function was 6.67
## The number of observations was 130 with Chi Square = 828.08 with prob < 2.8e-151
##
## The root mean square of the residuals (RMSA) is 0.18
biplot(means.pca.oblique)
means.pca.oblique2 <- principal(indiv_means, nfactors = 2, rotate = "oblimin")
means.pca.oblique2
## Principal Components Analysis
## Call: principal(r = indiv_means, nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 h2 u2 com
## anxious_mean 0.94 0.05 0.85 0.15 1.0
## nervous_mean 0.96 0.06 0.88 0.12 1.0
## upset_mean 0.89 -0.07 0.85 0.15 1.0
## sluggish_mean 0.76 -0.09 0.63 0.37 1.0
## irritable_mean 0.89 -0.08 0.85 0.15 1.0
## content_mean -0.25 0.80 0.85 0.15 1.2
## relaxed_mean -0.36 0.58 0.63 0.37 1.7
## excited_mean 0.25 0.98 0.84 0.16 1.1
## happy_mean -0.18 0.85 0.88 0.12 1.1
## attentive_mean -0.01 0.73 0.54 0.46 1.0
##
## TC1 TC2
## SS loadings 4.41 3.39
## Proportion Var 0.44 0.34
## Cumulative Var 0.44 0.78
## Proportion Explained 0.57 0.43
## Cumulative Proportion 0.57 1.00
##
## With component correlations of
## TC1 TC2
## TC1 1.00 -0.39
## TC2 -0.39 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 2 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.07
## with the empirical chi square 63.32 with prob < 5.9e-05
##
## Fit based upon off diagonal values = 0.98
summary(means.pca.oblique2)
##
## Factor analysis with Call: principal(r = indiv_means, nfactors = 2, rotate = "oblimin")
##
## Test of the hypothesis that 2 factors are sufficient.
## The degrees of freedom for the model is 26 and the objective function was 3.47
## The number of observations was 130 with Chi Square = 428.57 with prob < 1.8e-74
##
## The root mean square of the residuals (RMSA) is 0.07
##
## With component correlations of
## TC1 TC2
## TC1 1.00 -0.39
## TC2 -0.39 1.00
biplot(means.pca.oblique2)
400.19 - 63.32
## [1] 336.87
35 - 26
## [1] 9
means.pca.oblique3 <- principal(indiv_means, nfactors = 3, rotate = "oblimin")
means.pca.oblique3
## Principal Components Analysis
## Call: principal(r = indiv_means, nfactors = 3, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 TC3 h2 u2 com
## anxious_mean 0.91 -0.08 0.20 0.89 0.11 1.1
## nervous_mean 0.94 -0.02 0.10 0.89 0.11 1.0
## upset_mean 0.87 -0.11 -0.01 0.85 0.15 1.0
## sluggish_mean 0.78 0.11 -0.50 0.86 0.14 1.8
## irritable_mean 0.88 -0.05 -0.16 0.87 0.13 1.1
## content_mean -0.21 0.83 0.02 0.88 0.12 1.1
## relaxed_mean -0.31 0.74 -0.27 0.79 0.21 1.6
## excited_mean 0.27 0.93 0.16 0.84 0.16 1.2
## happy_mean -0.15 0.86 0.06 0.89 0.11 1.1
## attentive_mean -0.04 0.43 0.72 0.87 0.13 1.6
##
## TC1 TC2 TC3
## SS loadings 4.28 3.29 1.03
## Proportion Var 0.43 0.33 0.10
## Cumulative Var 0.43 0.76 0.86
## Proportion Explained 0.50 0.38 0.12
## Cumulative Proportion 0.50 0.88 1.00
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 -0.37 -0.09
## TC2 -0.37 1.00 0.23
## TC3 -0.09 0.23 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 3 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.05
## with the empirical chi square 32.61 with prob < 0.019
##
## Fit based upon off diagonal values = 0.99
summary(means.pca.oblique3)
##
## Factor analysis with Call: principal(r = indiv_means, nfactors = 3, rotate = "oblimin")
##
## Test of the hypothesis that 3 factors are sufficient.
## The degrees of freedom for the model is 18 and the objective function was 3.43
## The number of observations was 130 with Chi Square = 421.69 with prob < 2.7e-78
##
## The root mean square of the residuals (RMSA) is 0.05
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 -0.37 -0.09
## TC2 -0.37 1.00 0.23
## TC3 -0.09 0.23 1.00
63.32- 32.61
## [1] 30.71
26- 18
## [1] 8
means.pca.oblique4 <- principal(indiv_means, nfactors = 4, rotate = "oblimin")
means.pca.oblique4
## Principal Components Analysis
## Call: principal(r = indiv_means, nfactors = 4, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC2 TC4 TC1 TC3 h2 u2 com
## anxious_mean 0.11 0.88 0.21 -0.02 0.95 0.054 1.1
## nervous_mean 0.11 0.75 0.33 -0.08 0.92 0.080 1.4
## upset_mean -0.31 0.20 0.78 0.04 0.95 0.051 1.5
## sluggish_mean 0.17 0.22 0.46 -0.63 0.87 0.133 2.3
## irritable_mean -0.18 0.21 0.72 -0.16 0.91 0.085 1.4
## content_mean 0.86 -0.08 -0.24 0.03 0.92 0.077 1.2
## relaxed_mean 0.38 -0.83 0.31 0.01 0.91 0.090 1.7
## excited_mean 0.77 0.01 0.25 0.26 0.84 0.161 1.4
## happy_mean 0.88 -0.03 -0.20 0.07 0.93 0.066 1.1
## attentive_mean 0.18 0.06 0.11 0.90 0.92 0.079 1.1
##
## TC2 TC4 TC1 TC3
## SS loadings 2.74 2.65 2.15 1.58
## Proportion Var 0.27 0.26 0.21 0.16
## Cumulative Var 0.27 0.54 0.75 0.91
## Proportion Explained 0.30 0.29 0.24 0.17
## Cumulative Proportion 0.30 0.59 0.83 1.00
##
## With component correlations of
## TC2 TC4 TC1 TC3
## TC2 1.00 -0.39 -0.05 0.43
## TC4 -0.39 1.00 0.50 -0.31
## TC1 -0.05 0.50 1.00 -0.22
## TC3 0.43 -0.31 -0.22 1.00
##
## Mean item complexity = 1.4
## Test of the hypothesis that 4 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.03
## with the empirical chi square 13.14 with prob < 0.28
##
## Fit based upon off diagonal values = 1
summary(means.pca.oblique4)
##
## Factor analysis with Call: principal(r = indiv_means, nfactors = 4, rotate = "oblimin")
##
## Test of the hypothesis that 4 factors are sufficient.
## The degrees of freedom for the model is 11 and the objective function was 2.51
## The number of observations was 130 with Chi Square = 306.68 with prob < 3.4e-59
##
## The root mean square of the residuals (RMSA) is 0.03
##
## With component correlations of
## TC2 TC4 TC1 TC3
## TC2 1.00 -0.39 -0.05 0.43
## TC4 -0.39 1.00 0.50 -0.31
## TC1 -0.05 0.50 1.00 -0.22
## TC3 0.43 -0.31 -0.22 1.00
biplot(means.pca.oblique4)
32.61 - 12.14
## [1] 20.47
18 - 11
## [1] 7
mssd.pca <- prcomp(na.omit(indiv_mssd),
center = TRUE,
scale. = TRUE)
print(mssd.pca)
## Standard deviations (1, .., p=10):
## [1] 2.4455598 1.2934528 0.7290772 0.6438012 0.6236411 0.5356204 0.5146298
## [8] 0.4596993 0.3939898 0.3049110
##
## Rotation (n x k) = (10 x 10):
## PC1 PC2 PC3 PC4 PC5
## anxious_mssd 0.3569231 -0.05945655 0.01321629 -0.51575911 0.16467356
## nervous_mssd 0.1656344 -0.64493401 0.27739834 -0.09329767 0.01145196
## upset_mssd 0.3314090 0.20580867 0.30245597 0.34235814 0.37757973
## sluggish_mssd 0.1474116 -0.66682435 0.07147702 0.14922888 0.01620386
## irritable_mssd 0.3435385 0.06673242 -0.12127990 0.29809497 0.62389085
## content_mssd 0.3603563 0.14387024 0.27840301 0.21081789 -0.40246077
## relaxed_mssd 0.3403734 0.15147065 -0.07585054 -0.63796964 0.11306095
## excited_mssd 0.3580319 0.04307830 -0.13280154 0.07546866 -0.27012603
## happy_mssd 0.3591847 0.15960798 0.26872465 0.04672888 -0.39894200
## attentive_mssd 0.3044324 -0.13448958 -0.79904153 0.19396020 -0.18385435
## PC6 PC7 PC8 PC9 PC10
## anxious_mssd -0.36188861 0.16966806 -0.17527521 -0.61787096 -0.05945368
## nervous_mssd -0.28486142 -0.20908833 -0.36698550 0.44840908 0.10112816
## upset_mssd -0.05705468 -0.63899608 0.09774287 -0.15500097 -0.22672774
## sluggish_mssd 0.40709173 0.13131860 0.47313229 -0.29552909 -0.10869438
## irritable_mssd 0.04235532 0.53646834 -0.10704544 0.24495285 0.15383752
## content_mssd -0.17610018 0.06987219 0.22820088 -0.09128215 0.68499354
## relaxed_mssd 0.32355544 -0.19474415 0.36032010 0.38661200 0.11725365
## excited_mssd 0.60083319 -0.10495157 -0.61675139 -0.14344187 0.02616069
## happy_mssd -0.11544823 0.34363683 0.08557126 0.25185119 -0.64015184
## attentive_mssd -0.32724534 -0.20549323 0.14185468 0.06320019 -0.07687076
biplot(mssd.pca, scale = 0)
screeplot(mssd.pca)
summary(mssd.pca)
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
## Standard deviation 2.4456 1.2935 0.72908 0.64380 0.62364 0.53562
## Proportion of Variance 0.5981 0.1673 0.05316 0.04145 0.03889 0.02869
## Cumulative Proportion 0.5981 0.7654 0.81853 0.85998 0.89887 0.92756
## PC7 PC8 PC9 PC10
## Standard deviation 0.51463 0.45970 0.39399 0.3049
## Proportion of Variance 0.02648 0.02113 0.01552 0.0093
## Cumulative Proportion 0.95405 0.97518 0.99070 1.0000
mssd.pca.oblique <- principal(indiv_mssd, nfactors = 1, rotate = "oblimin")
mssd.pca.oblique
## Principal Components Analysis
## Call: principal(r = indiv_mssd, nfactors = 1, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## PC1 h2 u2 com
## anxious_mssd 0.87 0.76 0.24 1
## nervous_mssd 0.41 0.16 0.84 1
## upset_mssd 0.81 0.66 0.34 1
## sluggish_mssd 0.36 0.13 0.87 1
## irritable_mssd 0.84 0.71 0.29 1
## content_mssd 0.88 0.78 0.22 1
## relaxed_mssd 0.83 0.69 0.31 1
## excited_mssd 0.88 0.77 0.23 1
## happy_mssd 0.88 0.77 0.23 1
## attentive_mssd 0.74 0.55 0.45 1
##
## PC1
## SS loadings 5.98
## Proportion Var 0.60
##
## Mean item complexity = 1
## Test of the hypothesis that 1 component is sufficient.
##
## The root mean square of the residuals (RMSR) is 0.13
## with the empirical chi square 190.88 with prob < 2.3e-23
##
## Fit based upon off diagonal values = 0.95
summary(mssd.pca.oblique)
##
## Factor analysis with Call: principal(r = indiv_mssd, nfactors = 1, rotate = "oblimin")
##
## Test of the hypothesis that 1 factor is sufficient.
## The degrees of freedom for the model is 35 and the objective function was 1.94
## The number of observations was 130 with Chi Square = 240.84 with prob < 1.5e-32
##
## The root mean square of the residuals (RMSA) is 0.13
biplot(mssd.pca.oblique)
mssd.pca.oblique2 <- principal(indiv_mssd, nfactors = 2, rotate = "oblimin")
mssd.pca.oblique2
## Principal Components Analysis
## Call: principal(r = indiv_mssd, nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 h2 u2 com
## anxious_mssd 0.79 0.22 0.77 0.23 1.2
## nervous_mssd 0.03 0.92 0.86 0.14 1.0
## upset_mssd 0.88 -0.14 0.73 0.27 1.1
## sluggish_mssd -0.02 0.94 0.87 0.13 1.0
## irritable_mssd 0.83 0.05 0.71 0.29 1.0
## content_mssd 0.91 -0.05 0.81 0.19 1.0
## relaxed_mssd 0.87 -0.07 0.73 0.27 1.0
## excited_mssd 0.85 0.08 0.77 0.23 1.0
## happy_mssd 0.92 -0.07 0.81 0.19 1.0
## attentive_mssd 0.63 0.30 0.58 0.42 1.4
##
## TC1 TC2
## SS loadings 5.70 1.95
## Proportion Var 0.57 0.20
## Cumulative Var 0.57 0.77
## Proportion Explained 0.74 0.26
## Cumulative Proportion 0.74 1.00
##
## With component correlations of
## TC1 TC2
## TC1 1.00 0.26
## TC2 0.26 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 2 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.05
## with the empirical chi square 28.83 with prob < 0.32
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique2)
##
## Factor analysis with Call: principal(r = indiv_mssd, nfactors = 2, rotate = "oblimin")
##
## Test of the hypothesis that 2 factors are sufficient.
## The degrees of freedom for the model is 26 and the objective function was 1.01
## The number of observations was 130 with Chi Square = 125.31 with prob < 5.8e-15
##
## The root mean square of the residuals (RMSA) is 0.05
##
## With component correlations of
## TC1 TC2
## TC1 1.00 0.26
## TC2 0.26 1.00
biplot(mssd.pca.oblique2)
171.71- 30.73
## [1] 140.98
mssd.pca.oblique3 <- principal(indiv_mssd, nfactors = 3, rotate = "oblimin")
mssd.pca.oblique3
## Principal Components Analysis
## Call: principal(r = indiv_mssd, nfactors = 3, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 TC3 h2 u2 com
## anxious_mssd 0.67 0.21 0.19 0.77 0.232 1.4
## nervous_mssd 0.08 0.96 -0.08 0.90 0.099 1.0
## upset_mssd 0.95 -0.05 -0.11 0.78 0.224 1.0
## sluggish_mssd -0.09 0.92 0.10 0.88 0.123 1.0
## irritable_mssd 0.65 0.01 0.29 0.72 0.279 1.4
## content_mssd 0.95 0.03 -0.07 0.85 0.148 1.0
## relaxed_mssd 0.72 -0.09 0.24 0.73 0.266 1.3
## excited_mssd 0.65 0.04 0.31 0.78 0.221 1.4
## happy_mssd 0.95 0.01 -0.06 0.85 0.147 1.0
## attentive_mssd 0.07 0.05 0.90 0.92 0.076 1.0
##
## TC1 TC2 TC3
## SS loadings 4.86 1.87 1.45
## Proportion Var 0.49 0.19 0.15
## Cumulative Var 0.49 0.67 0.82
## Proportion Explained 0.59 0.23 0.18
## Cumulative Proportion 0.59 0.82 1.00
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 0.22 0.56
## TC2 0.22 1.00 0.35
## TC3 0.56 0.35 1.00
##
## Mean item complexity = 1.2
## Test of the hypothesis that 3 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.04
## with the empirical chi square 23.08 with prob < 0.19
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique3)
##
## Factor analysis with Call: principal(r = indiv_mssd, nfactors = 3, rotate = "oblimin")
##
## Test of the hypothesis that 3 factors are sufficient.
## The degrees of freedom for the model is 18 and the objective function was 1.13
## The number of observations was 130 with Chi Square = 138.52 with prob < 1.2e-20
##
## The root mean square of the residuals (RMSA) is 0.04
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 0.22 0.56
## TC2 0.22 1.00 0.35
## TC3 0.56 0.35 1.00
30.73 - 25.44
## [1] 5.29
mssd.pca.oblique4 <- principal(indiv_mssd, nfactors = 4, rotate = "oblimin")
mssd.pca.oblique4
## Principal Components Analysis
## Call: principal(r = indiv_mssd, nfactors = 4, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 TC4 TC3 h2 u2 com
## anxious_mssd 0.10 0.20 0.76 0.06 0.88 0.122 1.2
## nervous_mssd -0.01 0.95 0.11 -0.09 0.90 0.096 1.0
## upset_mssd 0.99 -0.04 -0.08 -0.03 0.82 0.175 1.0
## sluggish_mssd 0.01 0.92 -0.12 0.13 0.89 0.114 1.1
## irritable_mssd 0.65 0.01 -0.01 0.34 0.76 0.242 1.5
## content_mssd 0.89 0.04 0.06 -0.02 0.87 0.129 1.0
## relaxed_mssd 0.04 -0.10 0.90 0.07 0.90 0.097 1.0
## excited_mssd 0.49 0.04 0.21 0.31 0.78 0.219 2.1
## happy_mssd 0.77 0.02 0.22 -0.05 0.85 0.146 1.2
## attentive_mssd 0.01 0.04 0.09 0.90 0.94 0.060 1.0
##
## TC1 TC2 TC4 TC3
## SS loadings 3.46 1.86 1.93 1.35
## Proportion Var 0.35 0.19 0.19 0.14
## Cumulative Var 0.35 0.53 0.72 0.86
## Proportion Explained 0.40 0.22 0.22 0.16
## Cumulative Proportion 0.40 0.62 0.84 1.00
##
## With component correlations of
## TC1 TC2 TC4 TC3
## TC1 1.00 0.19 0.75 0.52
## TC2 0.19 1.00 0.23 0.34
## TC4 0.75 0.23 1.00 0.51
## TC3 0.52 0.34 0.51 1.00
##
## Mean item complexity = 1.2
## Test of the hypothesis that 4 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.04
## with the empirical chi square 20.27 with prob < 0.042
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique4)
##
## Factor analysis with Call: principal(r = indiv_mssd, nfactors = 4, rotate = "oblimin")
##
## Test of the hypothesis that 4 factors are sufficient.
## The degrees of freedom for the model is 11 and the objective function was 1.39
## The number of observations was 130 with Chi Square = 170.39 with prob < 9.8e-31
##
## The root mean square of the residuals (RMSA) is 0.04
##
## With component correlations of
## TC1 TC2 TC4 TC3
## TC1 1.00 0.19 0.75 0.52
## TC2 0.19 1.00 0.23 0.34
## TC4 0.75 0.23 1.00 0.51
## TC3 0.52 0.34 0.51 1.00
md3$convivial <- rowMeans(md3[,c("happy", "content", "excited")], na.rm=T)
convivial <- ddply(md3,.(id), summarize, mean=mean(convivial, na.rm=T), number=length(id))
all4$convivial <- c(convivial$mean)
#reverse coding relaxed
md3$relaxed_rc <- md3$relaxed * -1
md3$anxiety_me <- rowMeans(md3[,c("nervous", "anxious", "relaxed_rc")], na.rm=T)
anxiety_me <- ddply(md3,.(id), summarize, mean=mean(anxiety_me, na.rm=T), number=length(id))
all4$anxiety_me <- c(anxiety_me$mean)
md3$anger <- rowMeans(md3[,c("upset", "irritable")], na.rm=T)
anger<- ddply(md3,.(id), summarize, mean=mean(anger, na.rm=T), number=length(id))
all4$anger <- c(anger$mean)
#reverse coding sluggish
md3$sluggish_rc <- md3$sluggish * -1
md3$sleep <- rowMeans(md3[,c("sluggish_rc", "attentive")], na.rm=T)
sleep <- ddply(md3,.(id), summarize, mean=mean(sleep, na.rm=T), number=length(id))
all4$sleep <- c(sleep$mean)
all4$Convivial_MSSD <- mssd(md3$convivial, group = md3$id, lag = 1, na.rm=T)
all4$Anxiety_MSSD <- mssd(md3$anxiety_me, group = md3$id, lag = 1, na.rm=T)
all4$Anger_MSSD <- mssd(md3$anger, group = md3$id, lag = 1, na.rm=T)
all4$Sleep_MSSD<- mssd(md3$sleep, group = md3$id, lag = 1, na.rm=T)
all_70 <- subset(all4, nd_resprate >= 0.70)
PCA_group<- all_70[c("convivial", "anxiety_me", "anger", "sleep")]
PCA_group <- data.frame(PCA_group)
PCA_group_cor <- cor(PCA_group, y= NULL, use="complete.obs", method = "pearson")
corrplot(PCA_group_cor, type = "upper", order = "hclust",
tl.col = "black")
View(PCA_group_cor)
PCA_group_matrix <- as.matrix(PCA_group)
rcorr(PCA_group_matrix, type="pearson")
## convivial anxiety_me anger sleep
## convivial 1.00 -0.48 -0.50 0.28
## anxiety_me -0.48 1.00 0.60 -0.56
## anger -0.50 0.60 1.00 -0.08
## sleep 0.28 -0.56 -0.08 1.00
##
## n= 130
##
##
## P
## convivial anxiety_me anger sleep
## convivial 0.0000 0.0000 0.0011
## anxiety_me 0.0000 0.0000 0.0000
## anger 0.0000 0.0000 0.3962
## sleep 0.0011 0.0000 0.3962
PCA_group_MSSD<- all_70[c("Convivial_MSSD", "Anxiety_MSSD", "Anger_MSSD", "Sleep_MSSD", "ptq_total")]
PCA_group_MSSD <- data.frame(PCA_group_MSSD)
PCA_group_cor_MSSD <- cor(PCA_group_MSSD, y= NULL, use="complete.obs", method = "pearson")
corrplot(PCA_group_cor_MSSD, type = "upper", order = "hclust",
tl.col = "black")
View(PCA_group_cor_MSSD)
PCA_group_matrix_MSSD <- as.matrix(PCA_group_cor_MSSD)
rcorr(PCA_group_matrix_MSSD, type="pearson")
## Convivial_MSSD Anxiety_MSSD Anger_MSSD Sleep_MSSD ptq_total
## Convivial_MSSD 1.00 0.77 0.86 0.57 -0.86
## Anxiety_MSSD 0.77 1.00 0.70 0.53 -0.83
## Anger_MSSD 0.86 0.70 1.00 0.50 -0.76
## Sleep_MSSD 0.57 0.53 0.50 1.00 -0.88
## ptq_total -0.86 -0.83 -0.76 -0.88 1.00
##
## n= 5
##
##
## P
## Convivial_MSSD Anxiety_MSSD Anger_MSSD Sleep_MSSD ptq_total
## Convivial_MSSD 0.1296 0.0643 0.3205 0.0633
## Anxiety_MSSD 0.1296 0.1905 0.3573 0.0849
## Anger_MSSD 0.0643 0.1905 0.3959 0.1319
## Sleep_MSSD 0.3205 0.3573 0.3959 0.0471
## ptq_total 0.0633 0.0849 0.1319 0.0471
ptq_paa <- lm(all_70$ptq_total ~ scale(all_70$PAA_Mean))
summary(ptq_paa)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PAA_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.547 -8.838 -0.792 6.441 34.679
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9857 21.368 <2e-16 ***
## scale(all_70$PAA_Mean) -1.9231 0.9895 -1.944 0.0541 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.24 on 128 degrees of freedom
## Multiple R-squared: 0.02866, Adjusted R-squared: 0.02108
## F-statistic: 3.777 on 1 and 128 DF, p-value: 0.05415
confint(ptq_paa, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.111227 23.01185029
## scale(all_70$PAA_Mean) -3.880932 0.03478071
ptq_pad <- lm(all_70$ptq_total ~ scale(all_70$PAD_Mean))
summary(ptq_pad)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PAD_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.187 -8.497 -1.647 6.000 35.365
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9839 21.407 <2e-16 ***
## scale(all_70$PAD_Mean) -2.0377 0.9877 -2.063 0.0411 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.22 on 128 degrees of freedom
## Multiple R-squared: 0.03218, Adjusted R-squared: 0.02462
## F-statistic: 4.256 on 1 and 128 DF, p-value: 0.04112
confint(ptq_pad, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.114763 23.00831375
## scale(all_70$PAD_Mean) -3.992027 -0.08341389
ggplot(all_70, aes(x=all_70$PAD_Mean, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#660066", method= "lm", linetype = 2) +
annotate("rect", xmin = 36, xmax =44, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=40, y=65, label = "R^2 == 0.03", parse=T, colour="black") +
annotate("text", x=40, y=60, label = "beta == -2.04", parse=T) +
labs(x = "Mean PAD", y = "RNT",
title = "Relationship Between Mean PAD and Repetitive Negative Thinking") +
theme_classic()
ggsave("PAD_Mean_ptq.png")
## Saving 7 x 5 in image
ptq_naa <- lm(all_70$ptq_total ~ scale(all_70$NAA_Mean))
summary(ptq_naa)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAA_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.010 -7.530 -1.885 5.465 32.211
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9412 22.378 < 2e-16 ***
## scale(all_70$NAA_Mean) 3.8421 0.9448 4.067 8.28e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.73 on 128 degrees of freedom
## Multiple R-squared: 0.1144, Adjusted R-squared: 0.1075
## F-statistic: 16.54 on 1 and 128 DF, p-value: 8.281e-05
confint(ptq_naa, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.199304 22.923773
## scale(all_70$NAA_Mean) 1.972672 5.711549
ggplot(all_70, aes(x=all_70$NAA_Mean, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#CC6600", method= "lm") +
annotate("rect", xmin = 1, xmax =9, ymin = 52, ymax = 63, fill = "white", colour="black") +
annotate("text", x=5, y=60, label = "R^2 == 0.11", parse=T, colour="black") +
annotate("text", x=5, y=55, label = "beta == 3.84", parse=T) +
labs(x = "Mean NAA", y = "RNT",
title = "Relationship Between Mean NAA and Repetitive Negative Thinking") +
theme_classic()
ggsave("NAA_Mean_ptq.png")
## Saving 7 x 5 in image
#removing the 0's so they're not included in analyses
all_70$NAD_Mean[all_70$NAD_Mean == "0"] <- NA
ptq_nad <- lm(all_70$ptq_total ~ scale(all_70$NAD_Mean))
summary(ptq_nad)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAD_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -19.199 -8.879 -1.868 6.472 31.247
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 19.612 1.254 15.634 <2e-16 ***
## scale(all_70$NAD_Mean) 1.731 1.262 1.372 0.174
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.57 on 83 degrees of freedom
## (45 observations deleted due to missingness)
## Multiple R-squared: 0.02218, Adjusted R-squared: 0.0104
## F-statistic: 1.882 on 1 and 83 DF, p-value: 0.1738
confint(ptq_nad, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 17.116677 22.10685
## scale(all_70$NAD_Mean) -0.778551 4.24124
ptq_convi <- lm(all_70$ptq_total ~ scale(all_70$convivial))
summary(ptq_convi)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$convivial))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.454 -8.265 -1.335 6.145 35.036
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9908 21.257 <2e-16 ***
## scale(all_70$convivial) -1.5467 0.9946 -1.555 0.122
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.3 on 128 degrees of freedom
## Multiple R-squared: 0.01854, Adjusted R-squared: 0.01087
## F-statistic: 2.418 on 1 and 128 DF, p-value: 0.1224
confint(ptq_convi, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.101091 23.0219855
## scale(all_70$convivial) -3.514744 0.4213185
ptq_anxiety <- lm(all_70$ptq_total ~ scale(all_70$anxiety_me))
summary(ptq_anxiety)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$anxiety_me))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.847 -8.240 -1.331 6.158 36.260
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9768 21.561 <2e-16 ***
## scale(all_70$anxiety_me) 2.4363 0.9806 2.485 0.0143 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.14 on 128 degrees of freedom
## Multiple R-squared: 0.04601, Adjusted R-squared: 0.03855
## F-statistic: 6.173 on 1 and 128 DF, p-value: 0.01426
confint(ptq_anxiety, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1287154 22.994361
## scale(all_70$anxiety_me) 0.4960288 4.376629
ggplot(all_70, aes(x=all_70$anxiety_me, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#FF3399", method= "lm") +
annotate("rect", xmin = -34, xmax =-26, ymin = 52, ymax = 63, fill = "white", colour="black") +
annotate("text", x=-30, y=60, label = "R^2 == 0.05", parse=T, colour="black") +
annotate("text", x=-30, y=55, label = "beta == 2.44", parse=T) +
labs(x = "Mean Anxiety", y = "RNT",
title = "Relationship Between Mean Anxiety and Repetitive Negative Thinking") +
theme_classic()
ggsave("Mean_Anxiety_ptq.png")
## Saving 7 x 5 in image
ptq_anger <- lm(all_70$ptq_total ~ scale(all_70$anger))
summary(ptq_anger)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$anger))
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.065 -7.877 -1.867 5.058 32.219
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9568 22.012 < 2e-16 ***
## scale(all_70$anger) 3.3048 0.9605 3.441 0.000784 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.91 on 128 degrees of freedom
## Multiple R-squared: 0.08465, Adjusted R-squared: 0.0775
## F-statistic: 11.84 on 1 and 128 DF, p-value: 0.0007843
confint(ptq_anger, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.168270 22.954807
## scale(all_70$anger) 1.404227 5.205413
ggplot(all_70, aes(x=all_70$anger, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#990000", method= "lm") +
annotate("rect", xmin = 6, xmax =14, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=10, y=65, label = "R^2 == 0.09", parse=T, colour="black") +
annotate("text", x=10, y=60, label = "beta == 3.3", parse=T) +
labs(x = "Mean Anger", y = "RNT",
title = "Relationship Between Mean Anger and Repetitive Negative Thinking") +
theme_classic()
ggsave("Mean_Anger_ptq.png")
## Saving 7 x 5 in image
ptq_sleep <- lm(all_70$ptq_total ~ scale(all_70$sleep))
summary(ptq_sleep)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$sleep))
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.647 -7.653 -1.227 5.913 34.272
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9986 21.092 <2e-16 ***
## scale(all_70$sleep) 0.6327 1.0024 0.631 0.529
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.39 on 128 degrees of freedom
## Multiple R-squared: 0.003103, Adjusted R-squared: -0.004686
## F-statistic: 0.3984 on 1 and 128 DF, p-value: 0.5291
confint(ptq_sleep, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.085731 23.037346
## scale(all_70$sleep) -1.350753 2.616148
ptq_pca_all <- lm(all_70$ptq_total ~ scale(all_70$convivial) + scale(all_70$anxiety_me) + scale(all_70$anger) + scale(all_70$sleep))
summary(ptq_pca_all)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$convivial) + scale(all_70$anxiety_me) +
## scale(all_70$anger) + scale(all_70$sleep))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.325 -7.661 -1.778 5.471 32.345
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.061538 0.955592 22.040 <2e-16 ***
## scale(all_70$convivial) 0.001573 1.158151 0.001 0.9989
## scale(all_70$anxiety_me) 2.470290 1.574500 1.569 0.1192
## scale(all_70$anger) 1.996903 1.378864 1.448 0.1501
## scale(all_70$sleep) 2.172571 1.278035 1.700 0.0916 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.9 on 125 degrees of freedom
## Multiple R-squared: 0.1084, Adjusted R-squared: 0.0799
## F-statistic: 3.801 on 4 and 125 DF, p-value: 0.005963
confint(ptq_pca_all, level = 0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1703025 22.952774
## scale(all_70$convivial) -2.2905510 2.293697
## scale(all_70$anxiety_me) -0.6458416 5.586422
## scale(all_70$anger) -0.7320407 4.725846
## scale(all_70$sleep) -0.3568187 4.701960
##sjt.lm(ptq_convi,ptq_anxiety, ptq_anger, ptq_sleep, ptq_pca_all, pred.labels = c("Convivial", "Anxiety", "Anger", "Sleep"), depvar.labels = c("RNT Equation 8.1.2", "RNT Equation 8.2.2", "RNT Equation 8.3.2", "RNT Equation 8.4.2", "RNT Equation 9.2"), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE)
ptq_convi_MSSD <- lm(all_70$ptq_total ~ scale(all_70$Convivial_MSSD))
summary(ptq_convi_MSSD)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$Convivial_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.658 -8.183 -1.012 5.856 31.956
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9838 21.41 <2e-16 ***
## scale(all_70$Convivial_MSSD) 2.0443 0.9876 2.07 0.0405 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.22 on 128 degrees of freedom
## Multiple R-squared: 0.03239, Adjusted R-squared: 0.02483
## F-statistic: 4.285 on 1 and 128 DF, p-value: 0.04046
confint(ptq_convi_MSSD, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.11497363 23.008103
## scale(all_70$Convivial_MSSD) 0.09023862 3.998429
ggplot(all_70, aes(x=all_70$Convivial_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#FFFF00", method= "lm", linetype = 2) +
annotate("rect", xmin = 5, xmax =225, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=120, y=65, label = "R^2 == 0.03", parse=T, colour="black") +
annotate("text", x=120, y=60, label = "beta == 2.04", parse=T) +
labs(x = "Instability of Convivial", y = "RNT",
title = "Relationship Between Instability of Convivial and Repetitive Negative Thinking") +
theme_classic()
ggsave("Convivial_MSSD_ptq.png")
## Saving 7 x 5 in image
ptq_anxiety_MSSD <- lm(all_70$ptq_total ~ scale(all_70$Anxiety_MSSD))
summary(ptq_anxiety_MSSD)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$Anxiety_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.790 -7.666 -1.815 6.124 31.532
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9800 21.491 <2e-16 ***
## scale(all_70$Anxiety_MSSD) 2.2641 0.9838 2.301 0.023 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.17 on 128 degrees of freedom
## Multiple R-squared: 0.03973, Adjusted R-squared: 0.03223
## F-statistic: 5.296 on 1 and 128 DF, p-value: 0.02299
confint(ptq_anxiety_MSSD, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1223679 23.000709
## scale(all_70$Anxiety_MSSD) 0.3173826 4.210727
ggplot(all_70, aes(x=all_70$Anxiety_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#FF3399", method= "lm", linetype = 2) +
annotate("rect", xmin = 5, xmax =225, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=120, y=65, label = "R^2 == 0.04", parse=T, colour="black") +
annotate("text", x=120, y=60, label = "beta == 2.26", parse=T) +
labs(x = "Instability of Anxiety", y = "RNT",
title = "Relationship Between Instability of Anxiety and Repetitive Negative Thinking") +
theme_classic()
ggsave("Anxiety_MSSD_ptq.png")
## Saving 7 x 5 in image
ptq_anger_MSSD <- lm(all_70$ptq_total ~ scale(all_70$Anger_MSSD))
summary(ptq_anger_MSSD)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$Anger_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.363 -7.556 -1.311 6.654 31.074
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9660 21.804 < 2e-16 ***
## scale(all_70$Anger_MSSD) 2.9424 0.9697 3.034 0.00292 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.01 on 128 degrees of freedom
## Multiple R-squared: 0.0671, Adjusted R-squared: 0.05981
## F-statistic: 9.207 on 1 and 128 DF, p-value: 0.002921
confint(ptq_anger_MSSD, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.150206 22.972871
## scale(all_70$Anger_MSSD) 1.023643 4.861096
ggplot(all_70, aes(x=all_70$Anger_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#990000", method= "lm", linetype = 2) +
annotate("rect", xmin = 5, xmax =160, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=80, y=65, label = "R^2 == 0.07", parse=T, colour="black") +
annotate("text", x=80, y=60, label = "beta == 2.94", parse=T) +
labs(x = "Instability of Anger", y = "RNT",
title = "Relationship Between Instability of Anger and Repetitive Negative Thinking") +
theme_classic()
ggsave("Anger_MSSD_ptq.png")
## Saving 7 x 5 in image
ptq_sleep_MSSD <- lm(all_70$ptq_total ~ scale(all_70$Sleep_MSSD))
summary(ptq_sleep_MSSD)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$Sleep_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.689 -7.689 -1.348 6.836 34.470
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9923 21.225 <2e-16 ***
## scale(all_70$Sleep_MSSD) 1.4153 0.9962 1.421 0.158
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.31 on 128 degrees of freedom
## Multiple R-squared: 0.01552, Adjusted R-squared: 0.007833
## F-statistic: 2.018 on 1 and 128 DF, p-value: 0.1578
confint(ptq_sleep_MSSD, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.0980796 23.024997
## scale(all_70$Sleep_MSSD) -0.5558011 3.386308
ggplot(all_70, aes(x=all_70$Sleep_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#336699", method= "lm", linetype = 2) +
annotate("rect", xmin = 5, xmax =250, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=125, y=65, label = "R^2 == 0.02", parse=T, colour="black") +
annotate("text", x=125, y=60, label = "beta == 1.42", parse=T) +
labs(x = "Instability of Sleep", y = "RNT",
title = "Relationship Between Instability of Sleep and Repetitive Negative Thinking") +
theme_classic()
ggsave("Sleep_MSSD_ptq.png")
## Saving 7 x 5 in image
ptq_pca_all_MSSD <- lm(all_70$ptq_total ~ scale(all_70$Convivial_MSSD) + scale(all_70$Anxiety_MSSD) + scale(all_70$Anger_MSSD) + scale(all_70$Sleep_MSSD))
summary(ptq_pca_all_MSSD)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$Convivial_MSSD) +
## scale(all_70$Anxiety_MSSD) + scale(all_70$Anger_MSSD) + scale(all_70$Sleep_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.899 -7.643 -1.705 6.320 30.625
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9748 21.606 <2e-16 ***
## scale(all_70$Convivial_MSSD) -0.9024 1.7504 -0.516 0.6071
## scale(all_70$Anxiety_MSSD) 0.9441 1.5172 0.622 0.5349
## scale(all_70$Anger_MSSD) 3.3577 1.6807 1.998 0.0479 *
## scale(all_70$Sleep_MSSD) -0.6043 1.3090 -0.462 0.6451
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.11 on 125 degrees of freedom
## Multiple R-squared: 0.07222, Adjusted R-squared: 0.04253
## F-statistic: 2.432 on 4 and 125 DF, p-value: 0.05092
confint(ptq_pca_all_MSSD, level = 0.95)
## 2.5 % 97.5 %
## (Intercept) 19.13227167 22.990805
## scale(all_70$Convivial_MSSD) -4.36666477 2.561833
## scale(all_70$Anxiety_MSSD) -2.05870199 3.946927
## scale(all_70$Anger_MSSD) 0.03137876 6.684116
## scale(all_70$Sleep_MSSD) -3.19486033 1.986331
##sjt.lm(ptq_convi_MSSD,ptq_anxiety_MSSD, ptq_anger_MSSD, ptq_sleep_MSSD, ptq_pca_all_MSSD, pred.labels = c("Convivial", "Anxiety", "Anger", "Sleep"), depvar.labels = c("RNT Equation 10.1.2", "RNT Equation 10.2.2", "RNT Equation 10.3.2", "RNT Equation 10.4.2", "RNT Equation 11.2"), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE)
ptq_circumplex_mean <- lm(all_70$ptq_total ~ scale(all_70$NAD_Mean) + scale(all_70$NAA_Mean) + scale(all_70$PAA_Mean) + scale(all_70$PAD_Mean))
summary(ptq_circumplex_mean )
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAD_Mean) + scale(all_70$NAA_Mean) +
## scale(all_70$PAA_Mean) + scale(all_70$PAD_Mean))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.863 -7.844 -1.970 5.664 30.340
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 20.2034 1.2397 16.297 < 2e-16 ***
## scale(all_70$NAD_Mean) -2.2483 1.8806 -1.195 0.23543
## scale(all_70$NAA_Mean) 5.8418 2.1518 2.715 0.00812 **
## scale(all_70$PAA_Mean) -0.6973 2.4022 -0.290 0.77235
## scale(all_70$PAD_Mean) 1.2399 2.6334 0.471 0.63904
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.15 on 80 degrees of freedom
## (45 observations deleted due to missingness)
## Multiple R-squared: 0.1242, Adjusted R-squared: 0.0804
## F-statistic: 2.836 on 4 and 80 DF, p-value: 0.02966
confint(ptq_circumplex_mean, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 17.736327 22.670525
## scale(all_70$NAD_Mean) -5.990817 1.494287
## scale(all_70$NAA_Mean) 1.559493 10.124067
## scale(all_70$PAA_Mean) -5.477855 4.083216
## scale(all_70$PAD_Mean) -4.000707 6.480460
ptq_circumplex_mssd <- lm(all_70$ptq_total ~ scale(all_70$NAD_MSSD) + scale(all_70$NAA_MSSD) + scale(all_70$PAA_MSSD) + scale(all_70$PAD_MSSD))
summary(ptq_circumplex_mssd )
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAD_MSSD) + scale(all_70$NAA_MSSD) +
## scale(all_70$PAA_MSSD) + scale(all_70$PAD_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.357 -7.987 -1.134 6.524 28.349
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9743 21.616 <2e-16 ***
## scale(all_70$NAD_MSSD) -0.4207 1.0546 -0.399 0.6907
## scale(all_70$NAA_MSSD) 3.4846 1.8203 1.914 0.0579 .
## scale(all_70$PAA_MSSD) -1.0960 1.6994 -0.645 0.5201
## scale(all_70$PAD_MSSD) 0.3617 1.8696 0.193 0.8469
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.11 on 125 degrees of freedom
## Multiple R-squared: 0.07312, Adjusted R-squared: 0.04346
## F-statistic: 2.465 on 4 and 125 DF, p-value: 0.04841
confint(ptq_circumplex_mssd, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1332085 22.989868
## scale(all_70$NAD_MSSD) -2.5078784 1.666544
## scale(all_70$NAA_MSSD) -0.1178697 7.087138
## scale(all_70$PAA_MSSD) -4.4593336 2.267289
## scale(all_70$PAD_MSSD) -3.3385834 4.061924
##sjt.lm(ptq_paa,ptq_pad, ptq_naa, ptq_nad, ptq_circumplex_mean, pred.labels = c("PAA", "PAD", "NAA", "NAD"), depvar.labels = c("RNT Equation 8.1", "RNT Equation 8.2", "RNT Equation 8.3", "RNT Equation 8.4", "RNT Equation 9"), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE)
ptq_paa_mssd <- lm(all_70$ptq_total ~ scale(all_70$PAA_MSSD))
summary(ptq_paa_mssd)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PAA_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -20.320 -7.726 -1.028 6.496 33.723
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9897 21.280 <2e-16 ***
## scale(all_70$PAA_MSSD) 1.6320 0.9936 1.643 0.103
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.28 on 128 degrees of freedom
## Multiple R-squared: 0.02064, Adjusted R-squared: 0.01299
## F-statistic: 2.698 on 1 and 128 DF, p-value: 0.1029
confint(ptq_paa_mssd, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.103190 23.019887
## scale(all_70$PAA_MSSD) -0.333974 3.597875
ptq_pad_mssd <- lm(all_70$ptq_total ~ scale(all_70$PAD_MSSD))
summary(ptq_pad_mssd)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$PAD_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.314 -7.909 -1.262 6.052 31.622
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9790 21.514 <2e-16 ***
## scale(all_70$PAD_MSSD) 2.3238 0.9827 2.365 0.0196 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.16 on 128 degrees of freedom
## Multiple R-squared: 0.04185, Adjusted R-squared: 0.03437
## F-statistic: 5.591 on 1 and 128 DF, p-value: 0.01955
confint(ptq_pad_mssd, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.1245142 22.998563
## scale(all_70$PAD_MSSD) 0.3792824 4.268318
ggplot(all_70, aes(x=all_70$PAD_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#660066", method= "lm", linetype = 2) +
annotate("rect", xmin = 5, xmax =225, ymin = 57, ymax = 68, fill = "white", colour="black") +
annotate("text", x=120, y=65, label = "R^2 == 0.04", parse=T, colour="black") +
annotate("text", x=120, y=60, label = "beta == 2.32", parse=T) +
labs(x = "PAD MSSD", y = "RNT",
title = "Relationship Between PAD Instability and Repetitive Negative Thinking") +
theme_classic()
ggsave("PAD_MSSD_ptq.png")
## Saving 7 x 5 in image
ptq_naa_mssd <- lm(all_70$ptq_total ~ scale(all_70$NAA_MSSD))
summary(ptq_naa_mssd)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAA_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.142 -8.364 -1.832 6.380 29.472
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.0615 0.9662 21.798 < 2e-16 ***
## scale(all_70$NAA_MSSD) 2.9313 0.9700 3.022 0.00303 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.02 on 128 degrees of freedom
## Multiple R-squared: 0.0666, Adjusted R-squared: 0.05931
## F-statistic: 9.133 on 1 and 128 DF, p-value: 0.003032
confint(ptq_naa_mssd, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 19.149692 22.973385
## scale(all_70$NAA_MSSD) 1.012104 4.850589
ggplot(all_70, aes(x=all_70$NAA_MSSD, y=all_70$ptq_total)) +
geom_point(shape=1) +
geom_smooth(color= "#CC6600", method= "lm") +
annotate("rect", xmin = 5, xmax =225, ymin = 52, ymax = 63, fill = "white", colour="black") +
annotate("text", x=120, y=60, label = "R^2 == 0.07", parse=T, colour="black") +
annotate("text", x=120, y=55, label = "beta == 2.93", parse=T) +
labs(x = "Instability of NAA", y = "RNT",
title = "Relationship Between NAA Instability and Repetitive Negative Thinking") +
theme_classic()
ggsave("NAA_MSSD_ptq.png")
## Saving 7 x 5 in image
#removing the 0's in the NAD column so they're not included in the analyses
all_70$NAD_MSSD[all_70$NAD_MSSD == "0"] <- NA
ptq_nad_mssd <- lm(all_70$ptq_total ~ scale(all_70$NAD_MSSD))
summary(ptq_nad_mssd)
##
## Call:
## lm(formula = all_70$ptq_total ~ scale(all_70$NAD_MSSD))
##
## Residuals:
## Min 1Q Median 3Q Max
## -18.222 -7.597 -1.832 5.630 30.205
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 19.612 1.256 15.611 <2e-16 ***
## scale(all_70$NAD_MSSD) 1.619 1.264 1.281 0.204
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.58 on 83 degrees of freedom
## (45 observations deleted due to missingness)
## Multiple R-squared: 0.01939, Adjusted R-squared: 0.00758
## F-statistic: 1.642 on 1 and 83 DF, p-value: 0.2037
confint(ptq_nad_mssd, level=0.95)
## 2.5 % 97.5 %
## (Intercept) 17.1131301 22.110399
## scale(all_70$NAD_MSSD) -0.8943593 4.132568
##sjt.lm(ptq_paa_mssd,ptq_pad_mssd, ptq_naa_mssd, ptq_nad_mssd, ptq_circumplex_mssd, pred.labels = c("PAA", "PAD", "NAA", "NAD"), depvar.labels = c("RNT Equation 10.1", "RNT Equation 10.2", "RNT Equation 10.3", "RNT Equation 10.4", "RNT Equation 11"), show.aic = TRUE, show.se= TRUE, group.pred=TRUE, emph.p= TRUE)
indiv_means_noslug <- all_70[c("anxious_mean", "nervous_mean", "upset_mean",
"irritable_mean", "content_mean", "relaxed_mean", "excited_mean",
"happy_mean", "attentive_mean")]
indiv_means_noslug <- data.frame(indiv_means_noslug)
View(indiv_means_noslug)
indiv_means_noslug_cor <- cor(indiv_means_noslug)
means.pca.oblique.2 <- principal(indiv_means_noslug, nfactors = 1, rotate = "oblimin")
means.pca.oblique.2
## Principal Components Analysis
## Call: principal(r = indiv_means_noslug, nfactors = 1, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## PC1 h2 u2 com
## anxious_mean -0.78 0.62 0.38 1
## nervous_mean -0.80 0.64 0.36 1
## upset_mean -0.83 0.69 0.31 1
## irritable_mean -0.82 0.68 0.32 1
## content_mean 0.86 0.74 0.26 1
## relaxed_mean 0.79 0.62 0.38 1
## excited_mean 0.56 0.31 0.69 1
## happy_mean 0.84 0.70 0.30 1
## attentive_mean 0.56 0.31 0.69 1
##
## PC1
## SS loadings 5.31
## Proportion Var 0.59
##
## Mean item complexity = 1
## Test of the hypothesis that 1 component is sufficient.
##
## The root mean square of the residuals (RMSR) is 0.19
## with the empirical chi square 355.01 with prob < 6.7e-59
##
## Fit based upon off diagonal values = 0.88
summary(means.pca.oblique.2)
##
## Factor analysis with Call: principal(r = indiv_means_noslug, nfactors = 1, rotate = "oblimin")
##
## Test of the hypothesis that 1 factor is sufficient.
## The degrees of freedom for the model is 27 and the objective function was 5.74
## The number of observations was 130 with Chi Square = 714.71 with prob < 3.2e-133
##
## The root mean square of the residuals (RMSA) is 0.19
means.pca.oblique2.2 <- principal(indiv_means_noslug, nfactors = 2, rotate = "oblimin")
means.pca.oblique2.2
## Principal Components Analysis
## Call: principal(r = indiv_means_noslug, nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 h2 u2 com
## anxious_mean 0.95 0.04 0.87 0.13 1.0
## nervous_mean 0.97 0.05 0.91 0.09 1.0
## upset_mean 0.89 -0.08 0.85 0.15 1.0
## irritable_mean 0.86 -0.10 0.82 0.18 1.0
## content_mean -0.27 0.79 0.86 0.14 1.2
## relaxed_mean -0.40 0.57 0.65 0.35 1.8
## excited_mean 0.25 0.98 0.83 0.17 1.1
## happy_mean -0.19 0.85 0.88 0.12 1.1
## attentive_mean 0.05 0.76 0.55 0.45 1.0
##
## TC1 TC2
## SS loadings 3.86 3.37
## Proportion Var 0.43 0.37
## Cumulative Var 0.43 0.80
## Proportion Explained 0.53 0.47
## Cumulative Proportion 0.53 1.00
##
## With component correlations of
## TC1 TC2
## TC1 1.00 -0.37
## TC2 -0.37 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 2 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.07
## with the empirical chi square 39.88 with prob < 0.0034
##
## Fit based upon off diagonal values = 0.99
summary(means.pca.oblique2.2)
##
## Factor analysis with Call: principal(r = indiv_means_noslug, nfactors = 2, rotate = "oblimin")
##
## Test of the hypothesis that 2 factors are sufficient.
## The degrees of freedom for the model is 19 and the objective function was 2.49
## The number of observations was 130 with Chi Square = 307.8 with prob < 5e-54
##
## The root mean square of the residuals (RMSA) is 0.07
##
## With component correlations of
## TC1 TC2
## TC1 1.00 -0.37
## TC2 -0.37 1.00
means.pca.oblique3.2 <- principal(indiv_means_noslug, nfactors = 3, rotate = "oblimin")
means.pca.oblique3.2
## Principal Components Analysis
## Call: principal(r = indiv_means_noslug, nfactors = 3, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 TC3 h2 u2 com
## anxious_mean 0.86 -0.14 0.23 0.89 0.106 1.2
## nervous_mean 0.95 0.00 0.06 0.91 0.089 1.0
## upset_mean 0.93 -0.01 -0.12 0.88 0.120 1.0
## irritable_mean 0.92 0.03 -0.21 0.87 0.127 1.1
## content_mean -0.22 0.76 0.15 0.87 0.134 1.3
## relaxed_mean -0.19 0.87 -0.33 0.87 0.134 1.4
## excited_mean 0.28 0.89 0.23 0.84 0.160 1.3
## happy_mean -0.15 0.80 0.17 0.88 0.117 1.2
## attentive_mean -0.15 0.27 0.77 0.85 0.155 1.3
##
## TC1 TC2 TC3
## SS loadings 3.72 3.12 1.02
## Proportion Var 0.41 0.35 0.11
## Cumulative Var 0.41 0.76 0.87
## Proportion Explained 0.47 0.40 0.13
## Cumulative Proportion 0.47 0.87 1.00
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 -0.43 0.00
## TC2 -0.43 1.00 0.31
## TC3 0.00 0.31 1.00
##
## Mean item complexity = 1.2
## Test of the hypothesis that 3 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.06
## with the empirical chi square 29.06 with prob < 0.0039
##
## Fit based upon off diagonal values = 0.99
summary(means.pca.oblique3.2)
##
## Factor analysis with Call: principal(r = indiv_means_noslug, nfactors = 3, rotate = "oblimin")
##
## Test of the hypothesis that 3 factors are sufficient.
## The degrees of freedom for the model is 12 and the objective function was 2.85
## The number of observations was 130 with Chi Square = 350.97 with prob < 8.7e-68
##
## The root mean square of the residuals (RMSA) is 0.06
##
## With component correlations of
## TC1 TC2 TC3
## TC1 1.00 -0.43 0.00
## TC2 -0.43 1.00 0.31
## TC3 0.00 0.31 1.00
means.pca.oblique4.2 <- principal(indiv_means_noslug, nfactors = 4, rotate = "oblimin")
means.pca.oblique4.2
## Principal Components Analysis
## Call: principal(r = indiv_means_noslug, nfactors = 4, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 TC3 TC4 h2 u2 com
## anxious_mean 0.88 0.02 0.01 -0.33 0.95 0.053 1.3
## nervous_mean 0.95 0.11 -0.12 -0.20 0.95 0.047 1.1
## upset_mean 0.88 -0.23 0.06 0.26 0.96 0.045 1.3
## irritable_mean 0.88 -0.13 -0.09 0.23 0.90 0.099 1.2
## content_mean -0.19 0.86 0.03 -0.06 0.92 0.080 1.1
## relaxed_mean -0.23 0.61 -0.04 0.56 0.93 0.072 2.3
## excited_mean 0.31 0.81 0.26 0.11 0.84 0.160 1.6
## happy_mean -0.11 0.90 0.05 -0.06 0.93 0.066 1.0
## attentive_mean -0.07 0.03 0.96 -0.03 0.98 0.015 1.0
##
## TC1 TC2 TC3 TC4
## SS loadings 3.59 2.95 1.18 0.64
## Proportion Var 0.40 0.33 0.13 0.07
## Cumulative Var 0.40 0.73 0.86 0.93
## Proportion Explained 0.43 0.35 0.14 0.08
## Cumulative Proportion 0.43 0.78 0.92 1.00
##
## With component correlations of
## TC1 TC2 TC3 TC4
## TC1 1.00 -0.38 -0.15 -0.14
## TC2 -0.38 1.00 0.50 0.11
## TC3 -0.15 0.50 1.00 0.05
## TC4 -0.14 0.11 0.05 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 4 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.03
## with the empirical chi square 7.63 with prob < 0.27
##
## Fit based upon off diagonal values = 1
summary(means.pca.oblique4.2)
##
## Factor analysis with Call: principal(r = indiv_means_noslug, nfactors = 4, rotate = "oblimin")
##
## Test of the hypothesis that 4 factors are sufficient.
## The degrees of freedom for the model is 6 and the objective function was 1.53
## The number of observations was 130 with Chi Square = 187.09 with prob < 1.1e-37
##
## The root mean square of the residuals (RMSA) is 0.03
##
## With component correlations of
## TC1 TC2 TC3 TC4
## TC1 1.00 -0.38 -0.15 -0.14
## TC2 -0.38 1.00 0.50 0.11
## TC3 -0.15 0.50 1.00 0.05
## TC4 -0.14 0.11 0.05 1.00
means.pca.oblique5.2 <- principal(indiv_means_noslug, nfactors = 5, rotate = "oblimin")
means.pca.oblique5.2
## Principal Components Analysis
## Call: principal(r = indiv_means_noslug, nfactors = 5, rotate = "oblimin")
##
## Warning: A Heywood case was detected.
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC4 TC2 TC3 TC5 h2 u2 com
## anxious_mean 0.84 -0.23 -0.07 0.10 0.31 0.97 0.03064 1.5
## nervous_mean 0.86 -0.18 0.12 -0.10 0.20 0.95 0.04571 1.3
## upset_mean 0.91 0.01 0.04 0.00 -0.28 0.96 0.04348 1.2
## irritable_mean 0.96 0.16 -0.09 -0.07 -0.13 0.91 0.09070 1.1
## content_mean -0.17 0.46 0.22 0.14 0.47 0.94 0.05553 2.9
## relaxed_mean -0.01 0.95 0.03 0.04 0.00 0.96 0.03685 1.0
## excited_mean 0.03 -0.01 1.00 0.03 -0.05 1.00 0.00480 1.0
## happy_mean -0.15 0.38 0.36 0.11 0.42 0.94 0.06136 3.4
## attentive_mean 0.01 -0.01 0.00 1.01 -0.04 1.00 0.00078 1.0
##
## TC1 TC4 TC2 TC3 TC5
## SS loadings 3.49 1.70 1.47 1.22 0.74
## Proportion Var 0.39 0.19 0.16 0.14 0.08
## Cumulative Var 0.39 0.58 0.74 0.88 0.96
## Proportion Explained 0.40 0.20 0.17 0.14 0.09
## Cumulative Proportion 0.40 0.60 0.77 0.91 1.00
##
## With component correlations of
## TC1 TC4 TC2 TC3 TC5
## TC1 1.00 -0.52 -0.16 -0.26 -0.13
## TC4 -0.52 1.00 0.51 0.34 0.04
## TC2 -0.16 0.51 1.00 0.58 0.32
## TC3 -0.26 0.34 0.58 1.00 0.22
## TC5 -0.13 0.04 0.32 0.22 1.00
##
## Mean item complexity = 1.6
## Test of the hypothesis that 5 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.02
## with the empirical chi square 3.22 with prob < 0.073
##
## Fit based upon off diagonal values = 1
summary(means.pca.oblique5.2)
##
## Factor analysis with Call: principal(r = indiv_means_noslug, nfactors = 5, rotate = "oblimin")
##
## Test of the hypothesis that 5 factors are sufficient.
## The degrees of freedom for the model is 1 and the objective function was 1.45
## The number of observations was 130 with Chi Square = 176.73 with prob < 2.5e-40
##
## The root mean square of the residuals (RMSA) is 0.02
##
## With component correlations of
## TC1 TC4 TC2 TC3 TC5
## TC1 1.00 -0.52 -0.16 -0.26 -0.13
## TC4 -0.52 1.00 0.51 0.34 0.04
## TC2 -0.16 0.51 1.00 0.58 0.32
## TC3 -0.26 0.34 0.58 1.00 0.22
## TC5 -0.13 0.04 0.32 0.22 1.00
indiv_mssd_noslug <- all_70[c("anxious_mssd", "nervous_mssd", "upset_mssd",
"irritable_mssd", "content_mssd", "relaxed_mssd", "excited_mssd",
"happy_mssd", "attentive_mssd")]
indiv_mssd_noslug <- data.frame(indiv_mssd_noslug)
mssd.pca.oblique.2 <- principal(indiv_mssd_noslug, nfactors = 1, rotate = "oblimin")
mssd.pca.oblique.2
## Principal Components Analysis
## Call: principal(r = indiv_mssd_noslug, nfactors = 1, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## PC1 h2 u2 com
## anxious_mssd 0.87 0.76 0.24 1
## nervous_mssd 0.36 0.13 0.87 1
## upset_mssd 0.82 0.68 0.32 1
## irritable_mssd 0.84 0.71 0.29 1
## content_mssd 0.89 0.79 0.21 1
## relaxed_mssd 0.84 0.71 0.29 1
## excited_mssd 0.88 0.77 0.23 1
## happy_mssd 0.89 0.79 0.21 1
## attentive_mssd 0.74 0.54 0.46 1
##
## PC1
## SS loadings 5.87
## Proportion Var 0.65
##
## Mean item complexity = 1
## Test of the hypothesis that 1 component is sufficient.
##
## The root mean square of the residuals (RMSR) is 0.07
## with the empirical chi square 47.6 with prob < 0.0085
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique.2)
##
## Factor analysis with Call: principal(r = indiv_mssd_noslug, nfactors = 1, rotate = "oblimin")
##
## Test of the hypothesis that 1 factor is sufficient.
## The degrees of freedom for the model is 27 and the objective function was 0.99
## The number of observations was 130 with Chi Square = 123.28 with prob < 2.9e-14
##
## The root mean square of the residuals (RMSA) is 0.07
biplot(mssd.pca.oblique.2)
mssd.pca.oblique2.2 <- principal(indiv_mssd_noslug, nfactors = 2, rotate = "oblimin")
mssd.pca.oblique2.2
## Principal Components Analysis
## Call: principal(r = indiv_mssd_noslug, nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC2 h2 u2 com
## anxious_mssd 0.76 0.29 0.79 0.212 1.3
## nervous_mssd -0.01 0.96 0.91 0.088 1.0
## upset_mssd 0.89 -0.16 0.74 0.263 1.1
## irritable_mssd 0.83 0.03 0.71 0.286 1.0
## content_mssd 0.92 -0.06 0.82 0.184 1.0
## relaxed_mssd 0.87 -0.05 0.73 0.271 1.0
## excited_mssd 0.85 0.08 0.77 0.231 1.0
## happy_mssd 0.92 -0.07 0.82 0.183 1.0
## attentive_mssd 0.60 0.36 0.61 0.389 1.6
##
## TC1 TC2
## SS loadings 5.66 1.23
## Proportion Var 0.63 0.14
## Cumulative Var 0.63 0.77
## Proportion Explained 0.82 0.18
## Cumulative Proportion 0.82 1.00
##
## With component correlations of
## TC1 TC2
## TC1 1.00 0.28
## TC2 0.28 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 2 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.06
## with the empirical chi square 28.45 with prob < 0.075
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique2.2)
##
## Factor analysis with Call: principal(r = indiv_mssd_noslug, nfactors = 2, rotate = "oblimin")
##
## Test of the hypothesis that 2 factors are sufficient.
## The degrees of freedom for the model is 19 and the objective function was 0.88
## The number of observations was 130 with Chi Square = 109.18 with prob < 1.1e-14
##
## The root mean square of the residuals (RMSA) is 0.06
##
## With component correlations of
## TC1 TC2
## TC1 1.00 0.28
## TC2 0.28 1.00
mssd.pca.oblique3.2 <- principal(indiv_mssd_noslug, nfactors = 3, rotate = "oblimin")
mssd.pca.oblique3.2
## Principal Components Analysis
## Call: principal(r = indiv_mssd_noslug, nfactors = 3, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC3 TC2 h2 u2 com
## anxious_mssd 0.64 0.20 0.27 0.79 0.210 1.6
## nervous_mssd -0.01 0.00 1.00 0.98 0.016 1.0
## upset_mssd 0.95 -0.11 -0.05 0.78 0.223 1.0
## irritable_mssd 0.64 0.31 -0.03 0.72 0.276 1.4
## content_mssd 0.95 -0.07 0.03 0.85 0.147 1.0
## relaxed_mssd 0.72 0.22 -0.07 0.73 0.269 1.2
## excited_mssd 0.65 0.33 0.01 0.78 0.220 1.5
## happy_mssd 0.95 -0.06 0.02 0.85 0.148 1.0
## attentive_mssd 0.03 0.93 0.04 0.93 0.070 1.0
##
## TC1 TC3 TC2
## SS loadings 4.80 1.49 1.13
## Proportion Var 0.53 0.17 0.13
## Cumulative Var 0.53 0.70 0.82
## Proportion Explained 0.65 0.20 0.15
## Cumulative Proportion 0.65 0.85 1.00
##
## With component correlations of
## TC1 TC3 TC2
## TC1 1.00 0.58 0.24
## TC3 0.58 1.00 0.33
## TC2 0.24 0.33 1.00
##
## Mean item complexity = 1.2
## Test of the hypothesis that 3 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.05
## with the empirical chi square 19.46 with prob < 0.078
##
## Fit based upon off diagonal values = 0.99
summary(mssd.pca.oblique3.2)
##
## Factor analysis with Call: principal(r = indiv_mssd_noslug, nfactors = 3, rotate = "oblimin")
##
## Test of the hypothesis that 3 factors are sufficient.
## The degrees of freedom for the model is 12 and the objective function was 0.78
## The number of observations was 130 with Chi Square = 96.6 with prob < 2.6e-15
##
## The root mean square of the residuals (RMSA) is 0.05
##
## With component correlations of
## TC1 TC3 TC2
## TC1 1.00 0.58 0.24
## TC3 0.58 1.00 0.33
## TC2 0.24 0.33 1.00
mssd.pca.oblique4.2 <- principal(indiv_mssd_noslug, nfactors = 4, rotate = "oblimin")
mssd.pca.oblique4.2
## Principal Components Analysis
## Call: principal(r = indiv_mssd_noslug, nfactors = 4, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## TC1 TC4 TC3 TC2 h2 u2 com
## anxious_mssd 0.10 0.72 0.06 0.26 0.88 0.123 1.3
## nervous_mssd 0.00 -0.01 0.01 0.99 0.99 0.014 1.0
## upset_mssd 0.98 -0.08 -0.02 -0.03 0.82 0.178 1.0
## irritable_mssd 0.60 0.02 0.36 -0.02 0.75 0.251 1.6
## content_mssd 0.90 0.04 0.00 0.04 0.88 0.125 1.0
## relaxed_mssd 0.01 0.97 0.02 -0.09 0.93 0.070 1.0
## excited_mssd 0.46 0.23 0.32 0.01 0.78 0.219 2.4
## happy_mssd 0.78 0.20 -0.05 0.03 0.85 0.146 1.1
## attentive_mssd -0.01 0.02 0.96 0.03 0.95 0.048 1.0
##
## TC1 TC4 TC3 TC2
## SS loadings 3.38 1.91 1.43 1.12
## Proportion Var 0.38 0.21 0.16 0.12
## Cumulative Var 0.38 0.59 0.75 0.87
## Proportion Explained 0.43 0.24 0.18 0.14
## Cumulative Proportion 0.43 0.68 0.86 1.00
##
## With component correlations of
## TC1 TC4 TC3 TC2
## TC1 1.00 0.75 0.56 0.21
## TC4 0.75 1.00 0.58 0.25
## TC3 0.56 0.58 1.00 0.34
## TC2 0.21 0.25 0.34 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 4 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.04
## with the empirical chi square 15.87 with prob < 0.014
##
## Fit based upon off diagonal values = 1
summary(mssd.pca.oblique4.2)
##
## Factor analysis with Call: principal(r = indiv_mssd_noslug, nfactors = 4, rotate = "oblimin")
##
## Test of the hypothesis that 4 factors are sufficient.
## The degrees of freedom for the model is 6 and the objective function was 0.99
## The number of observations was 130 with Chi Square = 121.08 with prob < 9.7e-24
##
## The root mean square of the residuals (RMSA) is 0.04
##
## With component correlations of
## TC1 TC4 TC3 TC2
## TC1 1.00 0.75 0.56 0.21
## TC4 0.75 1.00 0.58 0.25
## TC3 0.56 0.58 1.00 0.34
## TC2 0.21 0.25 0.34 1.00
mean.pca.oblimin.2 <- fa(r = indiv_means_noslug, nfactors = 1, rotate = "oblimin")
mean.pca.oblimin.2
## Factor Analysis using method = minres
## Call: fa(r = indiv_means_noslug, nfactors = 1, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR1 h2 u2 com
## anxious_mean -0.75 0.57 0.43 1
## nervous_mean -0.77 0.59 0.41 1
## upset_mean -0.82 0.67 0.33 1
## irritable_mean -0.80 0.65 0.35 1
## content_mean 0.84 0.71 0.29 1
## relaxed_mean 0.75 0.57 0.43 1
## excited_mean 0.50 0.25 0.75 1
## happy_mean 0.81 0.65 0.35 1
## attentive_mean 0.49 0.24 0.76 1
##
## MR1
## SS loadings 4.90
## Proportion Var 0.54
##
## Mean item complexity = 1
## Test of the hypothesis that 1 factor is sufficient.
##
## The degrees of freedom for the null model are 36 and the objective function was 10.62 with Chi Square of 1329.6
## The degrees of freedom for the model are 27 and the objective function was 5.68
##
## The root mean square of the residuals (RMSR) is 0.19
## The df corrected root mean square of the residuals is 0.22
##
## The harmonic number of observations is 117 with the empirical chi square 296.94 with prob < 3e-47
## The total number of observations was 130 with Likelihood Chi Square = 706.98 with prob < 1.3e-131
##
## Tucker Lewis Index of factoring reliability = 0.295
## RMSEA index = 0.45 and the 90 % confidence intervals are 0.414 0.47
## BIC = 575.56
## Fit based upon off diagonal values = 0.89
## Measures of factor score adequacy
## MR1
## Correlation of (regression) scores with factors 0.96
## Multiple R square of scores with factors 0.93
## Minimum correlation of possible factor scores 0.86
mean.pca.oblimin2.2 <- fa(r = indiv_means_noslug, nfactors = 2, rotate = "oblimin")
mean.pca.oblimin2.2
## Factor Analysis using method = minres
## Call: fa(r = indiv_means_noslug, nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR1 MR2 h2 u2 com
## anxious_mean 0.92 0.03 0.83 0.168 1.0
## nervous_mean 0.98 0.06 0.92 0.077 1.0
## upset_mean 0.85 -0.10 0.81 0.194 1.0
## irritable_mean 0.81 -0.12 0.76 0.244 1.0
## content_mean -0.22 0.82 0.87 0.135 1.1
## relaxed_mean -0.35 0.54 0.57 0.430 1.7
## excited_mean 0.25 0.94 0.75 0.250 1.1
## happy_mean -0.14 0.88 0.90 0.098 1.0
## attentive_mean 0.00 0.62 0.39 0.613 1.0
##
## MR1 MR2
## SS loadings 3.61 3.18
## Proportion Var 0.40 0.35
## Cumulative Var 0.40 0.75
## Proportion Explained 0.53 0.47
## Cumulative Proportion 0.53 1.00
##
## With factor correlations of
## MR1 MR2
## MR1 1.00 -0.41
## MR2 -0.41 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 2 factors are sufficient.
##
## The degrees of freedom for the null model are 36 and the objective function was 10.62 with Chi Square of 1329.6
## The degrees of freedom for the model are 19 and the objective function was 2.14
##
## The root mean square of the residuals (RMSR) is 0.05
## The df corrected root mean square of the residuals is 0.07
##
## The harmonic number of observations is 117 with the empirical chi square 20.26 with prob < 0.38
## The total number of observations was 130 with Likelihood Chi Square = 264.46 with prob < 3.6e-45
##
## Tucker Lewis Index of factoring reliability = 0.636
## RMSEA index = 0.323 and the 90 % confidence intervals are 0.283 0.351
## BIC = 171.98
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy
## MR1 MR2
## Correlation of (regression) scores with factors 0.99 0.98
## Multiple R square of scores with factors 0.97 0.95
## Minimum correlation of possible factor scores 0.94 0.91
mean.pca.oblimin3.2 <- fa(r = indiv_means_noslug, nfactors = 3, rotate = "oblimin")
## The estimated weights for the factor scores are probably incorrect. Try a different factor extraction method.
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate =
## rotate, : An ultra-Heywood case was detected. Examine the results carefully
mean.pca.oblimin3.2
## Factor Analysis using method = minres
## Call: fa(r = indiv_means_noslug, nfactors = 3, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR2 MR1 MR3 h2 u2 com
## anxious_mean 0.05 0.97 0.06 1.00 -0.00194 1.0
## nervous_mean 0.04 0.73 0.32 0.90 0.09917 1.4
## upset_mean -0.10 0.12 0.88 1.00 0.00083 1.1
## irritable_mean -0.13 0.25 0.65 0.80 0.20083 1.4
## content_mean 0.81 -0.04 -0.24 0.87 0.12959 1.2
## relaxed_mean 0.55 -0.57 0.18 0.69 0.31291 2.2
## excited_mean 0.92 0.05 0.19 0.75 0.24564 1.1
## happy_mean 0.88 0.02 -0.21 0.91 0.08996 1.1
## attentive_mean 0.61 0.04 -0.07 0.39 0.61305 1.0
##
## MR2 MR1 MR3
## SS loadings 3.15 2.28 1.88
## Proportion Var 0.35 0.25 0.21
## Cumulative Var 0.35 0.60 0.81
## Proportion Explained 0.43 0.31 0.26
## Cumulative Proportion 0.43 0.74 1.00
##
## With factor correlations of
## MR2 MR1 MR3
## MR2 1.00 -0.35 -0.31
## MR1 -0.35 1.00 0.65
## MR3 -0.31 0.65 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 3 factors are sufficient.
##
## The degrees of freedom for the null model are 36 and the objective function was 10.62 with Chi Square of 1329.6
## The degrees of freedom for the model are 12 and the objective function was 0.9
##
## The root mean square of the residuals (RMSR) is 0.03
## The df corrected root mean square of the residuals is 0.04
##
## The harmonic number of observations is 117 with the empirical chi square 5.37 with prob < 0.94
## The total number of observations was 130 with Likelihood Chi Square = 110.59 with prob < 4.6e-18
##
## Tucker Lewis Index of factoring reliability = 0.768
## RMSEA index = 0.259 and the 90 % confidence intervals are 0.211 0.296
## BIC = 52.18
## Fit based upon off diagonal values = 1
fa.diagram(mean.pca.oblimin3.2)
mean.pca.oblimin4.2 <- fa(r = indiv_means_noslug, nfactors = 4, rotate = "oblimin")
## The estimated weights for the factor scores are probably incorrect. Try a different factor extraction method.
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate =
## rotate, : An ultra-Heywood case was detected. Examine the results carefully
mean.pca.oblimin4.2
## Factor Analysis using method = minres
## Call: fa(r = indiv_means_noslug, nfactors = 4, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR2 MR1 MR4 MR3 h2 u2 com
## anxious_mean 0.00 0.95 0.07 0.01 0.98 0.0183 1.0
## nervous_mean 0.10 0.78 0.27 -0.12 0.93 0.0685 1.3
## upset_mean -0.18 0.18 0.82 0.01 1.00 -0.0013 1.2
## irritable_mean -0.10 0.31 0.60 -0.12 0.80 0.1971 1.7
## content_mean 0.83 -0.01 -0.21 0.05 0.89 0.1080 1.1
## relaxed_mean 0.60 -0.55 0.22 -0.03 0.73 0.2666 2.3
## excited_mean 0.75 0.07 0.19 0.21 0.70 0.3004 1.3
## happy_mean 0.89 0.05 -0.18 0.05 0.93 0.0655 1.1
## attentive_mean 0.02 -0.01 0.01 0.99 1.00 0.0044 1.0
##
## MR2 MR1 MR4 MR3
## SS loadings 2.76 2.36 1.63 1.22
## Proportion Var 0.31 0.26 0.18 0.14
## Cumulative Var 0.31 0.57 0.75 0.89
## Proportion Explained 0.35 0.30 0.21 0.15
## Cumulative Proportion 0.35 0.64 0.85 1.00
##
## With factor correlations of
## MR2 MR1 MR4 MR3
## MR2 1.00 -0.37 -0.27 0.54
## MR1 -0.37 1.00 0.59 -0.19
## MR4 -0.27 0.59 1.00 -0.17
## MR3 0.54 -0.19 -0.17 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 4 factors are sufficient.
##
## The degrees of freedom for the null model are 36 and the objective function was 10.62 with Chi Square of 1329.6
## The degrees of freedom for the model are 6 and the objective function was 0.59
##
## The root mean square of the residuals (RMSR) is 0.01
## The df corrected root mean square of the residuals is 0.03
##
## The harmonic number of observations is 117 with the empirical chi square 0.93 with prob < 0.99
## The total number of observations was 130 with Likelihood Chi Square = 72.38 with prob < 1.3e-13
##
## Tucker Lewis Index of factoring reliability = 0.685
## RMSEA index = 0.301 and the 90 % confidence intervals are 0.235 0.355
## BIC = 43.17
## Fit based upon off diagonal values = 1
fa.diagram(mean.pca.oblimin4.2)
mean.pca.oblimin5.2 <- fa(r = indiv_means_noslug, nfactors = 5, rotate = "oblimin")
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate =
## rotate, : An ultra-Heywood case was detected. Examine the results carefully
mean.pca.oblimin5.2
## Factor Analysis using method = minres
## Call: fa(r = indiv_means_noslug, nfactors = 5, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR2 MR1 MR4 MR3 MR5 h2 u2 com
## anxious_mean 0.05 0.82 0.18 0.02 -0.22 0.98 0.01573 1.3
## nervous_mean -0.01 0.90 0.13 -0.08 0.15 1.00 -0.00085 1.1
## upset_mean -0.14 0.12 0.86 0.04 0.08 1.00 0.00456 1.1
## irritable_mean 0.01 0.15 0.77 -0.12 -0.10 0.83 0.16813 1.2
## content_mean 0.70 0.07 -0.32 0.08 0.16 0.89 0.10907 1.6
## relaxed_mean 0.56 -0.51 0.17 -0.01 0.20 0.73 0.27294 2.4
## excited_mean 0.66 0.11 0.12 0.25 0.17 0.70 0.30211 1.6
## happy_mean 0.95 -0.03 -0.10 0.03 -0.10 1.00 0.00408 1.0
## attentive_mean 0.00 -0.02 0.00 0.99 -0.01 1.00 0.00486 1.0
##
## MR2 MR1 MR4 MR3 MR5
## SS loadings 2.53 2.15 1.91 1.24 0.29
## Proportion Var 0.28 0.24 0.21 0.14 0.03
## Cumulative Var 0.28 0.52 0.73 0.87 0.90
## Proportion Explained 0.31 0.27 0.23 0.15 0.04
## Cumulative Proportion 0.31 0.58 0.81 0.96 1.00
##
## With factor correlations of
## MR2 MR1 MR4 MR3 MR5
## MR2 1.00 -0.30 -0.39 0.54 0.34
## MR1 -0.30 1.00 0.70 -0.17 -0.22
## MR4 -0.39 0.70 1.00 -0.22 0.01
## MR3 0.54 -0.17 -0.22 1.00 0.15
## MR5 0.34 -0.22 0.01 0.15 1.00
##
## Mean item complexity = 1.4
## Test of the hypothesis that 5 factors are sufficient.
##
## The degrees of freedom for the null model are 36 and the objective function was 10.62 with Chi Square of 1329.6
## The degrees of freedom for the model are 1 and the objective function was 0.15
##
## The root mean square of the residuals (RMSR) is 0.01
## The df corrected root mean square of the residuals is 0.04
##
## The harmonic number of observations is 117 with the empirical chi square 0.38 with prob < 0.54
## The total number of observations was 130 with Likelihood Chi Square = 17.85 with prob < 2.4e-05
##
## Tucker Lewis Index of factoring reliability = 0.518
## RMSEA index = 0.372 and the 90 % confidence intervals are 0.227 0.517
## BIC = 12.98
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy
## MR2 MR1 MR4 MR3 MR5
## Correlation of (regression) scores with factors 1 1 1.00 1.00 0.97
## Multiple R square of scores with factors 1 1 0.99 1.00 0.94
## Minimum correlation of possible factor scores 1 1 0.99 0.99 0.87