Note: no data for NWTC-091 yet; NWTC-031 has 0’s on all, per data center data (d/t starting work in December?)
All exposures data now cleaned. index_g, index_h, index_i filled in where possible from exposures interview data.
As listed on REDCap:
Lower-exposed n = 16 (n = 4 with 3 exposures)
Resilient n = 33 (n = 2 with 3 exposures)
PTSD n = 20
Low-exposed n = 18
Resilient n = 31
PTSD n = 20
Low-exposed n = 12
Resilient n = 37
PTSD n = 20
Warning: Removed 1 rows containing non-finite values (stat_bin).
library(MASS) # for chisq
library(descr) # for crosstable
# This code will generate both Pearson's Chi-square and Fisher's Chi square. It produces counts as well as proportions of each of the table entries. Based on the standardised residuals or z-values scores i.e., If it is outside the range |1.96| i.e., less than -1.96 or greater than 1.96, then it is significant p < 0.05. The sign would then indicate whether positively related or negatively.
# NB: Residuals reflect the extent to which an observed value exceeded the expected value (positive value) or fell short of the expected value (negative value)
CrossTable(data$index_a, data$group_3resil,
fisher = T, chisq = T, expected = T,
prop.c = F, prop.t = F, prop.chisq = F,
sresid = T, missing.include=F, row.labels = T)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_a Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 10 1 1 12
expected 2.1 3.4 6.5
row prop. 0.833 0.083 0.083 0.176
std. res. 5.417 -1.285 -2.164
--------------------------------------------------------
1 2 18 36 56
expected 9.9 15.6 30.5
row prop. 0.036 0.321 0.643 0.824
std. res. -2.507 0.595 1.002
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 43.31797 d.f. = 2 p = 0.000000000392
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0000000141
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_b Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 12 12 26 50
expected 8.8 14.0 27.2
row prop. 0.240 0.240 0.520 0.735
std. res. 1.069 -0.527 -0.231
--------------------------------------------------------
1 0 7 11 18
expected 3.2 5.0 9.8
row prop. 0.000 0.389 0.611 0.265
std. res. -1.782 0.879 0.385
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 5.57198 d.f. = 2 p = 0.0617
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0479
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_c Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 6 3 5 14
expected 2.5 3.9 7.6
row prop. 0.429 0.214 0.357 0.206
std. res. 2.245 -0.461 -0.948
--------------------------------------------------------
1 6 16 32 54
expected 9.5 15.1 29.4
row prop. 0.111 0.296 0.593 0.794
std. res. -1.143 0.235 0.483
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 7.749524 d.f. = 2 p = 0.0208
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0306
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_d Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 9 9 10 28
expected 4.9 7.8 15.2
row prop. 0.321 0.321 0.357 0.412
std. res. 1.826 0.421 -1.341
--------------------------------------------------------
1 3 10 27 40
expected 7.1 11.2 21.8
row prop. 0.075 0.250 0.675 0.588
std. res. -1.528 -0.352 1.122
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 9.02691 d.f. = 2 p = 0.011
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0101
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_e Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 11 10 12 33
expected 5.8 9.2 18.0
row prop. 0.333 0.303 0.364 0.485
std. res. 2.145 0.257 -1.406
--------------------------------------------------------
1 1 9 25 35
expected 6.2 9.8 19.0
row prop. 0.029 0.257 0.714 0.515
std. res. -2.083 -0.249 1.365
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 12.90587 d.f. = 2 p = 0.00158
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.000962
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_f Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 12 16 30 58
expected 10.2 16.2 31.6
row prop. 0.207 0.276 0.517 0.853
std. res. 0.552 -0.051 -0.277
--------------------------------------------------------
1 0 3 7 10
expected 1.8 2.8 5.4
row prop. 0.000 0.300 0.700 0.147
std. res. -1.328 0.123 0.668
--------------------------------------------------------
Total 12 19 37 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 2.61033 d.f. = 2 p = 0.271
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.371
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_g Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 6 8 9 23
expected 4.1 6.5 12.4
row prop. 0.261 0.348 0.391 0.343
std. res. 0.927 0.579 -0.955
--------------------------------------------------------
1 6 11 27 44
expected 7.9 12.5 23.6
row prop. 0.136 0.250 0.614 0.657
std. res. -0.670 -0.418 0.691
--------------------------------------------------------
Total 12 19 36 67
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 3.206613 d.f. = 2 p = 0.201
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.207
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_h Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 11 4 16 31
expected 5.6 8.8 16.7
row prop. 0.355 0.129 0.516 0.463
std. res. 2.312 -1.616 -0.161
--------------------------------------------------------
1 1 15 20 36
expected 6.4 10.2 19.3
row prop. 0.028 0.417 0.556 0.537
std. res. -2.145 1.499 0.149
--------------------------------------------------------
Total 12 19 36 67
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 14.8558 d.f. = 2 p = 0.000594
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.000429
*lower-exposed more 0, fewer 1 than expected
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_i Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 11 12 28 51
expected 8.9 15.4 26.7
row prop. 0.216 0.235 0.549 0.810
std. res. 0.702 -0.862 0.249
--------------------------------------------------------
1 0 7 5 12
expected 2.1 3.6 6.3
row prop. 0.000 0.583 0.417 0.190
std. res. -1.447 1.777 -0.513
--------------------------------------------------------
Total 11 19 33 63
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 6.814804 d.f. = 2 p = 0.0331
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0339
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3resil
data$index_j Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 10 7 26 43
expected 8.4 11.0 23.6
row prop. 0.233 0.163 0.605 0.843
std. res. 0.540 -1.196 0.492
--------------------------------------------------------
1 0 6 2 8
expected 1.6 2.0 4.4
row prop. 0.000 0.750 0.250 0.157
std. res. -1.252 2.774 -1.141
--------------------------------------------------------
Total 10 13 28 51
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 12.53006 d.f. = 2 p = 0.0019
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.00373
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning: Removed 1 rows containing non-finite values (stat_bin).
library(MASS) # for chisq
library(descr) # for crosstable
CrossTable(data$index_a, data$group_3low,
fisher = T, chisq = T, expected = T,
prop.c = F, prop.t = F, prop.chisq = F,
sresid = T, missing.include=F, row.labels = T)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_a Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 11 1 0 12
expected 3.2 3.4 5.5
row prop. 0.917 0.083 0.000 0.176
std. res. 4.390 -1.285 -2.339
--------------------------------------------------------
1 7 18 31 56
expected 14.8 15.6 25.5
row prop. 0.125 0.321 0.554 0.824
std. res. -2.032 0.595 1.083
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 32.04602 d.f. = 2 p = 0.00000011
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0000000925
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_b Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 18 12 20 50
expected 13.2 14.0 22.8
row prop. 0.360 0.240 0.400 0.735
std. res. 1.310 -0.527 -0.585
--------------------------------------------------------
1 0 7 11 18
expected 4.8 5.0 8.2
row prop. 0.000 0.389 0.611 0.265
std. res. -2.183 0.879 0.975
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 8.823965 d.f. = 2 p = 0.0121
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0047
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_c Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 10 3 1 14
expected 3.7 3.9 6.4
row prop. 0.714 0.214 0.071 0.206
std. res. 3.270 -0.461 -2.131
--------------------------------------------------------
1 8 16 30 54
expected 14.3 15.1 24.6
row prop. 0.148 0.296 0.556 0.794
std. res. -1.665 0.235 1.085
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 19.44493 d.f. = 2 p = 0.0000599
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0000542
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_d Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 12 9 7 28
expected 7.4 7.8 12.8
row prop. 0.429 0.321 0.250 0.412
std. res. 1.685 0.421 -1.614
--------------------------------------------------------
1 6 10 24 40
expected 10.6 11.2 18.2
row prop. 0.150 0.250 0.600 0.588
std. res. -1.410 -0.352 1.350
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 9.55513 d.f. = 2 p = 0.00842
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.00871
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_e Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 14 10 9 33
expected 8.7 9.2 15.0
row prop. 0.424 0.303 0.273 0.485
std. res. 1.781 0.257 -1.558
--------------------------------------------------------
1 4 9 22 35
expected 9.3 9.8 16.0
row prop. 0.114 0.257 0.629 0.515
std. res. -1.730 -0.249 1.513
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 11.0105 d.f. = 2 p = 0.00407
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.00382
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_f Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 18 16 24 58
expected 15.4 16.2 26.4
row prop. 0.310 0.276 0.414 0.853
std. res. 0.676 -0.051 -0.475
--------------------------------------------------------
1 0 3 7 10
expected 2.6 2.8 4.6
row prop. 0.000 0.300 0.700 0.147
std. res. -1.627 0.123 1.143
--------------------------------------------------------
Total 18 19 31 68
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 4.653826 d.f. = 2 p = 0.0976
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0952
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_g Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 8 8 7 23
expected 6.2 6.5 10.3
row prop. 0.348 0.348 0.304 0.343
std. res. 0.733 0.579 -1.028
--------------------------------------------------------
1 10 11 23 44
expected 11.8 12.5 19.7
row prop. 0.227 0.250 0.523 0.657
std. res. -0.530 -0.418 0.743
--------------------------------------------------------
Total 18 19 30 67
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 2.935538 d.f. = 2 p = 0.23
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.231
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_h Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 16 4 11 31
expected 8.3 8.8 13.9
row prop. 0.516 0.129 0.355 0.463
std. res. 2.658 -1.616 -0.773
--------------------------------------------------------
1 2 15 19 36
expected 9.7 10.2 16.1
row prop. 0.056 0.417 0.528 0.537
std. res. -2.467 1.499 0.717
--------------------------------------------------------
Total 18 19 30 67
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 19.12401 d.f. = 2 p = 0.0000704
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0000549
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_i Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 17 12 22 51
expected 13.8 15.4 21.9
row prop. 0.333 0.235 0.431 0.810
std. res. 0.873 -0.862 0.031
--------------------------------------------------------
1 0 7 5 12
expected 3.2 3.6 5.1
row prop. 0.000 0.583 0.417 0.190
std. res. -1.799 1.777 -0.063
--------------------------------------------------------
Total 17 19 27 63
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 7.906605 d.f. = 2 p = 0.0192
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0166
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)
Warning in chisq.test(tab, correct = FALSE, ...) :
Chi-squared approximation may be incorrect
Cell Contents
|-------------------------|
| N |
| Expected N |
| N / Row Total |
| Std Residual |
|-------------------------|
========================================================
data$group_3low
data$index_j Low-exposed PTSD Resilient Total
--------------------------------------------------------
0 14 7 22 43
expected 11.8 11.0 20.2
row prop. 0.326 0.163 0.512 0.843
std. res. 0.639 -1.196 0.392
--------------------------------------------------------
1 0 6 2 8
expected 2.2 2.0 3.8
row prop. 0.000 0.750 0.250 0.157
std. res. -1.482 2.774 -0.910
--------------------------------------------------------
Total 14 13 24 51
========================================================
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 12.71008 d.f. = 2 p = 0.00174
Fisher's Exact Test for Count Data
------------------------------------------------------------
Alternative hypothesis: two.sided
p = 0.0024
Comparisons do not survive Bonferroni correction for 3*10 comparisons (.00167)