Reading NCEA Data

We did complete case analysis only.

library(readxl)
NCEADataTZ <- read_excel("NCEADataTZ.xlsx", 
    col_types = c("text", "numeric", "text", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "text"))
## Warning: Expecting numeric in B15 / R15C2: got 'NA'
## Warning: Expecting numeric in B74 / R74C2: got 'NA'
## Warning: Expecting numeric in B78 / R78C2: got 'NA'
## New names:
## * `` -> ...18
## * `` -> ...19
## * `` -> ...20
## * `` -> ...21
## * `` -> ...22
## * ...
NCEAData <- NCEADataTZ[, 1:17]

NCEAData.CC <- NCEAData[complete.cases(NCEAData), ]

kable(NCEAData.CC) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
Entry # BMI BMIOrdinal ConcussionCount ConcussionBinary ConcussionOrdinal SpinalOrdinal Spinalcount ShoulderPathologyCategory ElbPathologycategory UEBinary Uecount kneepathologycategory anklepathologycategory HpImpingementCategory LEBinary LEcount
198 26.04 3 1 1 1 3 4 0 1 1 1 0 0 0 0 0
197 20.56 2 0 0 0 0 0 0 0 0 0 3 0 0 3 5
196 21.99 2 0 0 0 3 8 0 2 3 4 0 0 2 2 2
195 20.22 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
194 21.01 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
193 21.84 2 0 0 0 2 2 0 0 0 0 0 3 0 3 9
192 25.01 3 0 0 0 0 0 0 1 2 2 0 0 0 0 0
191 19.50 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0
190 18.28 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
189 23.01 2 1 1 1 3 4 3 0 3 8 0 0 2 2 2
188 22.91 2 0 0 0 3 8 0 0 0 0 0 1 0 1 1
187 23.10 2 0 0 0 2 2 0 0 0 0 3 0 0 3 6
186 21.44 2 0 0 0 0 0 0 1 2 2 0 0 0 0 0
184 22.36 2 1 1 1 0 0 0 0 0 0 0 3 2 3 8
183 22.36 2 0 0 0 0 0 0 1 2 2 0 0 0 0 0
182 20.13 2 0 0 0 0 0 0 0 0 0 3 0 0 3 3
181 22.01 2 0 0 0 3 8 0 0 0 0 0 2 0 2 2
180 21.03 2 1 1 1 3 6 3 1 3 15 3 3 3 3 15
179 22.64 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
178 21.19 2 0 0 0 3 6 2 3 3 12 1 0 0 1 1
177 21.03 2 2 1 1 0 0 0 1 2 2 0 2 0 3 3
176 21.01 2 1 1 1 3 6 3 0 3 12 3 0 0 3 5
175 23.08 2 5 1 3 3 8 1 0 2 2 0 3 0 3 11
174 20.16 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
173 24.26 2 0 0 0 3 8 0 0 0 0 0 2 0 3 3
172 23.08 2 2 1 1 3 12 1 0 2 2 0 0 0 0 0
171 22.72 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
170 22.86 2 0 0 0 3 4 0 0 0 0 0 0 0 0 0
169 18.60 2 1 1 1 0 0 0 1 2 2 0 0 0 0 0
168 24.26 2 0 0 0 3 4 2 0 3 4 2 0 2 3 4
167 24.26 2 1 1 1 3 4 0 0 0 0 0 0 1 1 1
166 21.08 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
165 25.45 3 0 0 0 0 0 0 0 0 0 3 0 3 3 9
164 18.04 1 0 0 0 0 0 1 0 2 2 0 0 0 0 0
163 19.24 2 0 0 0 2 2 0 0 0 0 2 0 2 3 4
162 25.90 3 0 0 0 3 4 0 0 3 4 0 0 0 0 0
161 23.01 2 0 0 0 2 2 1 1 3 3 0 1 0 1 1
160 22.36 2 1 1 1 3 12 0 0 0 0 3 3 0 3 16
159 25.51 3 1 1 1 2 2 0 0 0 0 1 0 2 3 3
158 21.40 2 1 1 1 0 0 3 0 3 8 0 0 0 0 0
157 24.35 2 1 1 1 0 0 2 0 3 4 0 0 0 0 0
156 19.41 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
155 23.83 2 2 1 1 0 0 0 0 0 0 0 0 0 0 0
154 21.50 2 0 0 0 3 4 0 0 0 0 3 0 0 3 4
153 21.46 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0
152 21.19 2 3 1 2 3 4 1 2 3 8 0 1 0 3 4
151 21.57 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0
150 33.54 3 1 1 1 0 0 0 0 0 0 0 1 0 3 3
149 18.83 2 0 0 0 0 0 0 2 3 4 0 0 0 1 1
148 24.08 2 2 1 1 3 4 0 0 0 0 0 0 0 0 0
147 26.22 3 2 1 1 0 0 1 0 2 2 3 1 3 3 12
146 20.01 2 0 0 0 3 4 0 0 0 0 0 0 0 0 0
145 21.08 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
144 22.64 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
143 21.67 2 0 0 0 3 6 1 0 2 2 2 0 2 3 6
142 21.33 2 0 0 0 0 0 1 0 2 2 0 0 0 3 3
141 23.76 2 3 1 2 3 10 2 0 3 4 0 3 2 3 13
140 21.68 2 0 0 0 3 6 2 0 3 4 2 2 2 3 9
139 21.19 2 1 1 1 0 0 0 0 0 0 3 0 0 3 8
138 23.85 2 0 0 0 0 0 0 1 2 2 1 3 0 3 12
137 21.68 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0
136 29.04 3 0 0 0 0 0 0 0 0 0 1 3 2 3 7
135 25.01 3 1 1 1 0 0 0 0 0 0 0 0 0 0 0
134 22.86 2 0 0 0 2 2 0 0 0 0 3 0 0 3 7
133 23.62 2 1 1 1 2 2 0 0 0 0 0 0 0 0 0
132 24.26 2 0 0 0 2 2 0 0 0 0 0 0 0 0 0
131 21.90 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
130 27.52 3 3 1 2 3 8 0 2 2 2 3 2 3 3 10
129 19.30 2 2 1 1 3 20 3 1 3 18 3 3 3 3 40
128 21.12 2 1 1 1 3 8 0 0 2 2 3 0 0 3 8
127 27.16 3 0 0 0 3 6 0 0 0 0 2 3 3 3 12
125 20.57 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
124 23.76 2 2 1 1 3 4 0 0 0 0 0 0 0 0 0
123 23.54 2 5 1 3 0 0 0 0 0 0 0 0 0 0 0
121 22.36 2 3 1 2 3 10 1 3 3 23 2 3 0 3 20
120 23.35 2 2 1 1 0 0 0 0 0 0 0 0 0 0 0
119 20.41 2 0 0 0 3 18 0 3 3 5 0 0 0 1 1
118 25.16 2 4 1 2 3 12 0 0 0 0 1 3 0 3 4
117 23.08 2 1 1 1 0 0 1 3 3 8 0 1 0 2 2
116 23.54 2 0 0 0 0 0 0 2 2 2 0 0 0 0 0
115 19.81 2 5 1 3 0 0 0 0 0 0 0 0 3 3 4
114 25.07 3 0 0 0 3 12 0 0 0 0 3 0 2 3 5
113 24.08 2 2 1 1 0 0 2 0 3 4 0 0 0 0 0
112 21.19 2 5 1 3 3 20 1 0 2 2 2 3 2 3 11
111 21.08 2 0 0 0 0 0 0 0 0 0 1 0 0 1 1
110 19.53 2 1 1 1 3 10 0 0 0 0 0 0 0 2 2
109 21.97 2 0 0 0 3 4 0 0 0 0 0 0 1 1 1
108 24.44 2 1 1 1 3 4 0 0 0 0 1 0 3 3 13
107 22.86 2 1 1 1 2 2 3 0 3 6 0 0 1 1 1
106 22.64 2 1 1 1 3 6 0 0 0 0 3 0 3 3 27
105 30.08 3 0 0 0 2 2 0 0 0 0 0 3 1 3 7
104 21.33 2 0 0 0 3 8 0 0 0 0 0 3 0 3 16
103 21.33 2 0 0 0 2 2 0 0 0 0 3 1 0 3 6
102 22.19 2 0 0 0 3 4 0 0 0 0 0 0 0 0 0
101 23.35 2 1 1 1 3 8 0 1 1 1 0 2 3 3 6
100 23.78 2 2 1 1 0 0 0 0 0 0 0 0 0 0 0
99 21.68 2 1 1 1 0 0 1 0 2 2 0 0 0 0 0
98 23.83 2 0 0 0 0 0 1 2 3 6 0 3 0 3 6
97 19.62 2 0 0 0 0 0 0 2 3 4 0 0 0 1 1
96 18.83 2 1 1 1 2 2 0 1 2 2 0 3 0 3 4
95 20.47 2 1 1 1 3 4 0 1 2 2 2 0 0 1 2
94 25.01 3 0 0 0 0 0 0 1 3 4 0 0 0 0 0
93 22.20 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
92 21.99 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
91 18.50 1 1 1 1 3 30 0 2 3 6 3 3 3 3 22
90 20.40 2 3 1 2 0 0 0 0 0 0 0 2 0 2 2
89 22.34 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0
88 20.22 2 0 0 0 0 0 0 1 3 4 0 0 0 0 0
87 25.56 3 0 0 0 0 0 1 0 2 2 1 0 0 2 2
86 22.09 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
85 21.52 2 2 1 1 3 18 3 1 3 10 3 3 3 3 35
84 24.94 2 1 1 1 3 8 0 0 0 0 3 0 3 3 8
83 21.30 2 1 1 1 3 6 0 0 0 0 0 0 0 0 0
82 25.74 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0
81 22.36 2 0 0 0 0 0 0 0 0 0 3 2 0 3 17
80 25.72 3 4 1 2 3 6 0 0 0 0 0 0 0 3 6
79 19.81 2 5 1 3 0 0 0 1 1 1 0 0 0 0 0
78 23.68 2 1 1 1 3 8 3 2 3 10 3 3 0 3 13
77 18.05 1 2 1 1 2 2 1 0 2 2 1 2 2 3 5
76 20.72 2 0 0 0 0 0 0 0 0 0 2 0 0 3 3

UE Binary vs three categories

I think Ue injury is 0-5,more than 5 but need theroetical backing for categorizing it into 0, 1 and 2+

Data Descriptives

#Summary of BMI

BMISummary<-favstats(NCEAData.CC$BMI)
kable(BMISummary) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
min Q1 median Q3 max mean sd n missing
18.04 21.0675 22.195 23.7925 33.54 22.48067 2.451677 120 0

Visualising and tabulating Data

ConcussionCount Freq
0 62
1 34
2 12
3 5
4 2
5 5

Subject Distribution by Concussions and UE injuries categorized into 0, 1 and 2+

No Conc 1 Conc 2+Conc
0 18 10 41
1 2 1 0
2+ 14 13 21

Subject Distribution by Concussions and LE injuries

##     
##       1 2+ No Conc
##   0  13  9      28
##   1   2  0       8
##   2+ 19 15      26
No Conc 1 Conc 2+Conc
0 13 9 28
1 2 0 8
2+ 19 15 26

Subject Distribution by Concussions and Spinal

The sample has no observed spinal injury count of 1.
No Conc 1 Conc 2+Conc
0 14 10 36
2+ 20 14 26

Initial Exploratory Data Analysis Chisquare and Fisher’s Exact Tests

## 
##  Pearson's Chi-squared test
## 
## data:  countsSpinal
## X-squared = 3.3384, df = 2, p-value = 0.1884
## 
##  Fisher's Exact Test for Count Data
## 
## data:  countsSpinal
## p-value = 0.2215
## alternative hypothesis: two.sided
## 
##  Pearson's Chi-squared test
## 
## data:  countsLE
## X-squared = 5.9684, df = 4, p-value = 0.2015
## 
##  Fisher's Exact Test for Count Data
## 
## data:  countsLE
## p-value = 0.2343
## alternative hypothesis: two.sided
## 
##  Pearson's Chi-squared test
## 
## data:  countsSpinal
## X-squared = 3.3384, df = 2, p-value = 0.1884
## 
##  Fisher's Exact Test for Count Data
## 
## data:  countsSpinal
## p-value = 0.2215
## alternative hypothesis: two.sided

Fit ordered logit model

Table of Parameter Estimates

kable(Estimates) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
Value Std. Error t value p value
BMI -0.057 0.074 -0.777 0.437
Spinalcount -0.045 0.042 -1.064 0.287
Uecount -0.058 0.052 -1.112 0.266
LEcount -0.003 0.033 -0.078 0.938
1|2+ -2.564 1.704 -1.505 0.132
2+|No Conc -1.665 1.694 -0.982 0.326

Odds Ratio for a unit change

kable(Tables) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
OR 2.5 % 97.5 %
BMI 0.944 0.816 1.093
Spinalcount 0.956 0.879 1.038
Uecount 0.943 0.847 1.044
LEcount 0.997 0.934 1.066

Odds Ratio for five Unit change

kable(TB.5) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
2.5 % 97.5 %
BMI 0.751 0.362 1.560
Spinalcount 0.800 0.524 1.208
Uecount 0.748 0.437 1.238
LEcount 0.987 0.711 1.377

Odds Ratio for 10 Unit change

Please note the CI is very large indicating its not at all reliable and has large SE

kable(TB.10) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
2.5 % 97.5 %
BMI 0.563 0.131 2.433
Spinalcount 0.640 0.275 1.458
Uecount 0.559 0.191 1.532
LEcount 0.974 0.505 1.897

Looking at the distribution of Injuries etc., since the CI is very wide

UE Freq
0 69
1 3
2+ 48
UE Freq
0 69
1+ 51
LE Freq
0 50
1 10
2+ 60
LE Freq
0 50
1 11
2 7
3 52
Spinal Freq
0 60
2+ 60
Spinal Freq
0 60
1+ 60

Trying Logistic Regression

two-way contingency table of categorical outcome and predictors we want to make sure there are no 0 or small cells

0 2+
0 36 26
1 24 34
0 1+
0 36 26
1 24 34
0 1 2+
0 28 8 26
1 22 2 34
0 1+
0 28 34
1 22 36
0 1 2+
0 41 0 21
1 28 3 27
0 1+
0 41 21
1 28 30

Fitting Logistic Regression

Since having three categories for each of the independent variable ( LE, UE and Spinal Injury) stretches the data too far resulting in some extreme small cells with freq <= 0, we will stick with two categories of indep variables.

Make sure to convert categorical indep variables to a factor to indicate they are categorical variable.

## 
## Call:
## glm(formula = ConcussionBinary ~ BMI + UE.bin + LE.bin + SP.bin, 
##     family = "binomial", data = NCEAData.CC)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6086  -1.1173  -0.8302   1.1461   1.5908  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -1.85693    1.78390  -1.041   0.2979  
## BMI          0.05511    0.07801   0.706   0.4799  
## UE.bin1+     0.74023    0.39105   1.893   0.0584 .
## LE.bin1+    -0.16868    0.44191  -0.382   0.7027  
## SP.bin1+     0.66270    0.42910   1.544   0.1225  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 166.22  on 119  degrees of freedom
## Residual deviance: 159.02  on 115  degrees of freedom
## AIC: 169.02
## 
## Number of Fisher Scoring iterations: 4
##                   2.5 %    97.5 %
## (Intercept) -5.42528036 1.6559812
## BMI         -0.09944676 0.2107545
## UE.bin1+    -0.01950118 1.5194562
## LE.bin1+    -1.05446191 0.6892319
## SP.bin1+    -0.17190402 1.5207751
OR 2.5 % 97.5 %
(Intercept) 0.16 0.00 5.24
BMI 1.06 0.91 1.23
UE.bin1+ 2.10 0.98 4.57
LE.bin1+ 0.84 0.35 1.99
SP.bin1+ 1.94 0.84 4.58

Since there can be association between the UE, LE and Spinal Injuries we will look at UE and BMI only

OR 2.5 % 97.5 %
(Intercept) 0.16 0.00 4.96
BMI 1.07 0.92 1.25
UE.bin1+ 2.18 1.04 4.65

Since there can be association between the UE, LE and Spinal Injuries we will look at LE and BMI only

OR 2.5 % 97.5 %
(Intercept) 0.32 0.01 8.98
BMI 1.04 0.90 1.21
LE.bin1+ 1.33 0.64 2.78

Since there can be association between the UE, LE and Spinal Injuries we will look at Spinal and BMI only

OR 2.5 % 97.5 %
(Intercept) 0.32 0.01 9.38
BMI 1.03 0.89 1.20
SP.bin1+ 1.93 0.94 4.05

Chisquared Test for binary outcome (Concussions) and binary predictor (UE)

##                 UE.bin
## ConcussionBinary  0 1+
##                0 41 21
##                1 28 30
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  UE.2cats.tab
## X-squared = 3.2121, df = 1, p-value = 0.0731

Chisquared Test for binary outcome (Concussions) and binary predictor (LE)

LE.2cat.Chi<-chisq.test(LE.2cats.tab)
LE.2cats.tab
##                 LE.bin
## ConcussionBinary  0 1+
##                0 28 34
##                1 22 36
LE.2cat.Chi
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  LE.2cats.tab
## X-squared = 0.38138, df = 1, p-value = 0.5369

Chisquared Test for binary outcome (Concussions) and binary predicto (Spinal)

Spinal.2cat.Chi<-chisq.test(Spinal.2cats.tab)
Spinal.2cats.tab
##                 SP.bin
## ConcussionBinary  0 1+
##                0 36 26
##                1 24 34
Spinal.2cat.Chi
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  Spinal.2cats.tab
## X-squared = 2.703, df = 1, p-value = 0.1002

Association between indepndent count variables UE and LE

##       LE.bin
## UE.bin  0 1+
##     0  34 35
##     1+ 16 35
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  UE.LE.tab
## X-squared = 3.1655, df = 1, p-value = 0.07521

Association between indepnednet count variables UE and Spinal

##       UE.bin
## SP.bin  0 1+
##     0  38 22
##     1+ 31 29
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  UE.Spinal.tab
## X-squared = 1.2276, df = 1, p-value = 0.2679

Association between indepnednet count variables LE and Spinal

##       LE.bin
## SP.bin  0 1+
##     0  39 21
##     1+ 11 49
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  LE.Spinal.tab
## X-squared = 24.994, df = 1, p-value = 5.75e-07
## 
##  Fisher's Exact Test for Count Data
## 
## data:  LE.Spinal.tab
## p-value = 3.36e-07
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##   3.323046 21.177363
## sample estimates:
## odds ratio 
##    8.10374

Looking at association between outcome/Concussions (categorical) adjusting for BMI

BMI.Conc.tab<-xtabs(~ConcussionBinary +BMI.bin , data = NCEAData.CC)
BMI.Conc.tab
##                 BMI.bin
## ConcussionBinary  0 1+
##                0  1 61
##                1  2 56
BMI.Conc.Chi<-chisq.test(BMI.Conc.tab)
## Warning in chisq.test(BMI.Conc.tab): Chi-squared approximation may be incorrect
BMI.Conc.Chi
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  BMI.Conc.tab
## X-squared = 0.0034226, df = 1, p-value = 0.9533

Looking at association between predictor/UE (categorical) and BMI (covariate being adjusted for)

BMI.UE.tab<-xtabs(~UE.bin+ BMI.bin, data = NCEAData.CC)
BMI.UE.tab
##       BMI.bin
## UE.bin  0 1+
##     0   0 69
##     1+  3 48
BMI.UE.Chi<-chisq.test(BMI.UE.tab)
## Warning in chisq.test(BMI.UE.tab): Chi-squared approximation may be incorrect
BMI.UE.Chi
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  BMI.UE.tab
## X-squared = 2.0994, df = 1, p-value = 0.1474

Looking at association between predictor/UE (3 categories) and BMI (covariate being adjusted for)

BMI.UEB.tab<-xtabs(~UE.cat + BMI.bin, data = NCEAData.CC)
BMI.UEB.tab
##       BMI.bin
## UE.cat  0 1+
##     0   0 69
##     1   0  3
##     2+  3 45
BMI.UEB.Chi<-chisq.test(BMI.UEB.tab)
## Warning in chisq.test(BMI.UEB.tab): Chi-squared approximation may be incorrect
BMI.UEB.Chi
## 
##  Pearson's Chi-squared test
## 
## data:  BMI.UEB.tab
## X-squared = 4.6154, df = 2, p-value = 0.09949

looking at associations between independent variables with 3 categories for each

countsLEUE <- table(NCEAData.CC$LE.cat, NCEAData.CC$UE.cat)
#
countsLEUE
##     
##       0  1 2+
##   0  34  2 14
##   1   4  0  6
##   2+ 31  1 28
kable(countsLEUE,col.names=c("No UE", "1 UE","2+UE")) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
No UE 1 UE 2+UE
0 34 2 14
1 4 0 6
2+ 31 1 28
LE.UE.Chi<-chisq.test(countsLEUE)
## Warning in chisq.test(countsLEUE): Chi-squared approximation may be incorrect
LE.UE.Chi
## 
##  Pearson's Chi-squared test
## 
## data:  countsLEUE
## X-squared = 6.1797, df = 4, p-value = 0.1861
countsLESpinal <- table(NCEAData.CC$LE.cat, NCEAData.CC$SP.cat)
#
countsLESpinal
##     
##       0 2+
##   0  39 11
##   1   3  7
##   2+ 18 42
kable(countsLESpinal,col.names=c("No SP", "1 +SP")) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
No SP 1 +SP
0 39 11
1 3 7
2+ 18 42
LE.SE.Chi<-chisq.test(countsLESpinal)
LE.SE.Chi
## 
##  Pearson's Chi-squared test
## 
## data:  countsLESpinal
## X-squared = 26.88, df = 2, p-value = 1.456e-06
countsSEUE <- table(NCEAData.CC$SP.cat, NCEAData.CC$UE.cat)
#
countsSEUE
##     
##       0  1 2+
##   0  38  1 21
##   2+ 31  2 27
kable(countsSEUE,col.names=c("No UE", "1 UE","2+UE")) %>%
  kable_styling(bootstrap_options = "striped", full_width = F, position = "left",font_size = 14)
No UE 1 UE 2+UE
0 38 1 21
2+ 31 2 27
SE.UE.Chi<-chisq.test(countsLEUE)
## Warning in chisq.test(countsLEUE): Chi-squared approximation may be incorrect
SE.UE.Chi
## 
##  Pearson's Chi-squared test
## 
## data:  countsLEUE
## X-squared = 6.1797, df = 4, p-value = 0.1861