library(Hmisc)
library(reshape)
colnames(df2) <- c('2a','2b','2c','2d','2e','2f','2g','3a', '3b','3c','3d','3e','3f','3g','3h','3i','3j','4a','4b','4c','4d','4e','4f') # Added thematic code titles
cormatrix <- round(cor(df2, use = "pairwise"), 2)
melted_cormatrix <- melt(cormatrix)
colnames(melted_cormatrix) <- c('Var1', 'Var2', 'value')
ggplot(data = melted_cormatrix, aes(x=Var1, y=Var2, fill=value)) + 
  geom_tile() +
  geom_text(aes(Var2, Var1, label = value), size = 2.5) +
  scale_fill_gradient2(low = "orange", high = "dark green",
                       limit = c(-1,1), name="Correlation") +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        panel.background = element_blank(),
        plot.title = element_text(family = "Times New Roman", hjust = .5),
        legend.title = element_text(family="Times New Roman"),
        legend.text = element_text(family="Times New Roman"),
        text = element_text(family="Times New Roman"),
        axis.text.y = element_text(hjust=1, size = 10, family="Times New Roman"),
        axis.text.x = element_text(hjust=1, size = 10, family="Times New Roman")) +
  ggtitle("Correlations within Coding Matrix")

# Source: https://www.statology.org/correlation-heatmap-in-r/
library(knitr)
df3 <- round(cormatrix, digits = 2)
colnames(df3) <- c('2a','2b','2c','2d','2e','2f','2g','3a', '3b','3c','3d','3e','3f','3g','3h','3i','3j','4a','4b','4c','4d','4e','4f') # Added thematic code titles
rownames(df3) <- c('2a: Academic','2b: Extracurriculars','2c: Physical health','2d: Mental health','2e: Religious','2f: Social relationships','2g: Ending relationships','3a: Goal-setting', '3b: Orienting to the future','3c: Engaging in purposeful distractions','3d: Following work-rest intervals','3e: Managing time well','3f: Help-seeking','3g: Regulating emotions','3h: Suppressing emotions','3i: Venting in a safe space','3j: Maintaining physical safety','4a: Effortfulness and Conscientiousness','4b: Endurance','4c: Adaptability and Acceptance','4d: Perseverance','4e: Authenticity and Self-confidence','4f: Mindfulness and Positivity') # Added thematic code titles
df3 %>% kable
2a 2b 2c 2d 2e 2f 2g 3a 3b 3c 3d 3e 3f 3g 3h 3i 3j 4a 4b 4c 4d 4e 4f
2a: Academic 1.00 0.15 0.04 0.01 -0.03 0.09 -0.01 -0.02 0.03 -0.03 0.04 0.06 0.00 -0.03 -0.02 -0.02 0.03 0.23 0.01 0.01 0.10 -0.02 -0.03
2b: Extracurriculars 0.15 1.00 0.12 0.01 0.01 0.15 0.00 0.00 -0.01 0.21 0.02 0.05 -0.02 0.01 -0.01 0.04 0.02 0.06 -0.05 0.17 0.01 -0.01 -0.01
2c: Physical health 0.04 0.12 1.00 0.18 0.02 0.07 0.01 0.01 -0.01 0.05 0.01 0.06 -0.02 0.01 -0.02 0.00 0.01 0.03 -0.04 0.10 0.00 -0.01 0.01
2d: Mental health 0.01 0.01 0.18 1.00 0.02 0.11 0.03 0.00 0.00 0.05 0.00 0.04 0.16 0.05 -0.02 0.20 0.00 -0.02 -0.03 0.11 0.01 0.00 0.00
2e: Religious -0.03 0.01 0.02 0.02 1.00 -0.02 0.00 0.06 -0.01 -0.01 0.00 -0.01 -0.01 0.05 0.00 -0.01 -0.01 0.01 -0.02 0.00 -0.01 -0.01 -0.01
2f: Social relationships 0.09 0.15 0.07 0.11 -0.02 1.00 0.02 0.00 -0.01 0.03 0.05 0.03 0.07 0.05 0.01 0.20 0.15 0.08 -0.04 0.15 -0.01 0.04 0.05
2g: Ending relationships -0.01 0.00 0.01 0.03 0.00 0.02 1.00 -0.01 0.05 -0.01 0.00 -0.01 -0.01 -0.01 0.00 0.03 -0.01 0.02 -0.02 0.00 -0.02 -0.01 0.03
3a: Goal-setting -0.02 0.00 0.01 0.00 0.06 0.00 -0.01 1.00 0.12 -0.02 0.04 -0.02 0.01 0.04 -0.01 0.01 -0.01 0.02 -0.02 0.03 0.02 0.01 0.00
3b: Orienting to the future 0.03 -0.01 -0.01 0.00 -0.01 -0.01 0.05 0.12 1.00 -0.01 -0.01 0.01 -0.02 -0.01 -0.01 -0.01 -0.01 0.02 -0.01 0.01 0.01 0.01 0.05
3c: Engaging in purposeful distractions -0.03 0.21 0.05 0.05 -0.01 0.03 -0.01 -0.02 -0.01 1.00 0.03 0.07 0.00 0.07 -0.01 0.02 0.00 -0.01 -0.03 0.15 0.00 -0.01 0.03
3d: Following work-rest intervals 0.04 0.02 0.01 0.00 0.00 0.05 0.00 0.04 -0.01 0.03 1.00 0.02 -0.01 0.07 0.00 0.03 0.03 -0.02 -0.01 0.00 0.00 0.03 -0.02
3e: Managing time well 0.06 0.05 0.06 0.04 -0.01 0.03 -0.01 -0.02 0.01 0.07 0.02 1.00 -0.01 0.00 -0.01 -0.01 -0.01 -0.01 -0.03 0.09 0.00 0.02 -0.02
3f: Help-seeking 0.00 -0.02 -0.02 0.16 -0.01 0.07 -0.01 0.01 -0.02 0.00 -0.01 -0.01 1.00 0.00 -0.01 0.10 0.00 -0.02 -0.03 0.03 0.00 0.06 0.03
3g: Regulating emotions -0.03 0.01 0.01 0.05 0.05 0.05 -0.01 0.04 -0.01 0.07 0.07 0.00 0.00 1.00 -0.01 0.02 -0.02 0.05 -0.02 0.11 -0.01 0.03 0.02
3h: Suppressing emotions -0.02 -0.01 -0.02 -0.02 0.00 0.01 0.00 -0.01 -0.01 -0.01 0.00 -0.01 -0.01 -0.01 1.00 0.06 -0.01 -0.01 -0.03 0.01 0.00 -0.01 -0.02
3i: Venting in a safe space -0.02 0.04 0.00 0.20 -0.01 0.20 0.03 0.01 -0.01 0.02 0.03 -0.01 0.10 0.02 0.06 1.00 -0.02 0.00 -0.04 0.06 0.02 0.06 0.01
3j: Maintaining physical safety 0.03 0.02 0.01 0.00 -0.01 0.15 -0.01 -0.01 -0.01 0.00 0.03 -0.01 0.00 -0.02 -0.01 -0.02 1.00 0.04 -0.02 0.04 0.01 -0.02 0.01
4a: Effortfulness and Conscientiousness 0.23 0.06 0.03 -0.02 0.01 0.08 0.02 0.02 0.02 -0.01 -0.02 -0.01 -0.02 0.05 -0.01 0.00 0.04 1.00 -0.04 0.01 0.01 -0.01 0.01
4b: Endurance 0.01 -0.05 -0.04 -0.03 -0.02 -0.04 -0.02 -0.02 -0.01 -0.03 -0.01 -0.03 -0.03 -0.02 -0.03 -0.04 -0.02 -0.04 1.00 -0.06 -0.03 0.01 -0.03
4c: Adaptability and Acceptance 0.01 0.17 0.10 0.11 0.00 0.15 0.00 0.03 0.01 0.15 0.00 0.09 0.03 0.11 0.01 0.06 0.04 0.01 -0.06 1.00 0.02 0.03 0.07
4d: Perseverance 0.10 0.01 0.00 0.01 -0.01 -0.01 -0.02 0.02 0.01 0.00 0.00 0.00 0.00 -0.01 0.00 0.02 0.01 0.01 -0.03 0.02 1.00 0.03 0.03
4e: Authenticity and Self-confidence -0.02 -0.01 -0.01 0.00 -0.01 0.04 -0.01 0.01 0.01 -0.01 0.03 0.02 0.06 0.03 -0.01 0.06 -0.02 -0.01 0.01 0.03 0.03 1.00 0.01
4f: Mindfulness and Positivity -0.03 -0.01 0.01 0.00 -0.01 0.05 0.03 0.00 0.05 0.03 -0.02 -0.02 0.03 0.02 -0.02 0.01 0.01 0.01 -0.03 0.07 0.03 0.01 1.00
# Source: https://towardsdatascience.com/customizable-correlation-plots-in-r-b1d2856a4b05
library(dplyr)
count(df1, 'FederalRaceName') # table with frequency of each level in factor
##   "FederalRaceName"    n
## 1   FederalRaceName 2817
library(tidyverse)
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Presence_dimension1)) # created tibble with mean for Dimension 1 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.4  
## 2 Asian                                       0.264
## 3 Black or African American                   0.511
## 4 Hispanic or Latino                          0.408
## 5 Native Hawaiian or Other Pacific Islander   0    
## 6 Two or More Races                           0.36 
## 7 White                                       0.268
## 8 <NA>                                        0.558
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Presence_dimension2)) # created tibble with mean for Dimension 2 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.2  
## 2 Asian                                       0.429
## 3 Black or African American                   0.264
## 4 Hispanic or Latino                          0.354
## 5 Native Hawaiian or Other Pacific Islander   1    
## 6 Two or More Races                           0.350
## 7 White                                       0.450
## 8 <NA>                                        0.256
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Presence_dimension3)) # created tibble with mean for Dimension 3 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native           0     
## 2 Asian                                      0.166 
## 3 Black or African American                  0.109 
## 4 Hispanic or Latino                         0.130 
## 5 Native Hawaiian or Other Pacific Islander  0     
## 6 Two or More Races                          0.160 
## 7 White                                      0.163 
## 8 <NA>                                       0.0854
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Presence_dimension4)) # created tibble with mean for Dimension 4 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.4  
## 2 Asian                                       0.521
## 3 Black or African American                   0.295
## 4 Hispanic or Latino                          0.397
## 5 Native Hawaiian or Other Pacific Islander   1    
## 6 Two or More Races                           0.45 
## 7 White                                       0.508
## 8 <NA>                                        0.261
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Sum_dimension1)) # created tibble with mean for Dimension 1 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.4  
## 2 Asian                                       0.264
## 3 Black or African American                   0.511
## 4 Hispanic or Latino                          0.408
## 5 Native Hawaiian or Other Pacific Islander   0    
## 6 Two or More Races                           0.36 
## 7 White                                       0.268
## 8 <NA>                                        0.558
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Sum_dimension2)) # created tibble with mean for Dimension 2 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.2  
## 2 Asian                                       0.607
## 3 Black or African American                   0.344
## 4 Hispanic or Latino                          0.462
## 5 Native Hawaiian or Other Pacific Islander   2    
## 6 Two or More Races                           0.490
## 7 White                                       0.647
## 8 <NA>                                        0.382
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Sum_dimension3)) # created tibble with mean for Dimension 3 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0    
## 2 Asian                                       0.184
## 3 Black or African American                   0.116
## 4 Hispanic or Latino                          0.149
## 5 Native Hawaiian or Other Pacific Islander   0    
## 6 Two or More Races                           0.17 
## 7 White                                       0.177
## 8 <NA>                                        0.111
df1 %>% group_by(FederalRaceName) %>% dplyr::summarize(Average=mean(Sum_dimension4)) # created tibble with mean for Dimension 4 grouped by FederalRaceName level
## # A tibble: 8 × 2
##   FederalRaceName                           Average
##   <chr>                                       <dbl>
## 1 American Indian or Alaska Native            0.4  
## 2 Asian                                       0.675
## 3 Black or African American                   0.330
## 4 Hispanic or Latino                          0.469
## 5 Native Hawaiian or Other Pacific Islander   1    
## 6 Two or More Races                           0.6  
## 7 White                                       0.635
## 8 <NA>                                        0.327
cor.test(df1$FRL, df1$Presence_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Presence_dimension1
## t = 10.758, df = 2616, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1688466 0.2422232
## sample estimates:
##       cor 
## 0.2058242
cor.test(df1$FRL, df1$Presence_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Presence_dimension2
## t = -7.7652, df = 2616, p-value = 1.161e-14
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1873327 -0.1124386
## sample estimates:
##       cor 
## -0.150101
cor.test(df1$FRL, df1$Presence_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Presence_dimension3
## t = -2.3201, df = 2616, p-value = 0.02041
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.083477980 -0.007017278
## sample estimates:
##         cor 
## -0.04531399
cor.test(df1$FRL, df1$Presence_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Presence_dimension4
## t = -8.3832, df = 2616, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1988233 -0.1242072
## sample estimates:
##        cor 
## -0.1617464
cor.test(df1$FRL, df1$X.2aAcademic, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2aAcademic
## t = -7.5916, df = 2616, p-value = 4.369e-14
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1840919 -0.1091233
## sample estimates:
##        cor 
## -0.1468184
cor.test(df1$FRL, df1$X.2bExtracurricularsHobbiesEmploymentSports, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2bExtracurricularsHobbiesEmploymentSports
## t = -2.622, df = 2616, p-value = 0.008793
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08933013 -0.01291286
## sample estimates:
##         cor 
## -0.05119643
cor.test(df1$FRL, df1$X.2cPhysicalexerciseHealthyDiet, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2cPhysicalexerciseHealthyDiet
## t = -2.4857, df = 2616, p-value = 0.01299
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08669044 -0.01025293
## sample estimates:
##         cor 
## -0.04854276
cor.test(df1$FRL, df1$X.2dMentalhealth, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2dMentalhealth
## t = -3.1126, df = 2616, p-value = 0.001874
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.09882319 -0.02248769
## sample estimates:
##         cor 
## -0.06074426
cor.test(df1$FRL, df1$X.2eReligious, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2eReligious
## t = 3.2722, df = 2616, p-value = 0.001081
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.02559901 0.10190495
## sample estimates:
##        cor 
## 0.06384529
cor.test(df1$FRL, df1$X.2fSocialrelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2fSocialrelationships
## t = -3.9021, df = 2616, p-value = 9.777e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.11404721 -0.03787214
## sample estimates:
##         cor 
## -0.07607067
cor.test(df1$FRL, df1$X.2gEndingCertainRelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.2gEndingCertainRelationships
## t = -0.82389, df = 2616, p-value = 0.4101
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05438154  0.02221641
## sample estimates:
##        cor 
## -0.0161062
cor.test(df1$FRL, df1$X.3aSettinggoals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3aSettinggoals
## t = 0.21983, df = 2616, p-value = 0.826
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.03401644  0.04259994
## sample estimates:
##         cor 
## 0.004298061
cor.test(df1$FRL, df1$X.3bOrientingtothefuture, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3bOrientingtothefuture
## t = -0.83207, df = 2616, p-value = 0.4054
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05454107  0.02205649
## sample estimates:
##         cor 
## -0.01626616
cor.test(df1$FRL, df1$X.3cEngaginginpurposefuldistractions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3cEngaginginpurposefuldistractions
## t = -0.49551, df = 2616, p-value = 0.6203
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.04797858  0.02863204
## sample estimates:
##          cor 
## -0.009687486
cor.test(df1$FRL, df1$X.3dFollowingWorkRestIntervals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3dFollowingWorkRestIntervals
## t = 0.7111, df = 2616, p-value = 0.4771
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02442017  0.05218284
## sample estimates:
##        cor 
## 0.01390173
cor.test(df1$FRL, df1$X.3eManagingtimewell, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3eManagingtimewell
## t = -1.631, df = 2616, p-value = 0.103
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.070095786  0.006444291
## sample estimates:
##         cor 
## -0.03187247
cor.test(df1$FRL, df1$X.3fHelpseekingAdvocatingforSelf, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3fHelpseekingAdvocatingforSelf
## t = -1.0575, df = 2616, p-value = 0.2904
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.0589344  0.0176507
## sample estimates:
##         cor 
## -0.02067218
cor.test(df1$FRL, df1$X.3gRegulatingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3gRegulatingemotions
## t = 1.2285, df = 2616, p-value = 0.2194
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.01430988  0.06226380
## sample estimates:
##        cor 
## 0.02401218
cor.test(df1$FRL, df1$X.3hSuppressingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3hSuppressingemotions
## t = -0.66291, df = 2616, p-value = 0.5074
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05124335  0.02536159
## sample estimates:
##        cor 
## -0.0129599
cor.test(df1$FRL, df1$X.3iVentinginsafespace, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3iVentinginsafespace
## t = -0.94225, df = 2616, p-value = 0.3462
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05668816  0.01990368
## sample estimates:
##         cor 
## -0.01841926
cor.test(df1$FRL, df1$X.3jMaintainingphysicalsafety, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.3jMaintainingphysicalsafety
## t = -3.0556, df = 2616, p-value = 0.002269
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.09772095 -0.02137524
## sample estimates:
##         cor 
## -0.05963531
cor.test(df1$FRL, df1$X.4aEffortfulnessampConscientiousness, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4aEffortfulnessampConscientiousness
## t = -3.2506, df = 2616, p-value = 0.001166
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.10148849 -0.02517847
## sample estimates:
##         cor 
## -0.06342619
cor.test(df1$FRL, df1$X.4bEndurance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4bEndurance
## t = -5.7157, df = 2616, p-value = 1.216e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.14873632 -0.07306219
## sample estimates:
##        cor 
## -0.1110602
cor.test(df1$FRL, df1$X.4cAdaptabilityampAcceptance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4cAdaptabilityampAcceptance
## t = -4.4435, df = 2616, p-value = 9.22e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.12444696 -0.04840227
## sample estimates:
##         cor 
## -0.08655069
cor.test(df1$FRL, df1$X.4dPerserverance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4dPerserverance
## t = -1.7842, df = 2616, p-value = 0.0745
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.073074231  0.003450578
## sample estimates:
##         cor 
## -0.03486293
cor.test(df1$FRL, df1$X.4eAuthenticityampSelfConfidence, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4eAuthenticityampSelfConfidence
## t = -1.6308, df = 2616, p-value = 0.1031
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.070091156  0.006448944
## sample estimates:
##         cor 
## -0.03186783
cor.test(df1$FRL, df1$X.4fMindfulnessampPositivity, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$X.4fMindfulnessampPositivity
## t = -3.1583, df = 2616, p-value = 0.001605
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.09970597 -0.02337878
## sample estimates:
##         cor 
## -0.06163248
cor.test(df1$female, df1$Presence_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Presence_dimension1
## t = -5.3712, df = 2616, p-value = 8.511e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.14218059 -0.06639732
## sample estimates:
##        cor 
## -0.1044406
cor.test(df1$female, df1$Presence_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Presence_dimension2
## t = 3.538, df = 2616, p-value = 0.0004102
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.03078036 0.10703382
## sample estimates:
##        cor 
## 0.06900788
cor.test(df1$female, df1$Presence_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Presence_dimension3
## t = 6.7917, df = 2616, p-value = 1.367e-11
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.09379617 0.16908832
## sample estimates:
##       cor 
## 0.1316321
cor.test(df1$female, df1$Presence_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Presence_dimension4
## t = 4.1864, df = 2616, p-value = 2.927e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.04340536 0.11951401
## sample estimates:
##        cor 
## 0.08157861
cor.test(df1$female, df1$X.2aAcademic, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2aAcademic
## t = 1.6335, df = 2616, p-value = 0.1025
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.006396182  0.070143661
## sample estimates:
##        cor 
## 0.03192054
cor.test(df1$female, df1$X.2bExtracurricularsHobbiesEmploymentSports, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2bExtracurricularsHobbiesEmploymentSports
## t = -0.38578, df = 2616, p-value = 0.6997
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.04583811  0.03077534
## sample estimates:
##          cor 
## -0.007542453
cor.test(df1$female, df1$X.2cPhysicalexerciseHealthyDiet, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2cPhysicalexerciseHealthyDiet
## t = -1.6262, df = 2616, p-value = 0.104
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.070001457  0.006539082
## sample estimates:
##         cor 
## -0.03177778
cor.test(df1$female, df1$X.2dMentalhealth, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2dMentalhealth
## t = 6.003, df = 2616, p-value = 2.206e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.07860961 0.15418784
## sample estimates:
##       cor 
## 0.1165675
cor.test(df1$female, df1$X.2eReligious, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2eReligious
## t = -0.39656, df = 2616, p-value = 0.6917
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.04604827  0.03056493
## sample estimates:
##          cor 
## -0.007753044
cor.test(df1$female, df1$X.2fSocialrelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2fSocialrelationships
## t = 4.2052, df = 2616, p-value = 2.696e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.04377051 0.11987461
## sample estimates:
##        cor 
## 0.08194201
cor.test(df1$female, df1$X.2gEndingCertainRelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.2gEndingCertainRelationships
## t = 1.488, df = 2616, p-value = 0.1369
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.009239213  0.067313886
## sample estimates:
##        cor 
## 0.02907998
cor.test(df1$female, df1$X.3aSettinggoals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3aSettinggoals
## t = 1.0279, df = 2616, p-value = 0.3041
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.01822979  0.05835711
## sample estimates:
##        cor 
## 0.02009314
cor.test(df1$female, df1$X.3bOrientingtothefuture, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3bOrientingtothefuture
## t = 2.8693, df = 2616, p-value = 0.004147
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.01774072 0.09411850
## sample estimates:
##        cor 
## 0.05601156
cor.test(df1$female, df1$X.3cEngaginginpurposefuldistractions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3cEngaginginpurposefuldistractions
## t = 2.0319, df = 2616, p-value = 0.04227
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.001388521 0.077885765
## sample estimates:
##        cor 
## 0.03969531
cor.test(df1$female, df1$X.3dFollowingWorkRestIntervals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3dFollowingWorkRestIntervals
## t = 0.80908, df = 2616, p-value = 0.4185
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02250568  0.05409297
## sample estimates:
##        cor 
## 0.01581685
cor.test(df1$female, df1$X.3eManagingtimewell, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3eManagingtimewell
## t = 1.4171, df = 2616, p-value = 0.1566
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.01062475  0.06593436
## sample estimates:
##        cor 
## 0.02769542
cor.test(df1$female, df1$X.3fHelpseekingAdvocatingforSelf, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3fHelpseekingAdvocatingforSelf
## t = 4.4013, df = 2616, p-value = 1.119e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.04758308 0.12363851
## sample estimates:
##       cor 
## 0.0857357
cor.test(df1$female, df1$X.3gRegulatingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3gRegulatingemotions
## t = 2.2842, df = 2616, p-value = 0.02244
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.006317985 0.082783488
## sample estimates:
##        cor 
## 0.04461608
cor.test(df1$female, df1$X.3hSuppressingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3hSuppressingemotions
## t = 0.51001, df = 2616, p-value = 0.6101
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02834883  0.04826136
## sample estimates:
##         cor 
## 0.009970895
cor.test(df1$female, df1$X.3iVentinginsafespace, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3iVentinginsafespace
## t = 4.9207, df = 2616, p-value = 9.159e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.05766778 0.13358394
## sample estimates:
##        cor 
## 0.09576512
cor.test(df1$female, df1$X.3jMaintainingphysicalsafety, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.3jMaintainingphysicalsafety
## t = 1.9507, df = 2616, p-value = 0.0512
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.0001974745  0.0763091965
## sample estimates:
##        cor 
## 0.03811171
cor.test(df1$female, df1$X.4aEffortfulnessampConscientiousness, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4aEffortfulnessampConscientiousness
## t = 0.9368, df = 2616, p-value = 0.3489
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02001006  0.05658208
## sample estimates:
##        cor 
## 0.01831288
cor.test(df1$female, df1$X.4bEndurance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4bEndurance
## t = 0.79519, df = 2616, p-value = 0.4266
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02277711  0.05382220
## sample estimates:
##        cor 
## 0.01554535
cor.test(df1$female, df1$X.4cAdaptabilityampAcceptance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4cAdaptabilityampAcceptance
## t = 4.725, df = 2616, p-value = 2.423e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.05386992 0.12984033
## sample estimates:
##        cor 
## 0.09198898
cor.test(df1$female, df1$X.4dPerserverance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4dPerserverance
## t = 1.2101, df = 2616, p-value = 0.2264
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.01467026  0.06190474
## sample estimates:
##        cor 
## 0.02365194
cor.test(df1$female, df1$X.4eAuthenticityampSelfConfidence, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4eAuthenticityampSelfConfidence
## t = 0.46839, df = 2616, p-value = 0.6395
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02916171  0.04744967
## sample estimates:
##         cor 
## 0.009157413
cor.test(df1$female, df1$X.4fMindfulnessampPositivity, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$X.4fMindfulnessampPositivity
## t = 1.9702, df = 2616, p-value = 0.04892
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.0001839748 0.0766884136
## sample estimates:
##       cor 
## 0.0384926
cor.test(df1$dep2sum, df1$Presence_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Presence_dimension1
## t = 2.6209, df = 2573, p-value = 0.008822
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.01299856 0.09004814
## sample estimates:
##        cor 
## 0.05160014
cor.test(df1$dep2sum, df1$Presence_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Presence_dimension2
## t = -1.0188, df = 2573, p-value = 0.3084
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05866293  0.01856094
## sample estimates:
##         cor 
## -0.02008095
cor.test(df1$dep2sum, df1$Presence_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Presence_dimension3
## t = 1.4466, df = 2573, p-value = 0.1481
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.01013075  0.06706153
## sample estimates:
##        cor 
## 0.02850789
cor.test(df1$dep2sum, df1$Presence_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Presence_dimension4
## t = -3.6576, df = 2573, p-value = 0.0002597
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.11024160 -0.03338564
## sample estimates:
##         cor 
## -0.07192038
cor.test(df1$dep2sum, df1$X.2aAcademic, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2aAcademic
## t = -2.0513, df = 2573, p-value = 0.04034
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.078910342 -0.001781308
## sample estimates:
##         cor 
## -0.04040602
cor.test(df1$dep2sum, df1$X.2bExtracurricularsHobbiesEmploymentSports, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2bExtracurricularsHobbiesEmploymentSports
## t = -1.6566, df = 2573, p-value = 0.09773
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.071178247  0.005994544
## sample estimates:
##        cor 
## -0.0326405
cor.test(df1$dep2sum, df1$X.2cPhysicalexerciseHealthyDiet, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2cPhysicalexerciseHealthyDiet
## t = -2.2164, df = 2573, p-value = 0.02675
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08214253 -0.00503455
## sample estimates:
##         cor 
## -0.04365355
cor.test(df1$dep2sum, df1$X.2dMentalhealth, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2dMentalhealth
## t = 5.1207, df = 2573, p-value = 3.27e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.06205296 0.13852973
## sample estimates:
##       cor 
## 0.1004397
cor.test(df1$dep2sum, df1$X.2eReligious, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2eReligious
## t = 0.24146, df = 2573, p-value = 0.8092
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.03387355  0.04337968
## sample estimates:
##         cor 
## 0.004760164
cor.test(df1$dep2sum, df1$X.2fSocialrelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2fSocialrelationships
## t = -1.7338, df = 2573, p-value = 0.08307
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.072692440  0.004472517
## sample estimates:
##         cor 
## -0.03416087
cor.test(df1$dep2sum, df1$X.2gEndingCertainRelationships, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.2gEndingCertainRelationships
## t = -0.038061, df = 2573, p-value = 0.9696
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.03937669  0.03787824
## sample estimates:
##           cor 
## -0.0007503433
cor.test(df1$dep2sum, df1$X.3aSettinggoals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3aSettinggoals
## t = -0.80787, df = 2573, p-value = 0.4192
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05451839  0.02271702
## sample estimates:
##         cor 
## -0.01592444
cor.test(df1$dep2sum, df1$X.3bOrientingtothefuture, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3bOrientingtothefuture
## t = -0.87504, df = 2573, p-value = 0.3816
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05583857  0.02139346
## sample estimates:
##         cor 
## -0.01724828
cor.test(df1$dep2sum, df1$X.3cEngaginginpurposefuldistractions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3cEngaginginpurposefuldistractions
## t = -1.0922, df = 2573, p-value = 0.2748
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.06010524  0.01711398
## sample estimates:
##         cor 
## -0.02152774
cor.test(df1$dep2sum, df1$X.3dFollowingWorkRestIntervals, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3dFollowingWorkRestIntervals
## t = -2.2573, df = 2573, p-value = 0.02407
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08294185 -0.00583933
## sample estimates:
##         cor 
## -0.04445679
cor.test(df1$dep2sum, df1$X.3eManagingtimewell, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3eManagingtimewell
## t = -2.3803, df = 2573, p-value = 0.01737
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.085347969 -0.008262489
## sample estimates:
##         cor 
## -0.04687502
cor.test(df1$dep2sum, df1$X.3fHelpseekingAdvocatingforSelf, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3fHelpseekingAdvocatingforSelf
## t = 3.6848, df = 2573, p-value = 0.0002336
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.03391907 0.11076912
## sample estimates:
##        cor 
## 0.07245163
cor.test(df1$dep2sum, df1$X.3gRegulatingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3gRegulatingemotions
## t = 0.3772, df = 2573, p-value = 0.7061
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.03120043  0.04605028
## sample estimates:
##         cor 
## 0.007436015
cor.test(df1$dep2sum, df1$X.3hSuppressingemotions, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3hSuppressingemotions
## t = 2.1007, df = 2573, p-value = 0.03577
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.002754912 0.079877814
## sample estimates:
##      cor 
## 0.041378
cor.test(df1$dep2sum, df1$X.3iVentinginsafespace, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3iVentinginsafespace
## t = 3.5323, df = 2573, p-value = 0.0004191
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.03092483 0.10780753
## sample estimates:
##        cor 
## 0.06946934
cor.test(df1$dep2sum, df1$X.3jMaintainingphysicalsafety, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.3jMaintainingphysicalsafety
## t = -0.65858, df = 2573, p-value = 0.5102
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05158400  0.02565798
## sample estimates:
##         cor 
## -0.01298238
cor.test(df1$dep2sum, df1$X.4aEffortfulnessampConscientiousness, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4aEffortfulnessampConscientiousness
## t = -1.3882, df = 2573, p-value = 0.1652
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.06591569  0.01128155
## sample estimates:
##         cor 
## -0.02735786
cor.test(df1$dep2sum, df1$X.4bEndurance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4bEndurance
## t = 2.3703, df = 2573, p-value = 0.01785
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.008065346 0.085152244
## sample estimates:
##        cor 
## 0.04667829
cor.test(df1$dep2sum, df1$X.4cAdaptabilityampAcceptance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4cAdaptabilityampAcceptance
## t = -4.0915, df = 2573, p-value = 4.418e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.11865828 -0.04190195
## sample estimates:
##        cor 
## -0.0803993
cor.test(df1$dep2sum, df1$X.4dPerserverance, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4dPerserverance
## t = -1.741, df = 2573, p-value = 0.0818
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.072834117  0.004330089
## sample estimates:
##         cor 
## -0.03430314
cor.test(df1$dep2sum, df1$X.4eAuthenticityampSelfConfidence, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4eAuthenticityampSelfConfidence
## t = -0.78221, df = 2573, p-value = 0.4342
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.05401409  0.02322255
## sample estimates:
##         cor 
## -0.01541877
cor.test(df1$dep2sum, df1$X.4fMindfulnessampPositivity, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$X.4fMindfulnessampPositivity
## t = -4.1017, df = 2573, p-value = 4.229e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.11885590 -0.04210204
## sample estimates:
##         cor 
## -0.08059845
cor.test(df1$FRL, df1$Sum_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Sum_dimension1
## t = 10.758, df = 2616, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1688466 0.2422232
## sample estimates:
##       cor 
## 0.2058242
cor.test(df1$FRL, df1$Sum_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Sum_dimension2
## t = -8.0946, df = 2616, p-value = 8.704e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1934677 -0.1187194
## sample estimates:
##        cor 
## -0.1563173
cor.test(df1$FRL, df1$Sum_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Sum_dimension3
## t = -2.2829, df = 2616, p-value = 0.02251
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.082757836 -0.006292156
## sample estimates:
##         cor 
## -0.04459031
cor.test(df1$FRL, df1$Sum_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$FRL and df1$Sum_dimension4
## t = -8.6689, df = 2616, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2041096 -0.1296283
## sample estimates:
##        cor 
## -0.1671073
cor.test(df1$female, df1$Sum_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Sum_dimension1
## t = -5.3712, df = 2616, p-value = 8.511e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.14218059 -0.06639732
## sample estimates:
##        cor 
## -0.1044406
cor.test(df1$female, df1$Sum_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Sum_dimension2
## t = 3.9319, df = 2616, p-value = 8.647e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.03845248 0.11462081
## sample estimates:
##        cor 
## 0.07664847
cor.test(df1$female, df1$Sum_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Sum_dimension3
## t = 7.2283, df = 2616, p-value = 6.387e-13
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1021735 0.1772932
## sample estimates:
##       cor 
## 0.1399347
cor.test(df1$female, df1$Sum_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$female and df1$Sum_dimension4
## t = 4.5776, df = 2616, p-value = 4.924e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.05100731 0.12701716
## sample estimates:
##        cor 
## 0.08914202
cor.test(df1$dep2sum, df1$Sum_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Sum_dimension1
## t = 2.6209, df = 2573, p-value = 0.008822
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.01299856 0.09004814
## sample estimates:
##        cor 
## 0.05160014
cor.test(df1$dep2sum, df1$Sum_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Sum_dimension2
## t = -1.3455, df = 2573, p-value = 0.1786
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.06507798  0.01212276
## sample estimates:
##         cor 
## -0.02651715
cor.test(df1$dep2sum, df1$Sum_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Sum_dimension3
## t = 0.73429, df = 2573, p-value = 0.4628
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02416655  0.05307227
## sample estimates:
##        cor 
## 0.01447445
cor.test(df1$dep2sum, df1$Sum_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$dep2sum and df1$Sum_dimension4
## t = -4.0282, df = 2573, p-value = 5.783e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.11743219 -0.04066064
## sample estimates:
##         cor 
## -0.07916379
cor.test(df1$Presence_dimension1, df1$Sum_dimension1, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$Presence_dimension1 and df1$Sum_dimension1
## t = Inf, df = 2815, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  1 1
## sample estimates:
## cor 
##   1
cor.test(df1$Presence_dimension2, df1$Sum_dimension2, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$Presence_dimension2 and df1$Sum_dimension2
## t = 93.038, df = 2815, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.8593133 0.8774577
## sample estimates:
##       cor 
## 0.8686766
cor.test(df1$Presence_dimension3, df1$Sum_dimension3, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$Presence_dimension3 and df1$Sum_dimension3
## t = 151.72, df = 2815, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.939778 0.947836
## sample estimates:
##       cor 
## 0.9439474
cor.test(df1$Presence_dimension4, df1$Sum_dimension4, use="pairwise")
## 
##  Pearson's product-moment correlation
## 
## data:  df1$Presence_dimension4 and df1$Sum_dimension4
## t = 100.08, df = 2815, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.8751506 0.8913718
## sample estimates:
##       cor 
## 0.8835259
FederalRaceName <- as.factor(df1$FederalRaceName)
levels(FederalRaceName)
## [1] "American Indian or Alaska Native"         
## [2] "Asian"                                    
## [3] "Black or African American"                
## [4] "Hispanic or Latino"                       
## [5] "Native Hawaiian or Other Pacific Islander"
## [6] "Two or More Races"                        
## [7] "White"
aov1 <- aov(Presence_dimension1 ~ FederalRaceName, data = df1)
summary(aov1)
##                   Df Sum Sq Mean Sq F value Pr(>F)    
## FederalRaceName    6   26.0   4.338   19.93 <2e-16 ***
## Residuals       2611  568.3   0.218                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov2 <- aov(Presence_dimension2 ~ FederalRaceName, data = df1)
summary(aov2)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## FederalRaceName    6   15.0  2.4942   10.74 7.99e-12 ***
## Residuals       2611  606.5  0.2323                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov3 <- aov(Presence_dimension3 ~ FederalRaceName, data = df1)
summary(aov3)
##                   Df Sum Sq Mean Sq F value Pr(>F)  
## FederalRaceName    6    1.5  0.2475   1.998 0.0626 .
## Residuals       2611  323.4  0.1238                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov4 <- aov(Presence_dimension4 ~ FederalRaceName, data = df1)
summary(aov4)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## FederalRaceName    6   19.9    3.32   13.86 1.44e-15 ***
## Residuals       2611  625.6    0.24                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov5 <- aov(Sum_dimension1 ~ FederalRaceName, data = df1)
summary(aov1)
##                   Df Sum Sq Mean Sq F value Pr(>F)    
## FederalRaceName    6   26.0   4.338   19.93 <2e-16 ***
## Residuals       2611  568.3   0.218                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov6 <- aov(Sum_dimension2 ~ FederalRaceName, data = df1)
summary(aov2)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## FederalRaceName    6   15.0  2.4942   10.74 7.99e-12 ***
## Residuals       2611  606.5  0.2323                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov7 <- aov(Sum_dimension3 ~ FederalRaceName, data = df1)
summary(aov3)
##                   Df Sum Sq Mean Sq F value Pr(>F)  
## FederalRaceName    6    1.5  0.2475   1.998 0.0626 .
## Residuals       2611  323.4  0.1238                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
aov8 <- aov(Sum_dimension4 ~ FederalRaceName, data = df1)
summary(aov4)
##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## FederalRaceName    6   19.9    3.32   13.86 1.44e-15 ***
## Residuals       2611  625.6    0.24                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 199 observations deleted due to missingness
library(agricolae)
HSD1 <- HSD.test(aov1,'FederalRaceName')
HSD1
## $statistics
##     MSerror   Df      Mean       CV
##   0.2176456 2611 0.3483575 133.9213
## 
## $parameters
##    test          name.t ntr StudentizedRange alpha
##   Tukey FederalRaceName   7         4.172817  0.05
## 
## $means
##                                           Presence_dimension1       std    r
## American Indian or Alaska Native                    0.4000000 0.5477226    5
## Asian                                               0.2638037 0.4420522  163
## Black or African American                           0.5108696 0.5003352  552
## Hispanic or Latino                                  0.4079498 0.4919686  478
## Native Hawaiian or Other Pacific Islander           0.0000000        NA    1
## Two or More Races                                   0.3600000 0.4824182  100
## White                                               0.2683851 0.4432872 1319
##                                           Min Max Q25 Q50 Q75
## American Indian or Alaska Native            0   1   0   0   1
## Asian                                       0   1   0   0   1
## Black or African American                   0   1   0   1   1
## Hispanic or Latino                          0   1   0   0   1
## Native Hawaiian or Other Pacific Islander   0   0   0   0   0
## Two or More Races                           0   1   0   0   1
## White                                       0   1   0   0   1
## 
## $comparison
## NULL
## 
## $groups
##                                           Presence_dimension1 groups
## Black or African American                           0.5108696      a
## Hispanic or Latino                                  0.4079498      b
## American Indian or Alaska Native                    0.4000000     bc
## Two or More Races                                   0.3600000     bc
## White                                               0.2683851      c
## Asian                                               0.2638037      c
## Native Hawaiian or Other Pacific Islander           0.0000000      c
## 
## attr(,"class")
## [1] "group"
bar.group(HSD1$groups, ylim=c(0,1), density=4, border = "red")

## code / interpretation / bar plot source: https://online.stat.psu.edu/stat485/lesson/12/12.8
library(agricolae)
HSD5 <- HSD.test(aov5,'FederalRaceName')
HSD5
## $statistics
##     MSerror   Df      Mean       CV
##   0.2176456 2611 0.3483575 133.9213
## 
## $parameters
##    test          name.t ntr StudentizedRange alpha
##   Tukey FederalRaceName   7         4.172817  0.05
## 
## $means
##                                           Sum_dimension1       std    r Min Max
## American Indian or Alaska Native               0.4000000 0.5477226    5   0   1
## Asian                                          0.2638037 0.4420522  163   0   1
## Black or African American                      0.5108696 0.5003352  552   0   1
## Hispanic or Latino                             0.4079498 0.4919686  478   0   1
## Native Hawaiian or Other Pacific Islander      0.0000000        NA    1   0   0
## Two or More Races                              0.3600000 0.4824182  100   0   1
## White                                          0.2683851 0.4432872 1319   0   1
##                                           Q25 Q50 Q75
## American Indian or Alaska Native            0   0   1
## Asian                                       0   0   1
## Black or African American                   0   1   1
## Hispanic or Latino                          0   0   1
## Native Hawaiian or Other Pacific Islander   0   0   0
## Two or More Races                           0   0   1
## White                                       0   0   1
## 
## $comparison
## NULL
## 
## $groups
##                                           Sum_dimension1 groups
## Black or African American                      0.5108696      a
## Hispanic or Latino                             0.4079498      b
## American Indian or Alaska Native               0.4000000     bc
## Two or More Races                              0.3600000     bc
## White                                          0.2683851      c
## Asian                                          0.2638037      c
## Native Hawaiian or Other Pacific Islander      0.0000000      c
## 
## attr(,"class")
## [1] "group"
bar.group(HSD5$groups, ylim=c(0,1), density=4, border = "red")

## code / interpretation / bar plot source: https://online.stat.psu.edu/stat485/lesson/12/12.8