1. Import library

suppressMessages(library(haven)) # for reading SAS file
suppressMessages(library(tidyverse))
suppressMessages(library(table1))
suppressMessages(library(compareGroups))
suppressMessages(library(epiDisplay)) # Summary the results of logistic regression
suppressMessages(library(GGally))  # Plot forest results
suppressMessages(library(ggplot2))
suppressMessages(library(ggthemes))

2. Import data

df <- read_sas("C:/Users/thien/OneDrive/Desktop/SAS learning/nhanes.sas7bdat")

3. Dependent variables (Depressive disorder)

table(df$DPQ010)
## 
##    0    1    2    3    7    9 
## 3976  881  293  242    1    5
table(df$DPQ020)
## 
##    0    1    2    3    7    9 
## 4071  903  214  202    3    3
table(df$DPQ030)
## 
##    0    1    2    3    7 
## 3416 1127  350  501    1
table(df$DPQ040)
## 
##    0    1    2    3    7 
## 2650 1829  423  492    1
table(df$DPQ050)
## 
##    0    1    2    3    9 
## 4036  832  278  247    2
table(df$DPQ060)
## 
##    0    1    2    3    9 
## 4449  620  154  167    4
table(df$DPQ070)
## 
##    0    1    2    3    7    9 
## 4423  586  193  189    1    2
table(df$DPQ080)
## 
##    0    1    2    3    7    9 
## 4786  367  134  104    1    2
table(df$DPQ090)
## 
##    0    1    2    3    7    9 
## 5205  122   31   32    1    2
# Filter the dataframe
df1 <- df %>%
   filter(DPQ010 != 7 & DPQ010 != 9 & !is.na(DPQ010))

df2 <- df1 %>%
   filter(DPQ020 != 7 & DPQ020 != 9 & !is.na(DPQ020))

df3 <- df2 %>%
   filter(DPQ030 != 7 & DPQ030 != 9 & !is.na(DPQ030))

df4 <- df3 %>%
   filter(DPQ040 != 7 & DPQ040 != 9 & !is.na(DPQ040))

df5 <- df4 %>%
   filter(DPQ050 != 7 & DPQ050 != 9 & !is.na(DPQ050))

df6 <- df5 %>%
   filter(DPQ060 != 7 & DPQ060 != 9 & !is.na(DPQ060))

df7 <- df6 %>%
   filter(DPQ070 != 7 & DPQ070 != 9 & !is.na(DPQ070))

df8 <- df7 %>%
   filter(DPQ080 != 7 & DPQ080 != 9 & !is.na(DPQ080))

df9 <- df8 %>%
   filter(DPQ090 != 7 & DPQ090 != 9 & !is.na(DPQ090))

# Create depression variable: 
depress <- df9
depress$dp = depress$DPQ010 + depress$DPQ020 + depress$DPQ030 + depress$DPQ040 + depress$DPQ050 + 
   depress$DPQ060 + depress$DPQ070 + depress$DPQ080 + depress$DPQ090

# Create the new variable 'dp10'
depress <- depress %>%
   mutate(dp10 = ifelse(dp <= 9, 0, 1))

# Display frequency table for dp10
table(depress$dp10)
## 
##    0    1 
## 4861  511

4. Potential covariates

4.1 Create SBP and DBP

depress$SBP = (depress$BPXSY1 + depress$BPXSY2) / 2
depress$DBP =(depress$BPXDI1 + depress$BPXDI2) / 2

4.2 Create the variable ‘hyper’

hypertension <- depress %>%
   mutate(hyper = case_when(
      SBP >= 140 | DBP >= 90 | BPQ040A == 1 | BPQ050A == 1 ~ 1,
      TRUE ~ 0))

table(hypertension$hyper)
## 
##    0    1 
## 3458 1914

4.3 Create the variable ‘dyslip’ using case_when

lipid <- hypertension %>%
   mutate(dyslip = case_when(
      LBXTC >= 200 | LBXTR >= 150 | LBDLDL >= 100 | LBDHDD <= 40 | BPQ090D == 1 ~ 1,
      TRUE ~ 0
   ))
# Display frequency table for 'dyslip'
table(lipid$dyslip)
## 
##    0    1 
## 1681 3691

4.4 Create the ‘db’ variable using case_when

diab <- lipid %>%
   mutate(db = case_when(
      LBXGLU >= 126 | LBXGLT >= 200 | LBXGH >= 6.5 | DIQ070 == 1 ~ 1,
      TRUE ~ 0
   ))

# Display frequency table for 'db'
table(diab$db)
## 
##    0    1 
## 4542  830

Select specific variables

# Selecting specific variables and creating a subset

subset_df <- subset(diab, select = c(RIDAGEYR, RIAGENDR, RIDRETH3, DMDEDUC2, DMDMARTL, SBP, DBP, BMXBMI, INDFMIN2, INDFMPIR, LBXSBU, LBXSCR, LBXSASSI, LBXSATSI, LBXAPB, LBDHDD, LBDLDL, LBXTR, LBXTC, LBXGLU, LBXGLT, ALQ101, ALQ110, SMQ020, PAQ665, PAQ650, LBXCOT, LBXHCT, URXCOTT, URXHCTT, db, dyslip, hyper, dp10))

selected_cols <- c("RIDAGEYR", "RIAGENDR", "RIDRETH3", "DMDEDUC2", "DMDMARTL", "SBP", "DBP", 
                   "BMXBMI", "INDFMIN2", "INDFMPIR", "LBXSBU", "LBXSCR", "LBXSASSI", "LBXSATSI",
                   "LBXAPB", "LBDHDD", "LBDLDL", "LBXTR", "LBXTC", "LBXGLU", "LBXGLT", 
                   "ALQ101", "ALQ110", "SMQ020", "PAQ665", "PAQ650", "LBXCOT", "LBXHCT", 
                   "URXCOTT", "URXHCTT", "db", "dyslip", "hyper", "dp10")
# Create a subset with selected columns
df_selected <- diab[selected_cols]

head(df_selected)
## # A tibble: 6 x 34
##   RIDAGEYR RIAGENDR RIDRETH3 DMDEDUC2 DMDMARTL   SBP   DBP BMXBMI INDFMIN2
##      <dbl>    <dbl>    <dbl>    <dbl>    <dbl> <dbl> <dbl>  <dbl>    <dbl>
## 1       69        1        4        3        4   118    74   26.7        4
## 2       54        1        3        3        1   158    71   28.6        7
## 3       72        1        3        4        1   140    83   28.9       10
## 4       73        2        3        5        1   135    87   19.7       15
## 5       56        1        1        4        3   159    83   41.7        9
## 6       61        2        3        5        2   121    80   35.7       10
## # ... with 25 more variables: INDFMPIR <dbl>, LBXSBU <dbl>, LBXSCR <dbl>,
## #   LBXSASSI <dbl>, LBXSATSI <dbl>, LBXAPB <dbl>, LBDHDD <dbl>, LBDLDL <dbl>,
## #   LBXTR <dbl>, LBXTC <dbl>, LBXGLU <dbl>, LBXGLT <dbl>, ALQ101 <dbl>,
## #   ALQ110 <dbl>, SMQ020 <dbl>, PAQ665 <dbl>, PAQ650 <dbl>, LBXCOT <dbl>,
## #   LBXHCT <dbl>, URXCOTT <dbl>, URXHCTT <dbl>, db <dbl>, dyslip <dbl>,
## #   hyper <dbl>, dp10 <dbl>

5. Independent variables (Smoking, nicotine’s metabolites: cotinine, hydroxycotinine )

5.1 Cotinine and Hydroxycotinine - Serum

# LBXCOT - Cotinine, Serum (ng/mL)
# LBXHCT - Hydroxycotinine, Serum (ng/mL)

5.2 Cotinine and Hydroxycotinine - Urine

# URXCOTT - Total Cotinine, urine (ng/mL)
# URXHCTT - Total Hydroxycotinine, urine (ng/mL)

Checking missing

# Examing the pattern of missing variables
suppressMessages(library(rms))
## Warning in .recacheSubclasses(def@className, def, env): undefined subclass
## "packedMatrix" of class "replValueSp"; definition not updated
## Warning in .recacheSubclasses(def@className, def, env): undefined subclass
## "packedMatrix" of class "mMatrix"; definition not updated
na.patterns = naclus(df_selected)
plot(na.patterns)

Rename all variables in one go

df_rename <- df_selected %>% rename(age = RIDAGEYR, sex = RIAGENDR, ethnic = RIDRETH3, 
                                    educ = DMDEDUC2, masts = DMDMARTL, BMI = BMXBMI, 
                                    finc = INDFMIN2, PIR = INDFMPIR, 
                                    BUN = LBXSBU, crea = LBXSCR, AST = LBXSASSI, ALT = LBXSATSI,
                                    apoB = LBXAPB, HDL = LBDHDD, LDL = LBDLDL, 
                                    TG = LBXTR, TC = LBXTC, Glu = LBXGLU, tolGlu = LBXGLT, 
                                    sCOT = LBXCOT, sHCOT = LBXHCT, uCOT = URXCOTT, uHCOT = URXHCTT)

6. Table 1

table1(~  age + sex + ethnic + educ + masts + SBP + DBP + BMI + finc  + PIR + 
          BUN + crea + AST + ALT + apoB + HDL + LDL + TG + TC + 
          Glu + tolGlu + ALQ101 + ALQ110 + SMQ020 + PAQ650 + PAQ665 +
          sCOT + sHCOT + uCOT + uHCOT + db + dyslip + hyper | as.factor(dp10), data = df_rename)
0
(N=4861)
1
(N=511)
Overall
(N=5372)
Age in years at screening
Mean (SD) 47.1 (18.6) 50.2 (17.4) 47.4 (18.5)
Median [Min, Max] 46.0 [18.0, 80.0] 52.0 [18.0, 80.0] 47.0 [18.0, 80.0]
Gender
Mean (SD) 1.50 (0.500) 1.67 (0.471) 1.52 (0.500)
Median [Min, Max] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00]
Race/Hispanic origin w/ NH Asian
Mean (SD) 3.29 (1.50) 3.11 (1.43) 3.28 (1.50)
Median [Min, Max] 3.00 [1.00, 7.00] 3.00 [1.00, 7.00] 3.00 [1.00, 7.00]
Education level - Adults 20+
Mean (SD) 3.60 (1.19) 3.05 (1.22) 3.55 (1.21)
Median [Min, Max] 4.00 [1.00, 9.00] 3.00 [1.00, 5.00] 4.00 [1.00, 9.00]
Missing 297 (6.1%) 21 (4.1%) 318 (5.9%)
Marital status
Mean (SD) 2.50 (2.14) 2.88 (3.77) 2.53 (2.35)
Median [Min, Max] 1.00 [1.00, 77.0] 2.50 [1.00, 77.0] 1.00 [1.00, 77.0]
Missing 297 (6.1%) 21 (4.1%) 318 (5.9%)
Systolic: Blood pres (1st rdg) mm Hg
Mean (SD) 122 (17.1) 125 (19.0) 122 (17.3)
Median [Min, Max] 119 [70.0, 229] 121 [66.0, 216] 119 [66.0, 229]
Missing 430 (8.8%) 58 (11.4%) 488 (9.1%)
Diastolic: Blood pres (1st rdg) mm Hg
Mean (SD) 68.9 (12.6) 69.3 (12.4) 68.9 (12.6)
Median [Min, Max] 70.0 [0, 119] 70.0 [0, 104] 70.0 [0, 119]
Missing 430 (8.8%) 58 (11.4%) 488 (9.1%)
Body Mass Index (kg/m**2)
Mean (SD) 28.7 (6.91) 31.6 (9.38) 29.0 (7.23)
Median [Min, Max] 27.5 [14.1, 70.1] 30.4 [15.2, 82.9] 27.7 [14.1, 82.9]
Missing 50 (1.0%) 6 (1.2%) 56 (1.0%)
Annual family income
Mean (SD) 10.7 (13.4) 8.96 (14.7) 10.6 (13.5)
Median [Min, Max] 8.00 [1.00, 99.0] 6.00 [1.00, 99.0] 7.00 [1.00, 99.0]
Missing 44 (0.9%) 8 (1.6%) 52 (1.0%)
Ratio of family income to poverty
Mean (SD) 2.56 (1.66) 1.76 (1.34) 2.49 (1.65)
Median [Min, Max] 2.19 [0, 5.00] 1.27 [0, 5.00] 2.10 [0, 5.00]
Missing 344 (7.1%) 46 (9.0%) 390 (7.3%)
Blood urea nitrogen (mg/dL)
Mean (SD) 13.2 (5.68) 13.5 (8.99) 13.3 (6.08)
Median [Min, Max] 12.0 [1.00, 73.0] 12.0 [2.00, 95.0] 12.0 [1.00, 95.0]
Missing 204 (4.2%) 21 (4.1%) 225 (4.2%)
Creatinine (mg/dL)
Mean (SD) 0.906 (0.431) 0.984 (1.06) 0.914 (0.525)
Median [Min, Max] 0.860 [0.300, 16.6] 0.820 [0.360, 17.4] 0.850 [0.300, 17.4]
Missing 204 (4.2%) 21 (4.1%) 225 (4.2%)
Aspartate aminotransferase AST (U/L)
Mean (SD) 25.2 (18.6) 26.5 (21.3) 25.4 (18.9)
Median [Min, Max] 22.0 [9.00, 882] 22.0 [11.0, 294] 22.0 [9.00, 882]
Missing 206 (4.2%) 21 (4.1%) 227 (4.2%)
Alanine aminotransferase ALT (U/L)
Mean (SD) 24.8 (18.7) 25.5 (21.2) 24.9 (19.0)
Median [Min, Max] 20.0 [6.00, 536] 20.0 [7.00, 300] 20.0 [6.00, 536]
Missing 206 (4.2%) 21 (4.1%) 227 (4.2%)
Apolipoprotein (B) (mg/dL)
Mean (SD) 88.8 (24.7) 93.9 (26.8) 89.2 (25.0)
Median [Min, Max] 87.0 [24.0, 228] 93.0 [20.0, 234] 88.0 [20.0, 234]
Missing 2619 (53.9%) 284 (55.6%) 2903 (54.0%)
Direct HDL-Cholesterol (mg/dL)
Mean (SD) 52.9 (16.0) 51.0 (15.3) 52.7 (15.9)
Median [Min, Max] 50.0 [10.0, 173] 48.0 [22.0, 117] 50.0 [10.0, 173]
Missing 191 (3.9%) 18 (3.5%) 209 (3.9%)
LDL-cholesterol (mg/dL)
Mean (SD) 110 (34.5) 112 (37.2) 110 (34.8)
Median [Min, Max] 107 [14.0, 375] 110 [24.0, 288] 107 [14.0, 375]
Missing 2652 (54.6%) 287 (56.2%) 2939 (54.7%)
Triglyceride (mg/dL)
Mean (SD) 117 (127) 138 (97.5) 119 (125)
Median [Min, Max] 92.0 [14.0, 4230] 115 [21.0, 1000] 94.0 [14.0, 4230]
Missing 2618 (53.9%) 284 (55.6%) 2902 (54.0%)
Total Cholesterol( mg/dL)
Mean (SD) 187 (41.8) 191 (41.5) 188 (41.8)
Median [Min, Max] 184 [82.0, 813] 187 [85.0, 380] 184 [82.0, 813]
Missing 191 (3.9%) 18 (3.5%) 209 (3.9%)
Fasting Glucose (mg/dL)
Mean (SD) 106 (31.8) 115 (42.9) 107 (33.1)
Median [Min, Max] 99.0 [51.0, 405] 102 [67.0, 375] 99.0 [51.0, 405]
Missing 2608 (53.7%) 280 (54.8%) 2888 (53.8%)
Two Hour Glucose(OGTT) (mg/dL)
Mean (SD) 117 (49.2) 126 (51.2) 117 (49.4)
Median [Min, Max] 106 [40.0, 604] 117 [48.0, 352] 107 [40.0, 604]
Missing 3105 (63.9%) 347 (67.9%) 3452 (64.3%)
Had at least 12 alcohol drinks/1 yr?
Mean (SD) 1.31 (0.531) 1.32 (0.662) 1.31 (0.545)
Median [Min, Max] 1.00 [1.00, 9.00] 1.00 [1.00, 9.00] 1.00 [1.00, 9.00]
Missing 2 (0.0%) 0 (0%) 2 (0.0%)
Had at least 12 alcohol drinks/lifetime?
Mean (SD) 1.59 (0.598) 1.52 (0.501) 1.59 (0.590)
Median [Min, Max] 2.00 [1.00, 9.00] 2.00 [1.00, 2.00] 2.00 [1.00, 9.00]
Missing 3412 (70.2%) 361 (70.6%) 3773 (70.2%)
Smoked at least 100 cigarettes in life
Mean (SD) 1.60 (0.513) 1.44 (0.497) 1.58 (0.514)
Median [Min, Max] 2.00 [1.00, 9.00] 1.00 [1.00, 2.00] 2.00 [1.00, 9.00]
Vigorous recreational activities
Mean (SD) 1.75 (0.434) 1.89 (0.310) 1.76 (0.426)
Median [Min, Max] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00]
Moderate recreational activities
Mean (SD) 1.56 (0.496) 1.74 (0.437) 1.58 (0.494)
Median [Min, Max] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00] 2.00 [1.00, 2.00]
Cotinine, Serum (ng/mL)
Mean (SD) 55.0 (129) 100 (161) 59.3 (133)
Median [Min, Max] 0.0330 [0.0110, 1820] 0.245 [0.0110, 1030] 0.0370 [0.0110, 1820]
Missing 189 (3.9%) 19 (3.7%) 208 (3.9%)
Hematocrit (%)
Mean (SD) 21.8 (59.6) 43.9 (76.7) 23.9 (61.7)
Median [Min, Max] 0.0110 [0.0110, 1150] 0.0925 [0.0110, 540] 0.0110 [0.0110, 1150]
Missing 189 (3.9%) 19 (3.7%) 208 (3.9%)
Total Cotinine, urine (ng/mL)
Mean (SD) 660 (1790) 1510 (3170) 730 (1960)
Median [Min, Max] 0.430 [0.0210, 26800] 12.8 [0.0210, 24200] 0.486 [0.0210, 26800]
Missing 3279 (67.5%) 369 (72.2%) 3648 (67.9%)
Total Hydroxycotinine, urine (ng/mL)
Mean (SD) 1300 (4110) 2980 (6040) 1440 (4320)
Median [Min, Max] 0.761 [0.0210, 70600] 17.8 [0.0210, 40400] 0.855 [0.0210, 70600]
Missing 3279 (67.5%) 369 (72.2%) 3648 (67.9%)
db
Mean (SD) 0.145 (0.352) 0.243 (0.429) 0.155 (0.361)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
dyslip
Mean (SD) 0.682 (0.466) 0.740 (0.439) 0.687 (0.464)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
hyper
Mean (SD) 0.340 (0.474) 0.515 (0.500) 0.356 (0.479)
Median [Min, Max] 0 [0, 1.00] 1.00 [0, 1.00] 0 [0, 1.00]

Change to factor

df_new = df_rename

df_new$dp10 = as.factor(df_new$dp10)
df_new$sex = as.factor(df_new$sex)
df_new$ethnic = as.factor(df_new$ethnic)
df_new$educ = as.factor(df_new$educ)
df_new$masts = as.factor(df_new$masts)

df_new$ALQ101 = as.factor(df_new$ALQ101)
df_new$ALQ110 = as.factor(df_new$ALQ110)
df_new$SMQ020 = as.factor(df_new$SMQ020)
df_new$PAQ650 = as.factor(df_new$PAQ650)
df_new$PAQ665 = as.factor(df_new$PAQ665)

df_new$hyper = as.factor(df_new$hyper)
df_new$db = as.factor(df_new$db)
df_new$dyslip = as.factor(df_new$dyslip)

Check Table 1

tab1 = df_new
table1(~  age + sex + ethnic + educ + masts + SBP + DBP + BMI + finc  + PIR + 
          BUN + crea + AST + ALT + apoB + HDL + LDL + TG + TC + 
          Glu + tolGlu + ALQ101 + ALQ110 + SMQ020 + PAQ650 + PAQ665 +
          sCOT + sHCOT + uCOT + uHCOT + db + dyslip + hyper | dp10, data = tab1)
0
(N=4861)
1
(N=511)
Overall
(N=5372)
Age in years at screening
Mean (SD) 47.1 (18.6) 50.2 (17.4) 47.4 (18.5)
Median [Min, Max] 46.0 [18.0, 80.0] 52.0 [18.0, 80.0] 47.0 [18.0, 80.0]
sex
1 2416 (49.7%) 169 (33.1%) 2585 (48.1%)
2 2445 (50.3%) 342 (66.9%) 2787 (51.9%)
ethnic
1 676 (13.9%) 77 (15.1%) 753 (14.0%)
2 423 (8.7%) 58 (11.4%) 481 (9.0%)
3 2091 (43.0%) 224 (43.8%) 2315 (43.1%)
4 979 (20.1%) 108 (21.1%) 1087 (20.2%)
6 544 (11.2%) 18 (3.5%) 562 (10.5%)
7 148 (3.0%) 26 (5.1%) 174 (3.2%)
educ
1 293 (6.0%) 64 (12.5%) 357 (6.6%)
2 578 (11.9%) 105 (20.5%) 683 (12.7%)
3 1012 (20.8%) 118 (23.1%) 1130 (21.0%)
4 1443 (29.7%) 148 (29.0%) 1591 (29.6%)
5 1237 (25.4%) 55 (10.8%) 1292 (24.1%)
9 1 (0.0%) 0 (0%) 1 (0.0%)
Missing 297 (6.1%) 21 (4.1%) 318 (5.9%)
masts
1 2449 (50.4%) 188 (36.8%) 2637 (49.1%)
2 312 (6.4%) 57 (11.2%) 369 (6.9%)
3 484 (10.0%) 98 (19.2%) 582 (10.8%)
4 124 (2.6%) 27 (5.3%) 151 (2.8%)
5 872 (17.9%) 83 (16.2%) 955 (17.8%)
6 322 (6.6%) 36 (7.0%) 358 (6.7%)
77 1 (0.0%) 1 (0.2%) 2 (0.0%)
Missing 297 (6.1%) 21 (4.1%) 318 (5.9%)
Systolic: Blood pres (1st rdg) mm Hg
Mean (SD) 122 (17.1) 125 (19.0) 122 (17.3)
Median [Min, Max] 119 [70.0, 229] 121 [66.0, 216] 119 [66.0, 229]
Missing 430 (8.8%) 58 (11.4%) 488 (9.1%)
Diastolic: Blood pres (1st rdg) mm Hg
Mean (SD) 68.9 (12.6) 69.3 (12.4) 68.9 (12.6)
Median [Min, Max] 70.0 [0, 119] 70.0 [0, 104] 70.0 [0, 119]
Missing 430 (8.8%) 58 (11.4%) 488 (9.1%)
Body Mass Index (kg/m**2)
Mean (SD) 28.7 (6.91) 31.6 (9.38) 29.0 (7.23)
Median [Min, Max] 27.5 [14.1, 70.1] 30.4 [15.2, 82.9] 27.7 [14.1, 82.9]
Missing 50 (1.0%) 6 (1.2%) 56 (1.0%)
Annual family income
Mean (SD) 10.7 (13.4) 8.96 (14.7) 10.6 (13.5)
Median [Min, Max] 8.00 [1.00, 99.0] 6.00 [1.00, 99.0] 7.00 [1.00, 99.0]
Missing 44 (0.9%) 8 (1.6%) 52 (1.0%)
Ratio of family income to poverty
Mean (SD) 2.56 (1.66) 1.76 (1.34) 2.49 (1.65)
Median [Min, Max] 2.19 [0, 5.00] 1.27 [0, 5.00] 2.10 [0, 5.00]
Missing 344 (7.1%) 46 (9.0%) 390 (7.3%)
Blood urea nitrogen (mg/dL)
Mean (SD) 13.2 (5.68) 13.5 (8.99) 13.3 (6.08)
Median [Min, Max] 12.0 [1.00, 73.0] 12.0 [2.00, 95.0] 12.0 [1.00, 95.0]
Missing 204 (4.2%) 21 (4.1%) 225 (4.2%)
Creatinine (mg/dL)
Mean (SD) 0.906 (0.431) 0.984 (1.06) 0.914 (0.525)
Median [Min, Max] 0.860 [0.300, 16.6] 0.820 [0.360, 17.4] 0.850 [0.300, 17.4]
Missing 204 (4.2%) 21 (4.1%) 225 (4.2%)
Aspartate aminotransferase AST (U/L)
Mean (SD) 25.2 (18.6) 26.5 (21.3) 25.4 (18.9)
Median [Min, Max] 22.0 [9.00, 882] 22.0 [11.0, 294] 22.0 [9.00, 882]
Missing 206 (4.2%) 21 (4.1%) 227 (4.2%)
Alanine aminotransferase ALT (U/L)
Mean (SD) 24.8 (18.7) 25.5 (21.2) 24.9 (19.0)
Median [Min, Max] 20.0 [6.00, 536] 20.0 [7.00, 300] 20.0 [6.00, 536]
Missing 206 (4.2%) 21 (4.1%) 227 (4.2%)
Apolipoprotein (B) (mg/dL)
Mean (SD) 88.8 (24.7) 93.9 (26.8) 89.2 (25.0)
Median [Min, Max] 87.0 [24.0, 228] 93.0 [20.0, 234] 88.0 [20.0, 234]
Missing 2619 (53.9%) 284 (55.6%) 2903 (54.0%)
Direct HDL-Cholesterol (mg/dL)
Mean (SD) 52.9 (16.0) 51.0 (15.3) 52.7 (15.9)
Median [Min, Max] 50.0 [10.0, 173] 48.0 [22.0, 117] 50.0 [10.0, 173]
Missing 191 (3.9%) 18 (3.5%) 209 (3.9%)
LDL-cholesterol (mg/dL)
Mean (SD) 110 (34.5) 112 (37.2) 110 (34.8)
Median [Min, Max] 107 [14.0, 375] 110 [24.0, 288] 107 [14.0, 375]
Missing 2652 (54.6%) 287 (56.2%) 2939 (54.7%)
Triglyceride (mg/dL)
Mean (SD) 117 (127) 138 (97.5) 119 (125)
Median [Min, Max] 92.0 [14.0, 4230] 115 [21.0, 1000] 94.0 [14.0, 4230]
Missing 2618 (53.9%) 284 (55.6%) 2902 (54.0%)
Total Cholesterol( mg/dL)
Mean (SD) 187 (41.8) 191 (41.5) 188 (41.8)
Median [Min, Max] 184 [82.0, 813] 187 [85.0, 380] 184 [82.0, 813]
Missing 191 (3.9%) 18 (3.5%) 209 (3.9%)
Fasting Glucose (mg/dL)
Mean (SD) 106 (31.8) 115 (42.9) 107 (33.1)
Median [Min, Max] 99.0 [51.0, 405] 102 [67.0, 375] 99.0 [51.0, 405]
Missing 2608 (53.7%) 280 (54.8%) 2888 (53.8%)
Two Hour Glucose(OGTT) (mg/dL)
Mean (SD) 117 (49.2) 126 (51.2) 117 (49.4)
Median [Min, Max] 106 [40.0, 604] 117 [48.0, 352] 107 [40.0, 604]
Missing 3105 (63.9%) 347 (67.9%) 3452 (64.3%)
ALQ101
1 3410 (70.2%) 361 (70.6%) 3771 (70.2%)
2 1443 (29.7%) 148 (29.0%) 1591 (29.6%)
9 6 (0.1%) 2 (0.4%) 8 (0.1%)
Missing 2 (0.0%) 0 (0%) 2 (0.0%)
ALQ110
1 610 (12.5%) 72 (14.1%) 682 (12.7%)
2 836 (17.2%) 78 (15.3%) 914 (17.0%)
9 3 (0.1%) 0 (0%) 3 (0.1%)
Missing 3412 (70.2%) 361 (70.6%) 3773 (70.2%)
SMQ020
1 1966 (40.4%) 287 (56.2%) 2253 (41.9%)
2 2893 (59.5%) 224 (43.8%) 3117 (58.0%)
9 2 (0.0%) 0 (0%) 2 (0.0%)
PAQ650
1 1225 (25.2%) 55 (10.8%) 1280 (23.8%)
2 3636 (74.8%) 456 (89.2%) 4092 (76.2%)
PAQ665
1 2129 (43.8%) 131 (25.6%) 2260 (42.1%)
2 2732 (56.2%) 380 (74.4%) 3112 (57.9%)
Cotinine, Serum (ng/mL)
Mean (SD) 55.0 (129) 100 (161) 59.3 (133)
Median [Min, Max] 0.0330 [0.0110, 1820] 0.245 [0.0110, 1030] 0.0370 [0.0110, 1820]
Missing 189 (3.9%) 19 (3.7%) 208 (3.9%)
Hematocrit (%)
Mean (SD) 21.8 (59.6) 43.9 (76.7) 23.9 (61.7)
Median [Min, Max] 0.0110 [0.0110, 1150] 0.0925 [0.0110, 540] 0.0110 [0.0110, 1150]
Missing 189 (3.9%) 19 (3.7%) 208 (3.9%)
Total Cotinine, urine (ng/mL)
Mean (SD) 660 (1790) 1510 (3170) 730 (1960)
Median [Min, Max] 0.430 [0.0210, 26800] 12.8 [0.0210, 24200] 0.486 [0.0210, 26800]
Missing 3279 (67.5%) 369 (72.2%) 3648 (67.9%)
Total Hydroxycotinine, urine (ng/mL)
Mean (SD) 1300 (4110) 2980 (6040) 1440 (4320)
Median [Min, Max] 0.761 [0.0210, 70600] 17.8 [0.0210, 40400] 0.855 [0.0210, 70600]
Missing 3279 (67.5%) 369 (72.2%) 3648 (67.9%)
db
0 4155 (85.5%) 387 (75.7%) 4542 (84.5%)
1 706 (14.5%) 124 (24.3%) 830 (15.5%)
dyslip
0 1548 (31.8%) 133 (26.0%) 1681 (31.3%)
1 3313 (68.2%) 378 (74.0%) 3691 (68.7%)
hyper
0 3210 (66.0%) 248 (48.5%) 3458 (64.4%)
1 1651 (34.0%) 263 (51.5%) 1914 (35.6%)

7. Descriptive analysis

comp = compareGroups(dp10 ~ age + sex + ethnic + educ + masts + SBP + DBP + BMI + finc  + PIR + 
          BUN + crea + AST + ALT + apoB + HDL + LDL + TG + TC + 
          Glu + tolGlu + ALQ101 + ALQ110 + SMQ020 + PAQ650 + PAQ665 +
          sCOT + sHCOT + uCOT + uHCOT + db + dyslip + hyper , data = tab1)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
createTable(comp)
## 
## --------Summary descriptives table by 'dp10'---------
## 
## ________________________________________________________________________ 
##                                            0            1      p.overall 
##                                          N=4861       N=511              
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## Age in years at screening             47.1 (18.6)  50.2 (17.4)  <0.001   
## sex:                                                            <0.001   
##     1                                 2416 (49.7%) 169 (33.1%)           
##     2                                 2445 (50.3%) 342 (66.9%)           
## ethnic:                                                         <0.001   
##     1                                 676 (13.9%)  77 (15.1%)            
##     2                                 423 (8.70%)  58 (11.4%)            
##     3                                 2091 (43.0%) 224 (43.8%)           
##     4                                 979 (20.1%)  108 (21.1%)           
##     6                                 544 (11.2%)  18 (3.52%)            
##     7                                 148 (3.04%)  26 (5.09%)            
## educ:                                                              .     
##     1                                 293 (6.42%)  64 (13.1%)            
##     2                                 578 (12.7%)  105 (21.4%)           
##     3                                 1012 (22.2%) 118 (24.1%)           
##     4                                 1443 (31.6%) 148 (30.2%)           
##     5                                 1237 (27.1%) 55 (11.2%)            
##     9                                  1 (0.02%)    0 (0.00%)            
## masts:                                                             .     
##     1                                 2449 (53.7%) 188 (38.4%)           
##     2                                 312 (6.84%)  57 (11.6%)            
##     3                                 484 (10.6%)  98 (20.0%)            
##     4                                 124 (2.72%)  27 (5.51%)            
##     5                                 872 (19.1%)  83 (16.9%)            
##     6                                 322 (7.06%)  36 (7.35%)            
##     77                                 1 (0.02%)    1 (0.20%)            
## Systolic: Blood pres (1st rdg) mm Hg   122 (17.1)  125 (19.0)    0.001   
## Diastolic: Blood pres (1st rdg) mm Hg 68.9 (12.6)  69.3 (12.4)   0.538   
## Body Mass Index (kg/m**2)             28.7 (6.91)  31.6 (9.38)  <0.001   
## Annual family income                  10.7 (13.4)  8.96 (14.7)   0.010   
## Ratio of family income to poverty     2.56 (1.66)  1.76 (1.34)  <0.001   
## Blood urea nitrogen (mg/dL)           13.2 (5.68)  13.5 (8.99)   0.543   
## Creatinine (mg/dL)                    0.91 (0.43)  0.98 (1.06)   0.108   
## Aspartate aminotransferase AST (U/L)  25.2 (18.6)  26.5 (21.3)   0.208   
## Alanine aminotransferase ALT (U/L)    24.8 (18.7)  25.5 (21.2)   0.488   
## Apolipoprotein (B) (mg/dL)            88.8 (24.7)  93.9 (26.8)   0.006   
## Direct HDL-Cholesterol (mg/dL)        52.9 (16.0)  51.0 (15.3)   0.010   
## LDL-cholesterol (mg/dL)                110 (34.5)  112 (37.2)    0.397   
## Triglyceride (mg/dL)                   117 (127)   138 (97.5)    0.003   
## Total Cholesterol( mg/dL)              187 (41.8)  191 (41.5)    0.107   
## Fasting Glucose (mg/dL)                106 (31.8)  115 (42.9)    0.001   
## Two Hour Glucose(OGTT) (mg/dL)         117 (49.2)  126 (51.2)    0.026   
## ALQ101:                                                          0.260   
##     1                                 3410 (70.2%) 361 (70.6%)           
##     2                                 1443 (29.7%) 148 (29.0%)           
##     9                                  6 (0.12%)    2 (0.39%)            
## ALQ110:                                                          0.400   
##     1                                 610 (42.1%)  72 (48.0%)            
##     2                                 836 (57.7%)  78 (52.0%)            
##     9                                  3 (0.21%)    0 (0.00%)            
## SMQ020:                                                         <0.001   
##     1                                 1966 (40.4%) 287 (56.2%)           
##     2                                 2893 (59.5%) 224 (43.8%)           
##     9                                  2 (0.04%)    0 (0.00%)            
## PAQ650:                                                         <0.001   
##     1                                 1225 (25.2%) 55 (10.8%)            
##     2                                 3636 (74.8%) 456 (89.2%)           
## PAQ665:                                                         <0.001   
##     1                                 2129 (43.8%) 131 (25.6%)           
##     2                                 2732 (56.2%) 380 (74.4%)           
## Cotinine, Serum (ng/mL)                55.0 (129)   100 (161)   <0.001   
## Hematocrit (%)                        21.8 (59.6)  43.9 (76.7)  <0.001   
## Total Cotinine, urine (ng/mL)          660 (1792)  1511 (3172)   0.002   
## Total Hydroxycotinine, urine (ng/mL)  1301 (4108)  2975 (6038)   0.001   
## db:                                                             <0.001   
##     0                                 4155 (85.5%) 387 (75.7%)           
##     1                                 706 (14.5%)  124 (24.3%)           
## dyslip:                                                          0.008   
##     0                                 1548 (31.8%) 133 (26.0%)           
##     1                                 3313 (68.2%) 378 (74.0%)           
## hyper:                                                          <0.001   
##     0                                 3210 (66.0%) 248 (48.5%)           
##     1                                 1651 (34.0%) 263 (51.5%)           
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
tab = descrTable(dp10 ~ age + sex + ethnic + educ + masts + SBP + DBP + BMI + finc  + PIR + 
          BUN + crea + AST + ALT + apoB + HDL + LDL + TG + TC + 
          Glu + tolGlu + ALQ101 + ALQ110 + SMQ020 + PAQ650 + PAQ665 +
          sCOT + sHCOT + uCOT + uHCOT + db + dyslip + hyper , data = tab1)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
# Example of case-control study: Odds Ratios
descrTable(dp10 ~ ., tab1, show.ratio=TRUE, show.p.overall=FALSE)
## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect

## Warning in chisq.test(xx, correct = FALSE): Chi-squared approximation may be
## incorrect
## 
## --------Summary descriptives table by 'dp10'---------
## 
## _______________________________________________________________________________________ 
##                                            0            1             OR        p.ratio 
##                                          N=4861       N=511                             
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## Age in years at screening             47.1 (18.6)  50.2 (17.4) 1.01 [1.00;1.01] <0.001  
## sex:                                                                                    
##     1                                 2416 (49.7%) 169 (33.1%)       Ref.        Ref.   
##     2                                 2445 (50.3%) 342 (66.9%) 2.00 [1.65;2.43] <0.001  
## ethnic:                                                                                 
##     1                                 676 (13.9%)  77 (15.1%)        Ref.        Ref.   
##     2                                 423 (8.70%)  58 (11.4%)  1.20 [0.84;1.73]  0.317  
##     3                                 2091 (43.0%) 224 (43.8%) 0.94 [0.72;1.24]  0.655  
##     4                                 979 (20.1%)  108 (21.1%) 0.97 [0.71;1.32]  0.836  
##     6                                 544 (11.2%)  18 (3.52%)  0.29 [0.17;0.48] <0.001  
##     7                                 148 (3.04%)  26 (5.09%)  1.55 [0.94;2.47]  0.083  
## educ:                                                                                   
##     1                                 293 (6.42%)  64 (13.1%)        Ref.        Ref.   
##     2                                 578 (12.7%)  105 (21.4%)     . [.;.]         .    
##     3                                 1012 (22.2%) 118 (24.1%)     . [.;.]         .    
##     4                                 1443 (31.6%) 148 (30.2%)     . [.;.]         .    
##     5                                 1237 (27.1%) 55 (11.2%)      . [.;.]         .    
##     9                                  1 (0.02%)    0 (0.00%)      . [.;.]         .    
## masts:                                                                                  
##     1                                 2449 (53.7%) 188 (38.4%)       Ref.        Ref.   
##     2                                 312 (6.84%)  57 (11.6%)  2.38 [1.72;3.26] <0.001  
##     3                                 484 (10.6%)  98 (20.0%)  2.64 [2.02;3.42] <0.001  
##     4                                 124 (2.72%)  27 (5.51%)  2.85 [1.80;4.37] <0.001  
##     5                                 872 (19.1%)  83 (16.9%)  1.24 [0.94;1.62]  0.121  
##     6                                 322 (7.06%)  36 (7.35%)  1.46 [0.99;2.10]  0.056  
##     77                                 1 (0.02%)    1 (0.20%)  13.0 [0.33;506]   0.143  
## Systolic: Blood pres (1st rdg) mm Hg   122 (17.1)  125 (19.0)  1.01 [1.00;1.01] <0.001  
## Diastolic: Blood pres (1st rdg) mm Hg 68.9 (12.6)  69.3 (12.4) 1.00 [0.99;1.01]  0.542  
## Body Mass Index (kg/m**2)             28.7 (6.91)  31.6 (9.38) 1.05 [1.04;1.06] <0.001  
## Annual family income                  10.7 (13.4)  8.96 (14.7) 0.99 [0.98;1.00]  0.007  
## Ratio of family income to poverty     2.56 (1.66)  1.76 (1.34) 0.71 [0.67;0.76] <0.001  
## Blood urea nitrogen (mg/dL)           13.2 (5.68)  13.5 (8.99) 1.01 [0.99;1.02]  0.382  
## Creatinine (mg/dL)                    0.91 (0.43)  0.98 (1.06) 1.18 [1.05;1.34]  0.007  
## Aspartate aminotransferase AST (U/L)  25.2 (18.6)  26.5 (21.3) 1.00 [1.00;1.01]  0.189  
## Alanine aminotransferase ALT (U/L)    24.8 (18.7)  25.5 (21.2) 1.00 [1.00;1.01]  0.445  
## Apolipoprotein (B) (mg/dL)            88.8 (24.7)  93.9 (26.8) 1.01 [1.00;1.01]  0.003  
## Direct HDL-Cholesterol (mg/dL)        52.9 (16.0)  51.0 (15.3) 0.99 [0.99;1.00]  0.012  
## LDL-cholesterol (mg/dL)                110 (34.5)  112 (37.2)  1.00 [1.00;1.01]  0.366  
## Triglyceride (mg/dL)                   117 (127)   138 (97.5)  1.00 [1.00;1.00]  0.052  
## Total Cholesterol( mg/dL)              187 (41.8)  191 (41.5)  1.00 [1.00;1.00]  0.108  
## Fasting Glucose (mg/dL)                106 (31.8)  115 (42.9)  1.01 [1.00;1.01] <0.001  
## Two Hour Glucose(OGTT) (mg/dL)         117 (49.2)  126 (51.2)  1.00 [1.00;1.01]  0.022  
## ALQ101:                                                                                 
##     1                                 3410 (70.2%) 361 (70.6%)       Ref.        Ref.   
##     2                                 1443 (29.7%) 148 (29.0%) 0.97 [0.79;1.18]  0.762  
##     9                                  6 (0.12%)    2 (0.39%)  3.30 [0.44;14.9]  0.209  
## ALQ110:                                                                                 
##     1                                 610 (42.1%)  72 (48.0%)        Ref.        Ref.   
##     2                                 836 (57.7%)  78 (52.0%)      . [.;.]         .    
##     9                                  3 (0.21%)    0 (0.00%)      . [.;.]         .    
## SMQ020:                                                                                 
##     1                                 1966 (40.4%) 287 (56.2%)       Ref.        Ref.   
##     2                                 2893 (59.5%) 224 (43.8%)     . [.;.]         .    
##     9                                  2 (0.04%)    0 (0.00%)      . [.;.]         .    
## PAQ665:                                                                                 
##     1                                 2129 (43.8%) 131 (25.6%)       Ref.        Ref.   
##     2                                 2732 (56.2%) 380 (74.4%) 2.26 [1.84;2.79] <0.001  
## PAQ650:                                                                                 
##     1                                 1225 (25.2%) 55 (10.8%)        Ref.        Ref.   
##     2                                 3636 (74.8%) 456 (89.2%) 2.79 [2.11;3.75] <0.001  
## Cotinine, Serum (ng/mL)                55.0 (129)   100 (161)  1.00 [1.00;1.00] <0.001  
## Hematocrit (%)                        21.8 (59.6)  43.9 (76.7) 1.00 [1.00;1.01] <0.001  
## Total Cotinine, urine (ng/mL)          660 (1792)  1511 (3172) 1.00 [1.00;1.00] <0.001  
## Total Hydroxycotinine, urine (ng/mL)  1301 (4108)  2975 (6038) 1.00 [1.00;1.00] <0.001  
## db:                                                                                     
##     0                                 4155 (85.5%) 387 (75.7%)       Ref.        Ref.   
##     1                                 706 (14.5%)  124 (24.3%) 1.89 [1.51;2.34] <0.001  
## dyslip:                                                                                 
##     0                                 1548 (31.8%) 133 (26.0%)       Ref.        Ref.   
##     1                                 3313 (68.2%) 378 (74.0%) 1.33 [1.08;1.64]  0.006  
## hyper:                                                                                  
##     0                                 3210 (66.0%) 248 (48.5%)       Ref.        Ref.   
##     1                                 1651 (34.0%) 263 (51.5%) 2.06 [1.72;2.48] <0.001  
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
plot(tab["sex"]) # barplot

plot(tab["ethnic"])

plot(tab["educ"])

plot(tab["masts"])

plot(tab["ALQ101"])

plot(tab["ALQ110"])

plot(tab["SMQ020"])

plot(tab["PAQ650"])

plot(tab["PAQ665"])

plot(tab["db"])

plot(tab["dyslip"])

plot(tab["hyper"])

plot(tab["age"]) # histogram and normality plot
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Age in years at screening could not be calculated

plot(tab["SBP"])

plot(tab["DBP"])

plot(tab["finc"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Annual family income could not be calculated

plot(tab["PIR"])

plot(tab["BUN"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Blood urea nitrogen (mg/dL) could not be calculated

plot(tab["crea"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Creatinine (mg/dL) could not be calculated

plot(tab["apoB"])

plot(tab["TC"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Total Cholesterol( mg/dL) could not be calculated

plot(tab["TG"])

plot(tab["LDL"])

plot(tab["HDL"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Direct HDL-Cholesterol (mg/dL) could not be calculated

plot(tab["Glu"])

plot(tab["tolGlu"])

plot(tab["sCOT"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Cotinine, Serum (ng/mL) could not be calculated

plot(tab["sHCOT"])
## Warning in norm.plot(x = x.var, file = file.i, var.label.x = var.labels[i], :
## p-value for normality in Hematocrit (%) could not be calculated

plot(tab["uCOT"])

plot(tab["uHCOT"])

# export2xls(tab, file = "example.xlsx")

export2word(tab, file = "tab_result.docx")

8. Logistic Regression

8.1 Unadjusted model

unadj1 = glm(dp10 ~ sCOT, family = binomial, data = tab1)
unadj2 = glm(dp10 ~ sHCOT, family = binomial, data = tab1)
unadj3 = glm(dp10 ~ uCOT, family = binomial, data = tab1)
unadj4 = glm(dp10 ~ uHCOT, family = binomial, data = tab1)
# Summary the results of logistic regression

summary(unadj1)
## 
## Call:
## glm(formula = dp10 ~ sCOT, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6936  -0.4177  -0.4174  -0.4173   2.2289  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.3969586  0.0541640 -44.254  < 2e-16 ***
## sCOT         0.0019554  0.0002839   6.889 5.62e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3248.9  on 5163  degrees of freedom
## Residual deviance: 3206.4  on 5162  degrees of freedom
##   (208 observations deleted due to missingness)
## AIC: 3210.4
## 
## Number of Fisher Scoring iterations: 5
logistic.display(unadj1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   OR(95%CI)              P(Wald's test) P(LR-test)
## sCOT (cont. var.) 1.002 (1.0014,1.0025)  < 0.001        < 0.001   
##                                                                   
## Log-likelihood = -1603.1901
## No. of observations = 5164
## AIC value = 3210.3801
summary(unadj2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.1650  -0.4223  -0.4220  -0.4220   2.2195  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.3739862  0.0524241 -45.284  < 2e-16 ***
## sHCOT        0.0040145  0.0005863   6.847 7.53e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3248.9  on 5163  degrees of freedom
## Residual deviance: 3205.9  on 5162  degrees of freedom
##   (208 observations deleted due to missingness)
## AIC: 3209.9
## 
## Number of Fisher Scoring iterations: 5
logistic.display(unadj2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    OR(95%CI)              P(Wald's test) P(LR-test)
## sHCOT (cont. var.) 1.004 (1.0029,1.0052)  < 0.001        < 0.001   
##                                                                    
## Log-likelihood = -1602.9731
## No. of observations = 5164
## AIC value = 3209.9462
summary(unadj3)
## 
## Call:
## glm(formula = dp10 ~ uCOT, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7030  -0.3887  -0.3882  -0.3882   2.2904  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.548e+00  9.665e-02 -26.359  < 2e-16 ***
## uCOT         1.392e-04  3.225e-05   4.316 1.59e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 981.00  on 1723  degrees of freedom
## Residual deviance: 963.89  on 1722  degrees of freedom
##   (3648 observations deleted due to missingness)
## AIC: 967.89
## 
## Number of Fisher Scoring iterations: 5
logistic.display(unadj3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   OR(95%CI)               P(Wald's test) P(LR-test)
## uCOT (cont. var.) 1.0001 (1.0001,1.0002)  < 0.001        < 0.001   
##                                                                    
## Log-likelihood = -481.9445
## No. of observations = 1724
## AIC value = 967.889
summary(unadj4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7560  -0.3948  -0.3944  -0.3944   2.2770  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.515e+00  9.431e-02 -26.662  < 2e-16 ***
## uHCOT        5.405e-05  1.416e-05   3.816 0.000135 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 981.00  on 1723  degrees of freedom
## Residual deviance: 967.82  on 1722  degrees of freedom
##   (3648 observations deleted due to missingness)
## AIC: 971.82
## 
## Number of Fisher Scoring iterations: 5
logistic.display(unadj4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    OR(95%CI)          P(Wald's test) P(LR-test)
## uHCOT (cont. var.) 1.0001 (1,1.0001)  < 0.001        < 0.001   
##                                                                
## Log-likelihood = -483.9118
## No. of observations = 1724
## AIC value = 971.8236
ggcoef(unadj1, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)

ggcoef(unadj2, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)

ggcoef(unadj3, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)

ggcoef(unadj4, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)

8.2 Model 1

### Adjust for age, sex

Model1_1 = glm(dp10 ~ sCOT + age + sex, family = binomial, data = tab1)
Model1_2 = glm(dp10 ~ sHCOT + age + sex, family = binomial, data = tab1)
Model1_3 = glm(dp10 ~ uCOT + age + sex, family = binomial, data = tab1)
Model1_4 = glm(dp10 ~ uHCOT + age + sex, family = binomial, data = tab1)

# Summary the results of logistic regression
summary(Model1_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8971  -0.4894  -0.4261  -0.3237   2.5275  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.3075971  0.1607865 -20.571  < 2e-16 ***
## sCOT         0.0023307  0.0002925   7.968 1.61e-15 ***
## age          0.0085565  0.0026608   3.216   0.0013 ** 
## sex2         0.7915051  0.1025770   7.716 1.20e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3248.9  on 5163  degrees of freedom
## Residual deviance: 3132.2  on 5160  degrees of freedom
##   (208 observations deleted due to missingness)
## AIC: 3140.2
## 
## Number of Fisher Scoring iterations: 5
logistic.display(Model1_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)        adj. OR(95%CI)          P(Wald's test)
## sCOT (cont. var.) 1.002 (1.0014,1.0025)  1.0023 (1.0018,1.0029)  < 0.001       
##                                                                                
## age (cont. var.)  1.0079 (1.0028,1.013)  1.0086 (1.0033,1.0139)  0.001         
##                                                                                
## sex: 2 vs 1       2.01 (1.65,2.44)       2.21 (1.8,2.7)          < 0.001       
##                                                                                
##                   P(LR-test)
## sCOT (cont. var.) < 0.001   
##                             
## age (cont. var.)  0.001     
##                             
## sex: 2 vs 1       < 0.001   
##                             
## Log-likelihood = -1566.0897
## No. of observations = 5164
## AIC value = 3140.1794
summary(Model1_2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT + age + sex, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2132  -0.4900  -0.4182  -0.3346   2.4864  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.178005   0.156245 -20.340  < 2e-16 ***
## sHCOT        0.004303   0.000592   7.269 3.62e-13 ***
## age          0.007350   0.002648   2.775  0.00552 ** 
## sex2         0.744043   0.101574   7.325 2.39e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3248.9  on 5163  degrees of freedom
## Residual deviance: 3140.7  on 5160  degrees of freedom
##   (208 observations deleted due to missingness)
## AIC: 3148.7
## 
## Number of Fisher Scoring iterations: 5
logistic.display(Model1_2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)        adj. OR(95%CI)         
## sHCOT (cont. var.) 1.004 (1.0029,1.0052)  1.0043 (1.0031,1.0055) 
##                                                                  
## age (cont. var.)   1.0079 (1.0028,1.013)  1.0074 (1.0022,1.0126) 
##                                                                  
## sex: 2 vs 1        2.01 (1.65,2.44)       2.1 (1.72,2.57)        
##                                                                  
##                    P(Wald's test) P(LR-test)
## sHCOT (cont. var.) < 0.001        < 0.001   
##                                             
## age (cont. var.)   0.006          0.005     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## Log-likelihood = -1570.3586
## No. of observations = 5164
## AIC value = 3148.7172
summary(Model1_3)
## 
## Call:
## glm(formula = dp10 ~ uCOT + age + sex, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7946  -0.4542  -0.3986  -0.3109   2.5367  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.286e+00  2.905e-01 -11.313  < 2e-16 ***
## uCOT         1.650e-04  3.359e-05   4.913 8.98e-07 ***
## age          5.968e-03  4.961e-03   1.203    0.229    
## sex2         7.504e-01  1.883e-01   3.984 6.78e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 981.00  on 1723  degrees of freedom
## Residual deviance: 945.75  on 1720  degrees of freedom
##   (3648 observations deleted due to missingness)
## AIC: 953.75
## 
## Number of Fisher Scoring iterations: 5
logistic.display(Model1_3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## uCOT (cont. var.) 1.0001 (1.0001,1.0002)  1.0002 (1.0001,1.0002) 
##                                                                  
## age (cont. var.)  1.0039 (0.9945,1.0134)  1.006 (0.9963,1.0158)  
##                                                                  
## sex: 2 vs 1       1.87 (1.31,2.67)        2.12 (1.46,3.06)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## uCOT (cont. var.) < 0.001        < 0.001   
##                                            
## age (cont. var.)  0.229          0.229     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## Log-likelihood = -472.8738
## No. of observations = 1724
## AIC value = 953.7476
summary(Model1_4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT + age + sex, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7924  -0.4554  -0.3817  -0.3201   2.4964  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.162e+00  2.820e-01 -11.213  < 2e-16 ***
## uHCOT        6.151e-05  1.440e-05   4.271 1.94e-05 ***
## age          4.806e-03  4.891e-03   0.983 0.325780    
## sex2         7.074e-01  1.864e-01   3.794 0.000148 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 981.00  on 1723  degrees of freedom
## Residual deviance: 951.74  on 1720  degrees of freedom
##   (3648 observations deleted due to missingness)
## AIC: 959.74
## 
## Number of Fisher Scoring iterations: 5
logistic.display(Model1_4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)         adj. OR(95%CI)         
## uHCOT (cont. var.) 1.0001 (1,1.0001)       1.0001 (1,1.0001)      
##                                                                   
## age (cont. var.)   1.0039 (0.9945,1.0134)  1.0048 (0.9952,1.0145) 
##                                                                   
## sex: 2 vs 1        1.87 (1.31,2.67)        2.03 (1.41,2.92)       
##                                                                   
##                    P(Wald's test) P(LR-test)
## uHCOT (cont. var.) < 0.001        < 0.001   
##                                             
## age (cont. var.)   0.326          0.326     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## Log-likelihood = -475.8704
## No. of observations = 1724
## AIC value = 959.7408
# Plot forest
forest_Model1_1 = ggcoef(Model1_1, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model1_1

forest_Model1_2 = ggcoef(Model1_2, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model1_2

forest_Model1_3 = ggcoef(Model1_3, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model1_3

forest_Model1_4 = ggcoef(Model1_4, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model1_4

## 8.3 Model 2

### Adjust  for: age, sex, ethnic group, educ, marrital status

Model2_1 = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts, family = binomial, data = tab1)
Model2_2 = glm(dp10 ~ sHCOT + age + sex + ethnic + educ + masts, family = binomial, data = tab1)
Model2_3 = glm(dp10 ~ uCOT + age + sex + ethnic + educ + masts, family = binomial, data = tab1)
Model2_4 = glm(dp10 ~ uHCOT + age + sex + ethnic + educ + masts, family = binomial, data = tab1)

# Summary the results of logistic regression
summary(Model2_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6250  -0.4800  -0.3730  -0.2796   3.0172  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.604494   0.276464  -9.421  < 2e-16 ***
## sCOT          0.001714   0.000317   5.407 6.41e-08 ***
## age           0.004208   0.003611   1.165  0.24389    
## sex2          0.753555   0.108460   6.948 3.71e-12 ***
## ethnic2       0.299596   0.202146   1.482  0.13832    
## ethnic3       0.158154   0.170276   0.929  0.35299    
## ethnic4       0.081527   0.186236   0.438  0.66156    
## ethnic6      -0.711674   0.296392  -2.401  0.01634 *  
## ethnic7       0.703979   0.279101   2.522  0.01166 *  
## educ2        -0.285626   0.192238  -1.486  0.13733    
## educ3        -0.747469   0.192145  -3.890  0.00010 ***
## educ4        -0.828825   0.187870  -4.412 1.03e-05 ***
## educ5        -1.425360   0.222631  -6.402 1.53e-10 ***
## educ9       -10.703958 324.743793  -0.033  0.97371    
## masts2        0.370365   0.187730   1.973  0.04851 *  
## masts3        0.786668   0.142393   5.525 3.30e-08 ***
## masts4        0.631420   0.239130   2.640  0.00828 ** 
## masts5        0.193217   0.157229   1.229  0.21911    
## masts6        0.188095   0.204951   0.918  0.35875    
## masts77       2.934699   1.431036   2.051  0.04029 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3101.7  on 4878  degrees of freedom
## Residual deviance: 2853.8  on 4859  degrees of freedom
##   (493 observations deleted due to missingness)
## AIC: 2893.8
## 
## Number of Fisher Scoring iterations: 11
logistic.display(Model2_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)              adj. OR(95%CI)              
## sCOT (cont. var.) 1.002 (1.0014,1.0025)        1.0017 (1.0011,1.0023)      
##                                                                            
## age (cont. var.)  1.0074 (1.002,1.0129)        1.0042 (0.9971,1.0113)      
##                                                                            
## sex: 2 vs 1       2.07 (1.69,2.54)             2.12 (1.72,2.63)            
##                                                                            
## ethnic: ref.=1                                                             
##    2              1.29 (0.88,1.88)             1.35 (0.91,2.01)            
##    3              0.96 (0.72,1.29)             1.17 (0.84,1.64)            
##    4              1.06 (0.77,1.47)             1.08 (0.75,1.56)            
##    6              0.29 (0.17,0.51)             0.49 (0.27,0.88)            
##    7              1.57 (0.94,2.62)             2.02 (1.17,3.49)            
##                                                                            
## educ: ref.=1                                                               
##    2              0.85 (0.6,1.21)              0.75 (0.52,1.1)             
##    3              0.54 (0.38,0.76)             0.47 (0.32,0.69)            
##    4              0.49 (0.36,0.68)             0.44 (0.3,0.63)             
##    5              0.21 (0.14,0.31)             0.24 (0.16,0.37)            
##    9              0 (0,4.35136067215608e+271)  0 (0,5.93946849867773e+271) 
##                                                                            
## masts: ref.=1                                                              
##    2              2.3 (1.66,3.19)              1.45 (1,2.09)               
##    3              2.67 (2.04,3.49)             2.2 (1.66,2.9)              
##    4              2.95 (1.88,4.63)             1.88 (1.18,3)               
##    5              1.26 (0.96,1.66)             1.21 (0.89,1.65)            
##    6              1.55 (1.06,2.25)             1.21 (0.81,1.8)             
##    77             13.14 (0.82,211)             18.82 (1.14,310.9)          
##                                                                            
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) < 0.001        < 0.001   
##                                            
## age (cont. var.)  0.244          0.244     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## ethnic: ref.=1                   < 0.001   
##    2              0.138                    
##    3              0.353                    
##    4              0.662                    
##    6              0.016                    
##    7              0.012                    
##                                            
## educ: ref.=1                     < 0.001   
##    2              0.137                    
##    3              < 0.001                  
##    4              < 0.001                  
##    5              < 0.001                  
##    9              0.974                    
##                                            
## masts: ref.=1                    < 0.001   
##    2              0.049                    
##    3              < 0.001                  
##    4              0.008                    
##    5              0.219                    
##    6              0.359                    
##    77             0.04                     
##                                            
## Log-likelihood = -1426.9079
## No. of observations = 4879
## AIC value = 2893.8158
summary(Model2_2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT + age + sex + ethnic + educ + masts, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8117  -0.4797  -0.3681  -0.2821   3.0076  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.533e+00  2.747e-01  -9.223  < 2e-16 ***
## sHCOT        3.055e-03  6.241e-04   4.895 9.84e-07 ***
## age          3.290e-03  3.596e-03   0.915 0.360217    
## sex2         7.195e-01  1.075e-01   6.692 2.21e-11 ***
## ethnic2      3.125e-01  2.018e-01   1.549 0.121420    
## ethnic3      1.832e-01  1.698e-01   1.079 0.280592    
## ethnic4      1.365e-01  1.844e-01   0.740 0.459195    
## ethnic6     -6.832e-01  2.960e-01  -2.308 0.020995 *  
## ethnic7      7.482e-01  2.780e-01   2.691 0.007117 ** 
## educ2       -2.638e-01  1.921e-01  -1.373 0.169702    
## educ3       -7.375e-01  1.922e-01  -3.837 0.000125 ***
## educ4       -8.340e-01  1.880e-01  -4.437 9.10e-06 ***
## educ5       -1.448e+00  2.225e-01  -6.508 7.62e-11 ***
## educ9       -1.075e+01  3.247e+02  -0.033 0.973581    
## masts2       3.585e-01  1.883e-01   1.904 0.056954 .  
## masts3       7.867e-01  1.425e-01   5.522 3.36e-08 ***
## masts4       6.563e-01  2.385e-01   2.751 0.005935 ** 
## masts5       2.087e-01  1.569e-01   1.330 0.183459    
## masts6       1.966e-01  2.048e-01   0.960 0.337170    
## masts77      2.931e+00  1.428e+00   2.052 0.040210 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 3101.7  on 4878  degrees of freedom
## Residual deviance: 2858.6  on 4859  degrees of freedom
##   (493 observations deleted due to missingness)
## AIC: 2898.6
## 
## Number of Fisher Scoring iterations: 11
logistic.display(Model2_2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)              adj. OR(95%CI)              
## sHCOT (cont. var.) 1.004 (1.0028,1.0052)        1.0031 (1.0018,1.0043)      
##                                                                             
## age (cont. var.)   1.0074 (1.002,1.0129)        1.0033 (0.9962,1.0104)      
##                                                                             
## sex: 2 vs 1        2.07 (1.69,2.54)             2.05 (1.66,2.54)            
##                                                                             
## ethnic: ref.=1                                                              
##    2               1.29 (0.88,1.88)             1.37 (0.92,2.03)            
##    3               0.96 (0.72,1.29)             1.2 (0.86,1.68)             
##    4               1.06 (0.77,1.47)             1.15 (0.8,1.65)             
##    6               0.29 (0.17,0.51)             0.51 (0.28,0.9)             
##    7               1.57 (0.94,2.62)             2.11 (1.23,3.64)            
##                                                                             
## educ: ref.=1                                                                
##    2               0.85 (0.6,1.21)              0.77 (0.53,1.12)            
##    3               0.54 (0.38,0.76)             0.48 (0.33,0.7)             
##    4               0.49 (0.36,0.68)             0.43 (0.3,0.63)             
##    5               0.21 (0.14,0.31)             0.24 (0.15,0.36)            
##    9               0 (0,4.35136067215608e+271)  0 (0,5.64549826606785e+271) 
##                                                                             
## masts: ref.=1                                                               
##    2               2.3 (1.66,3.19)              1.43 (0.99,2.07)            
##    3               2.67 (2.04,3.49)             2.2 (1.66,2.9)              
##    4               2.95 (1.88,4.63)             1.93 (1.21,3.08)            
##    5               1.26 (0.96,1.66)             1.23 (0.91,1.68)            
##    6               1.55 (1.06,2.25)             1.22 (0.81,1.82)            
##    77              13.14 (0.82,211)             18.74 (1.14,308.02)         
##                                                                             
##                    P(Wald's test) P(LR-test)
## sHCOT (cont. var.) < 0.001        < 0.001   
##                                             
## age (cont. var.)   0.36           0.361     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## ethnic: ref.=1                    < 0.001   
##    2               0.121                    
##    3               0.281                    
##    4               0.459                    
##    6               0.021                    
##    7               0.007                    
##                                             
## educ: ref.=1                      < 0.001   
##    2               0.17                     
##    3               < 0.001                  
##    4               < 0.001                  
##    5               < 0.001                  
##    9               0.974                    
##                                             
## masts: ref.=1                     < 0.001   
##    2               0.057                    
##    3               < 0.001                  
##    4               0.006                    
##    5               0.183                    
##    6               0.337                    
##    77              0.04                     
##                                             
## Log-likelihood = -1429.318
## No. of observations = 4879
## AIC value = 2898.6359
summary(Model2_3)
## 
## Call:
## glm(formula = dp10 ~ uCOT + age + sex + ethnic + educ + masts, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6941  -0.4599  -0.3359  -0.2395   3.0598  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.687e+00  5.137e-01  -5.230 1.69e-07 ***
## uCOT         1.230e-04  3.613e-05   3.404 0.000664 ***
## age          4.480e-04  6.960e-03   0.064 0.948678    
## sex2         7.430e-01  2.021e-01   3.676 0.000237 ***
## ethnic2      1.622e-01  4.069e-01   0.399 0.690201    
## ethnic3      4.823e-01  3.338e-01   1.445 0.148556    
## ethnic4      6.096e-01  3.569e-01   1.708 0.087605 .  
## ethnic6      6.524e-02  4.847e-01   0.135 0.892937    
## ethnic7      8.495e-01  5.461e-01   1.556 0.119798    
## educ2       -3.808e-01  3.628e-01  -1.050 0.293829    
## educ3       -7.574e-01  3.535e-01  -2.142 0.032162 *  
## educ4       -9.327e-01  3.494e-01  -2.669 0.007605 ** 
## educ5       -2.082e+00  4.537e-01  -4.588 4.46e-06 ***
## masts2       2.385e-01  3.739e-01   0.638 0.523656    
## masts3       8.097e-01  2.616e-01   3.095 0.001967 ** 
## masts4       8.101e-01  4.422e-01   1.832 0.066960 .  
## masts5      -9.335e-03  2.993e-01  -0.031 0.975120    
## masts6       2.498e-01  3.635e-01   0.687 0.491879    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 923.16  on 1611  degrees of freedom
## Residual deviance: 836.36  on 1594  degrees of freedom
##   (3760 observations deleted due to missingness)
## AIC: 872.36
## 
## Number of Fisher Scoring iterations: 6
logistic.display(Model2_3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## uCOT (cont. var.) 1.0001 (1.0001,1.0002)  1.0001 (1.0001,1.0002) 
##                                                                  
## age (cont. var.)  1.0037 (0.9935,1.014)   1.0004 (0.9869,1.0142) 
##                                                                  
## sex: 2 vs 1       1.91 (1.32,2.76)        2.1 (1.41,3.12)        
##                                                                  
## ethnic: ref.=1                                                   
##    2              1.14 (0.53,2.44)        1.18 (0.53,2.61)       
##    3              1.11 (0.64,1.92)        1.62 (0.84,3.12)       
##    4              1.35 (0.74,2.48)        1.84 (0.91,3.7)        
##    6              0.51 (0.21,1.25)        1.07 (0.41,2.76)       
##    7              1.81 (0.68,4.84)        2.34 (0.8,6.82)        
##                                                                  
## educ: ref.=1                                                     
##    2              1.02 (0.54,1.94)        0.68 (0.34,1.39)       
##    3              0.72 (0.39,1.32)        0.47 (0.23,0.94)       
##    4              0.58 (0.33,1.05)        0.39 (0.2,0.78)        
##    5              0.16 (0.07,0.35)        0.12 (0.05,0.3)        
##                                                                  
## masts: ref.=1                                                    
##    2              2.05 (1.05,3.99)        1.27 (0.61,2.64)       
##    3              3.03 (1.86,4.91)        2.25 (1.35,3.75)       
##    4              3.36 (1.49,7.6)         2.25 (0.94,5.35)       
##    5              1.11 (0.6609,1.8643)    0.9907 (0.551,1.7813)  
##    6              1.68 (0.87,3.25)        1.28 (0.63,2.62)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## uCOT (cont. var.) < 0.001        < 0.001   
##                                            
## age (cont. var.)  0.949          0.949     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## ethnic: ref.=1                   0.412     
##    2              0.69                     
##    3              0.149                    
##    4              0.088                    
##    6              0.893                    
##    7              0.12                     
##                                            
## educ: ref.=1                     < 0.001   
##    2              0.294                    
##    3              0.032                    
##    4              0.008                    
##    5              < 0.001                  
##                                            
## masts: ref.=1                    0.036     
##    2              0.524                    
##    3              0.002                    
##    4              0.067                    
##    5              0.975                    
##    6              0.492                    
##                                            
## Log-likelihood = -418.1821
## No. of observations = 1612
## AIC value = 872.3642
summary(Model2_4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT + age + sex + ethnic + educ + masts, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6126  -0.4636  -0.3403  -0.2409   3.0621  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.584e+00  5.093e-01  -5.074 3.90e-07 ***
## uHCOT        4.243e-05  1.532e-05   2.770 0.005614 ** 
## age         -1.258e-03  6.866e-03  -0.183 0.854636    
## sex2         7.151e-01  2.009e-01   3.559 0.000372 ***
## ethnic2      1.877e-01  4.060e-01   0.462 0.643945    
## ethnic3      5.670e-01  3.300e-01   1.718 0.085794 .  
## ethnic4      6.340e-01  3.564e-01   1.779 0.075292 .  
## ethnic6      1.192e-01  4.838e-01   0.246 0.805412    
## ethnic7      9.166e-01  5.441e-01   1.685 0.092046 .  
## educ2       -3.651e-01  3.619e-01  -1.009 0.313075    
## educ3       -7.537e-01  3.530e-01  -2.135 0.032720 *  
## educ4       -9.501e-01  3.491e-01  -2.722 0.006491 ** 
## educ5       -2.126e+00  4.535e-01  -4.688 2.75e-06 ***
## masts2       2.442e-01  3.738e-01   0.653 0.513478    
## masts3       8.099e-01  2.610e-01   3.103 0.001917 ** 
## masts4       8.409e-01  4.432e-01   1.897 0.057771 .  
## masts5      -3.404e-02  2.987e-01  -0.114 0.909263    
## masts6       2.483e-01  3.628e-01   0.684 0.493720    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 923.16  on 1611  degrees of freedom
## Residual deviance: 840.18  on 1594  degrees of freedom
##   (3760 observations deleted due to missingness)
## AIC: 876.18
## 
## Number of Fisher Scoring iterations: 6
logistic.display(Model2_4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)        adj. OR(95%CI)         
## uHCOT (cont. var.) 1.0001 (1,1.0001)      1 (1,1.0001)           
##                                                                  
## age (cont. var.)   1.0037 (0.9935,1.014)  0.9987 (0.9854,1.0123) 
##                                                                  
## sex: 2 vs 1        1.91 (1.32,2.76)       2.04 (1.38,3.03)       
##                                                                  
## ethnic: ref.=1                                                   
##    2               1.14 (0.53,2.44)       1.21 (0.54,2.67)       
##    3               1.11 (0.64,1.92)       1.76 (0.92,3.37)       
##    4               1.35 (0.74,2.48)       1.89 (0.94,3.79)       
##    6               0.51 (0.21,1.25)       1.13 (0.44,2.91)       
##    7               1.81 (0.68,4.84)       2.5 (0.86,7.26)        
##                                                                  
## educ: ref.=1                                                     
##    2               1.02 (0.54,1.94)       0.69 (0.34,1.41)       
##    3               0.72 (0.39,1.32)       0.47 (0.24,0.94)       
##    4               0.58 (0.33,1.05)       0.39 (0.2,0.77)        
##    5               0.16 (0.07,0.35)       0.12 (0.05,0.29)       
##                                                                  
## masts: ref.=1                                                    
##    2               2.05 (1.05,3.99)       1.28 (0.61,2.66)       
##    3               3.03 (1.86,4.91)       2.25 (1.35,3.75)       
##    4               3.36 (1.49,7.6)        2.32 (0.97,5.53)       
##    5               1.11 (0.66,1.86)       0.97 (0.54,1.74)       
##    6               1.68 (0.87,3.25)       1.28 (0.63,2.61)       
##                                                                  
##                    P(Wald's test) P(LR-test)
## uHCOT (cont. var.) 0.006          0.007     
##                                             
## age (cont. var.)   0.855          0.855     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## ethnic: ref.=1                    0.33      
##    2               0.644                    
##    3               0.086                    
##    4               0.075                    
##    6               0.805                    
##    7               0.092                    
##                                             
## educ: ref.=1                      < 0.001   
##    2               0.313                    
##    3               0.033                    
##    4               0.006                    
##    5               < 0.001                  
##                                             
## masts: ref.=1                     0.03      
##    2               0.513                    
##    3               0.002                    
##    4               0.058                    
##    5               0.909                    
##    6               0.494                    
##                                             
## Log-likelihood = -420.0923
## No. of observations = 1612
## AIC value = 876.1845
# Plot forest
forest_Model2_1 = ggcoef(Model2_1, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
forest_Model2_1
## Warning: Removed 1 rows containing missing values (`geom_errorbarh()`).

forest_Model2_2 = ggcoef(Model2_2, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
forest_Model2_2
## Warning: Removed 1 rows containing missing values (`geom_errorbarh()`).

forest_Model2_3 = ggcoef(Model2_3, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model2_3

forest_Model2_4 = ggcoef(Model2_4, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model2_4

### Adjust  for: age, sex, ethnic group, educ, marrital status, finc, PIR
Model2_1_1 = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts + finc + PIR, family = binomial, data = tab1)


# Summary the results of logistic regression
summary(Model2_1_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3297  -0.5007  -0.3551  -0.2398   3.1464  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -1.800e+00  3.305e-01  -5.447 5.13e-08 ***
## sCOT         1.376e-03  3.284e-04   4.189 2.80e-05 ***
## age          2.156e-03  3.853e-03   0.559  0.57584    
## sex2         7.281e-01  1.134e-01   6.418 1.38e-10 ***
## ethnic2      2.444e-01  2.197e-01   1.113  0.26584    
## ethnic3      1.651e-01  1.813e-01   0.911  0.36234    
## ethnic4      6.857e-02  1.974e-01   0.347  0.72839    
## ethnic6     -7.629e-01  3.257e-01  -2.342  0.01916 *  
## ethnic7      7.227e-01  2.907e-01   2.487  0.01290 *  
## educ2       -2.601e-01  2.067e-01  -1.259  0.20814    
## educ3       -5.891e-01  2.058e-01  -2.862  0.00421 ** 
## educ4       -5.949e-01  2.034e-01  -2.924  0.00346 ** 
## educ5       -1.026e+00  2.490e-01  -4.119 3.80e-05 ***
## educ9       -1.086e+01  3.247e+02  -0.033  0.97332    
## masts2       6.916e-02  2.028e-01   0.341  0.73307    
## masts3       4.869e-01  1.567e-01   3.107  0.00189 ** 
## masts4       2.921e-01  2.582e-01   1.131  0.25794    
## masts5      -8.680e-02  1.719e-01  -0.505  0.61352    
## masts6      -2.692e-02  2.175e-01  -0.124  0.90148    
## masts77      3.124e+00  1.425e+00   2.193  0.02834 *  
## finc        -1.094e-01  3.548e-02  -3.084  0.00204 ** 
## PIR          3.413e-02  9.335e-02   0.366  0.71462    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2856.2  on 4528  degrees of freedom
## Residual deviance: 2590.1  on 4507  degrees of freedom
##   (843 observations deleted due to missingness)
## AIC: 2634.1
## 
## Number of Fisher Scoring iterations: 11
logistic.display(Model2_1_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)              adj. OR(95%CI)              
## sCOT (cont. var.) 1.0019 (1.0014,1.0025)       1.0014 (1.0007,1.002)       
##                                                                            
## age (cont. var.)  1.0067 (1.0011,1.0124)       1.0022 (0.9946,1.0098)      
##                                                                            
## sex: 2 vs 1       2.04 (1.65,2.51)             2.07 (1.66,2.59)            
##                                                                            
## ethnic: ref.=1                                                             
##    2              1.23 (0.81,1.85)             1.28 (0.83,1.96)            
##    3              0.98 (0.72,1.34)             1.18 (0.83,1.68)            
##    4              1.07 (0.76,1.52)             1.07 (0.73,1.58)            
##    6              0.26 (0.14,0.48)             0.47 (0.25,0.88)            
##    7              1.67 (0.98,2.84)             2.06 (1.17,3.64)            
##                                                                            
## educ: ref.=1                                                               
##    2              0.86 (0.59,1.26)             0.77 (0.51,1.16)            
##    3              0.56 (0.39,0.81)             0.55 (0.37,0.83)            
##    4              0.52 (0.37,0.73)             0.55 (0.37,0.82)            
##    5              0.21 (0.14,0.32)             0.36 (0.22,0.58)            
##    9              0 (0,4.48617189068007e+271)  0 (0,5.08287444546071e+271) 
##                                                                            
## masts: ref.=1                                                              
##    2              2.21 (1.56,3.13)             1.07 (0.72,1.59)            
##    3              2.72 (2.06,3.58)             1.63 (1.2,2.21)             
##    4              2.83 (1.76,4.56)             1.34 (0.81,2.22)            
##    5              1.27 (0.95,1.69)             0.92 (0.65,1.28)            
##    6              1.63 (1.1,2.4)               0.97 (0.64,1.49)            
##    77             13.41 (0.83,215.34)          22.74 (1.39,371.28)         
##                                                                            
## finc (cont. var.) 0.86 (0.84,0.88)             0.9 (0.84,0.96)             
##                                                                            
## PIR (cont. var.)  0.69 (0.65,0.75)             1.03 (0.86,1.24)            
##                                                                            
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) < 0.001        < 0.001   
##                                            
## age (cont. var.)  0.576          0.576     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## ethnic: ref.=1                   0.002     
##    2              0.266                    
##    3              0.362                    
##    4              0.728                    
##    6              0.019                    
##    7              0.013                    
##                                            
## educ: ref.=1                     < 0.001   
##    2              0.208                    
##    3              0.004                    
##    4              0.003                    
##    5              < 0.001                  
##    9              0.973                    
##                                            
## masts: ref.=1                    0.01      
##    2              0.733                    
##    3              0.002                    
##    4              0.258                    
##    5              0.614                    
##    6              0.901                    
##    77             0.028                    
##                                            
## finc (cont. var.) 0.002          0.002     
##                                            
## PIR (cont. var.)  0.715          0.715     
##                                            
## Log-likelihood = -1295.029
## No. of observations = 4529
## AIC value = 2634.0579

8.4 Model 3

### Adjust  for: age, sex, ethnic group, educ, marrital status + finc + PIR + smoking + alcohol + physical activity

Model3_1 = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, data = tab1)
Model3_2 = glm(dp10 ~ sHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, data = tab1)
Model3_3 = glm(dp10 ~ uCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, data = tab1)
Model3_4 = glm(dp10 ~ uHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, data = tab1)

# Summary the results of logistic regression
summary(Model3_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, 
##     data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1918  -0.4903  -0.3471  -0.2203   3.2194  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.233e+00  3.762e-01  -5.936 2.93e-09 ***
## sCOT         9.100e-04  3.614e-04   2.518 0.011807 *  
## age         -1.115e-03  4.012e-03  -0.278 0.781080    
## sex2         7.814e-01  1.180e-01   6.621 3.56e-11 ***
## ethnic2      2.336e-01  2.211e-01   1.056 0.290847    
## ethnic3      9.024e-02  1.827e-01   0.494 0.621453    
## ethnic4      6.395e-02  1.986e-01   0.322 0.747417    
## ethnic6     -7.030e-01  3.271e-01  -2.149 0.031636 *  
## ethnic7      6.610e-01  2.956e-01   2.236 0.025360 *  
## educ2       -2.809e-01  2.087e-01  -1.346 0.178338    
## educ3       -5.683e-01  2.082e-01  -2.730 0.006341 ** 
## educ4       -5.360e-01  2.059e-01  -2.603 0.009243 ** 
## educ5       -8.629e-01  2.519e-01  -3.426 0.000613 ***
## educ9       -1.197e+01  5.354e+02  -0.022 0.982166    
## masts2       1.016e-01  2.042e-01   0.497 0.618939    
## masts3       4.718e-01  1.590e-01   2.967 0.003006 ** 
## masts4       2.602e-01  2.605e-01   0.999 0.317830    
## masts5      -9.140e-02  1.737e-01  -0.526 0.598833    
## masts6      -9.277e-02  2.199e-01  -0.422 0.673170    
## masts77      3.176e+00  1.491e+00   2.130 0.033164 *  
## finc        -1.063e-01  3.589e-02  -2.962 0.003059 ** 
## PIR          4.615e-02  9.437e-02   0.489 0.624787    
## SMQ0202     -2.672e-01  1.259e-01  -2.123 0.033796 *  
## SMQ0209     -1.167e+01  3.767e+02  -0.031 0.975285    
## ALQ1012     -2.165e-01  1.326e-01  -1.632 0.102615    
## ALQ1019      9.603e-01  8.475e-01   1.133 0.257213    
## PAQ6652      5.203e-01  1.210e-01   4.301 1.70e-05 ***
## PAQ6502      4.705e-01  1.757e-01   2.678 0.007397 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2856.0  on 4527  degrees of freedom
## Residual deviance: 2544.4  on 4500  degrees of freedom
##   (844 observations deleted due to missingness)
## AIC: 2600.4
## 
## Number of Fisher Scoring iterations: 12
logistic.display(Model3_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)              adj. OR(95%CI)         
## sCOT (cont. var.) 1.0019 (1.0014,1.0025)       1.0009 (1.0002,1.0016) 
##                                                                       
## age (cont. var.)  1.0068 (1.0011,1.0125)       0.9989 (0.9911,1.0068) 
##                                                                       
## sex: 2 vs 1       2.04 (1.65,2.51)             2.18 (1.73,2.75)       
##                                                                       
## ethnic: ref.=1                                                        
##    2              1.23 (0.81,1.85)             1.26 (0.82,1.95)       
##    3              0.99 (0.72,1.34)             1.09 (0.76,1.57)       
##    4              1.07 (0.76,1.52)             1.07 (0.72,1.57)       
##    6              0.26 (0.14,0.48)             0.5 (0.26,0.94)        
##    7              1.67 (0.98,2.84)             1.94 (1.08,3.46)       
##                                                                       
## educ: ref.=1                                                          
##    2              0.86 (0.59,1.26)             0.76 (0.5,1.14)        
##    3              0.56 (0.39,0.81)             0.57 (0.38,0.85)       
##    4              0.52 (0.37,0.73)             0.59 (0.39,0.88)       
##    5              0.21 (0.14,0.32)             0.42 (0.26,0.69)       
##    9              0 (0,4.48617189182557e+271)  0 (0,Inf)              
##                                                                       
## masts: ref.=1                                                         
##    2              2.21 (1.56,3.13)             1.11 (0.74,1.65)       
##    3              2.72 (2.06,3.58)             1.6 (1.17,2.19)        
##    4              2.83 (1.76,4.56)             1.3 (0.78,2.16)        
##    5              1.27 (0.95,1.69)             0.91 (0.65,1.28)       
##    6              1.63 (1.1,2.4)               0.91 (0.59,1.4)        
##    77             13.4 (0.83,215.25)           23.94 (1.29,444.72)    
##                                                                       
## finc (cont. var.) 0.86 (0.84,0.88)             0.9 (0.84,0.96)        
##                                                                       
## PIR (cont. var.)  0.69 (0.65,0.75)             1.05 (0.87,1.26)       
##                                                                       
## SMQ020: ref.=1                                                        
##    2              0.54 (0.44,0.66)             0.77 (0.6,0.98)        
##    9              0 (0,6.98824325679386e+190)  0 (0,Inf)              
##                                                                       
## ALQ101: ref.=1                                                        
##    2              0.96 (0.76,1.2)              0.81 (0.62,1.04)       
##    9              3.12 (0.63,15.54)            2.61 (0.5,13.75)       
##                                                                       
## PAQ665: 2 vs 1    2.24 (1.79,2.8)              1.68 (1.33,2.13)       
##                                                                       
## PAQ650: 2 vs 1    2.75 (2.01,3.78)             1.6 (1.13,2.26)        
##                                                                       
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) 0.012          0.014     
##                                            
## age (cont. var.)  0.781          0.781     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## ethnic: ref.=1                   0.01      
##    2              0.291                    
##    3              0.621                    
##    4              0.747                    
##    6              0.032                    
##    7              0.025                    
##                                            
## educ: ref.=1                     0.014     
##    2              0.178                    
##    3              0.006                    
##    4              0.009                    
##    5              < 0.001                  
##    9              0.982                    
##                                            
## masts: ref.=1                    0.015     
##    2              0.619                    
##    3              0.003                    
##    4              0.318                    
##    5              0.599                    
##    6              0.673                    
##    77             0.033                    
##                                            
## finc (cont. var.) 0.003          0.003     
##                                            
## PIR (cont. var.)  0.625          0.625     
##                                            
## SMQ020: ref.=1                   0.081     
##    2              0.034                    
##    9              0.975                    
##                                            
## ALQ101: ref.=1                   0.138     
##    2              0.103                    
##    9              0.257                    
##                                            
## PAQ665: 2 vs 1    < 0.001        < 0.001   
##                                            
## PAQ650: 2 vs 1    0.007          0.005     
##                                            
## Log-likelihood = -1272.2219
## No. of observations = 4528
## AIC value = 2600.4438
summary(Model3_2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, 
##     data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2018  -0.4888  -0.3477  -0.2214   3.2088  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.182e+00  3.735e-01  -5.841 5.19e-09 ***
## sHCOT        1.623e-03  6.863e-04   2.364 0.018059 *  
## age         -1.724e-03  3.993e-03  -0.432 0.665909    
## sex2         7.668e-01  1.176e-01   6.519 7.08e-11 ***
## ethnic2      2.379e-01  2.209e-01   1.077 0.281700    
## ethnic3      9.809e-02  1.825e-01   0.538 0.590891    
## ethnic4      9.160e-02  1.969e-01   0.465 0.641697    
## ethnic6     -6.873e-01  3.268e-01  -2.103 0.035457 *  
## ethnic7      6.776e-01  2.951e-01   2.296 0.021677 *  
## educ2       -2.695e-01  2.086e-01  -1.292 0.196401    
## educ3       -5.626e-01  2.082e-01  -2.702 0.006883 ** 
## educ4       -5.366e-01  2.059e-01  -2.606 0.009166 ** 
## educ5       -8.669e-01  2.519e-01  -3.442 0.000578 ***
## educ9       -1.198e+01  5.354e+02  -0.022 0.982154    
## masts2       9.408e-02  2.045e-01   0.460 0.645461    
## masts3       4.687e-01  1.591e-01   2.945 0.003227 ** 
## masts4       2.706e-01  2.604e-01   1.039 0.298616    
## masts5      -8.383e-02  1.737e-01  -0.483 0.629344    
## masts6      -8.817e-02  2.199e-01  -0.401 0.688491    
## masts77      3.172e+00  1.498e+00   2.117 0.034226 *  
## finc        -1.059e-01  3.591e-02  -2.949 0.003192 ** 
## PIR          4.513e-02  9.445e-02   0.478 0.632807    
## SMQ0202     -2.946e-01  1.232e-01  -2.392 0.016749 *  
## SMQ0209     -1.169e+01  3.770e+02  -0.031 0.975256    
## ALQ1012     -2.116e-01  1.326e-01  -1.596 0.110593    
## ALQ1019      9.496e-01  8.486e-01   1.119 0.263134    
## PAQ6652      5.251e-01  1.209e-01   4.342 1.41e-05 ***
## PAQ6502      4.719e-01  1.756e-01   2.686 0.007222 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2856.0  on 4527  degrees of freedom
## Residual deviance: 2545.2  on 4500  degrees of freedom
##   (844 observations deleted due to missingness)
## AIC: 2601.2
## 
## Number of Fisher Scoring iterations: 12
logistic.display(Model3_2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)              adj. OR(95%CI)         
## sHCOT (cont. var.) 1.0039 (1.0027,1.0051)       1.0016 (1.0003,1.003)  
##                                                                        
## age (cont. var.)   1.0068 (1.0011,1.0125)       0.9983 (0.9905,1.0061) 
##                                                                        
## sex: 2 vs 1        2.04 (1.65,2.51)             2.15 (1.71,2.71)       
##                                                                        
## ethnic: ref.=1                                                         
##    2               1.23 (0.81,1.85)             1.27 (0.82,1.96)       
##    3               0.99 (0.72,1.34)             1.1 (0.77,1.58)        
##    4               1.07 (0.76,1.52)             1.1 (0.75,1.61)        
##    6               0.26 (0.14,0.48)             0.5 (0.27,0.95)        
##    7               1.67 (0.98,2.84)             1.97 (1.1,3.51)        
##                                                                        
## educ: ref.=1                                                           
##    2               0.86 (0.59,1.26)             0.76 (0.51,1.15)       
##    3               0.56 (0.39,0.81)             0.57 (0.38,0.86)       
##    4               0.52 (0.37,0.73)             0.58 (0.39,0.88)       
##    5               0.21 (0.14,0.32)             0.42 (0.26,0.69)       
##    9               0 (0,4.48617189182557e+271)  0 (0,Inf)              
##                                                                        
## masts: ref.=1                                                          
##    2               2.21 (1.56,3.13)             1.1 (0.74,1.64)        
##    3               2.72 (2.06,3.58)             1.6 (1.17,2.18)        
##    4               2.83 (1.76,4.56)             1.31 (0.79,2.18)       
##    5               1.27 (0.95,1.69)             0.92 (0.65,1.29)       
##    6               1.63 (1.1,2.4)               0.92 (0.59,1.41)       
##    77              13.4 (0.83,215.25)           23.85 (1.27,449.2)     
##                                                                        
## finc (cont. var.)  0.86 (0.84,0.88)             0.9 (0.84,0.97)        
##                                                                        
## PIR (cont. var.)   0.69 (0.65,0.75)             1.05 (0.87,1.26)       
##                                                                        
## SMQ020: ref.=1                                                         
##    2               0.54 (0.44,0.66)             0.74 (0.59,0.95)       
##    9               0 (0,6.98824325679386e+190)  0 (0,Inf)              
##                                                                        
## ALQ101: ref.=1                                                         
##    2               0.96 (0.76,1.2)              0.81 (0.62,1.05)       
##    9               3.12 (0.63,15.54)            2.58 (0.49,13.64)      
##                                                                        
## PAQ665: 2 vs 1     2.24 (1.79,2.8)              1.69 (1.33,2.14)       
##                                                                        
## PAQ650: 2 vs 1     2.75 (2.01,3.78)             1.6 (1.14,2.26)        
##                                                                        
##                    P(Wald's test) P(LR-test)
## sHCOT (cont. var.) 0.018          0.022     
##                                             
## age (cont. var.)   0.666          0.666     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## ethnic: ref.=1                    0.011     
##    2               0.282                    
##    3               0.591                    
##    4               0.642                    
##    6               0.035                    
##    7               0.022                    
##                                             
## educ: ref.=1                      0.012     
##    2               0.196                    
##    3               0.007                    
##    4               0.009                    
##    5               < 0.001                  
##    9               0.982                    
##                                             
## masts: ref.=1                     0.016     
##    2               0.645                    
##    3               0.003                    
##    4               0.299                    
##    5               0.629                    
##    6               0.688                    
##    77              0.034                    
##                                             
## finc (cont. var.)  0.003          0.003     
##                                             
## PIR (cont. var.)   0.633          0.633     
##                                             
## SMQ020: ref.=1                    0.044     
##    2               0.017                    
##    9               0.975                    
##                                             
## ALQ101: ref.=1                    0.149     
##    2               0.111                    
##    9               0.263                    
##                                             
## PAQ665: 2 vs 1     < 0.001        < 0.001   
##                                             
## PAQ650: 2 vs 1     0.007          0.005     
##                                             
## Log-likelihood = -1272.618
## No. of observations = 4528
## AIC value = 2601.236
summary(Model3_3)
## 
## Call:
## glm(formula = dp10 ~ uCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, 
##     data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3379  -0.4374  -0.3016  -0.1764   3.0384  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -1.790e+00  7.284e-01  -2.457  0.01401 *  
## uCOT         1.092e-04  3.758e-05   2.907  0.00365 ** 
## age         -4.794e-03  7.712e-03  -0.622  0.53417    
## sex2         9.486e-01  2.250e-01   4.215  2.5e-05 ***
## ethnic2     -9.306e-02  4.646e-01  -0.200  0.84123    
## ethnic3      1.960e-01  3.640e-01   0.538  0.59031    
## ethnic4      3.789e-01  3.875e-01   0.978  0.32809    
## ethnic6     -1.250e-01  6.091e-01  -0.205  0.83739    
## ethnic7      5.081e-01  5.764e-01   0.882  0.37800    
## educ2       -3.633e-01  4.225e-01  -0.860  0.38996    
## educ3       -4.660e-01  4.078e-01  -1.143  0.25316    
## educ4       -4.845e-01  4.078e-01  -1.188  0.23486    
## educ5       -1.324e+00  5.179e-01  -2.557  0.01057 *  
## masts2       5.711e-02  4.059e-01   0.141  0.88811    
## masts3       4.540e-01  2.926e-01   1.552  0.12069    
## masts4       1.095e-02  5.510e-01   0.020  0.98415    
## masts5      -3.056e-01  3.299e-01  -0.926  0.35438    
## masts6      -1.623e-01  3.953e-01  -0.411  0.68135    
## finc        -1.750e-01  6.979e-02  -2.508  0.01215 *  
## PIR          1.427e-01  1.734e-01   0.823  0.41058    
## SMQ0202     -2.785e-01  2.304e-01  -1.209  0.22679    
## ALQ1012     -5.690e-01  2.673e-01  -2.128  0.03331 *  
## ALQ1019      2.613e+00  1.574e+00   1.660  0.09688 .  
## PAQ6652      4.716e-01  2.272e-01   2.076  0.03788 *  
## PAQ6502      1.874e-01  3.214e-01   0.583  0.55989    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 841.69  on 1502  degrees of freedom
## Residual deviance: 726.01  on 1478  degrees of freedom
##   (3869 observations deleted due to missingness)
## AIC: 776.01
## 
## Number of Fisher Scoring iterations: 6
logistic.display(Model3_3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## uCOT (cont. var.) 1.0001 (1.0001,1.0002)  1.0001 (1,1.0002)      
##                                                                  
## age (cont. var.)  1.0027 (0.992,1.0135)   0.9952 (0.9803,1.0104) 
##                                                                  
## sex: 2 vs 1       1.97 (1.34,2.91)        2.58 (1.66,4.01)       
##                                                                  
## ethnic: ref.=1                                                   
##    2              1.01 (0.43,2.39)        0.91 (0.37,2.26)       
##    3              1.2 (0.67,2.16)         1.22 (0.6,2.48)        
##    4              1.37 (0.71,2.64)        1.46 (0.68,3.12)       
##    6              0.33 (0.11,1.02)        0.88 (0.27,2.91)       
##    7              2.01 (0.73,5.51)        1.66 (0.54,5.14)       
##                                                                  
## educ: ref.=1                                                     
##    2              1.08 (0.52,2.24)        0.7 (0.3,1.59)         
##    3              0.89 (0.45,1.76)        0.63 (0.28,1.4)        
##    4              0.73 (0.38,1.42)        0.62 (0.28,1.37)       
##    5              0.2 (0.08,0.46)         0.27 (0.1,0.73)        
##                                                                  
## masts: ref.=1                                                    
##    2              2.16 (1.08,4.35)        1.06 (0.48,2.35)       
##    3              3.3 (1.99,5.46)         1.57 (0.89,2.79)       
##    4              2.46 (0.92,6.6)         1.01 (0.34,2.98)       
##    5              1.28 (0.75,2.17)        0.74 (0.39,1.41)       
##    6              1.69 (0.84,3.37)        0.85 (0.39,1.84)       
##                                                                  
## finc (cont. var.) 0.84 (0.8,0.89)         0.84 (0.73,0.96)       
##                                                                  
## PIR (cont. var.)  0.67 (0.58,0.76)        1.15 (0.82,1.62)       
##                                                                  
## SMQ020: 2 vs 1    0.46 (0.32,0.68)        0.76 (0.48,1.19)       
##                                                                  
## ALQ101: ref.=1                                                   
##    2              0.7 (0.44,1.11)         0.57 (0.34,0.96)       
##    9              10.58 (0.66,170.54)     13.65 (0.62,298.53)    
##                                                                  
## PAQ665: 2 vs 1    1.99 (1.32,2.99)        1.6 (1.03,2.5)         
##                                                                  
## PAQ650: 2 vs 1    2.35 (1.33,4.16)        1.21 (0.64,2.26)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## uCOT (cont. var.) 0.004          0.007     
##                                            
## age (cont. var.)  0.534          0.534     
##                                            
## sex: 2 vs 1       < 0.001        < 0.001   
##                                            
## ethnic: ref.=1                   0.791     
##    2              0.841                    
##    3              0.59                     
##    4              0.328                    
##    6              0.837                    
##    7              0.378                    
##                                            
## educ: ref.=1                     0.085     
##    2              0.39                     
##    3              0.253                    
##    4              0.235                    
##    5              0.011                    
##                                            
## masts: ref.=1                    0.368     
##    2              0.888                    
##    3              0.121                    
##    4              0.984                    
##    5              0.354                    
##    6              0.681                    
##                                            
## finc (cont. var.) 0.012          0.01      
##                                            
## PIR (cont. var.)  0.411          0.412     
##                                            
## SMQ020: 2 vs 1    0.227          0.225     
##                                            
## ALQ101: ref.=1                   0.024     
##    2              0.033                    
##    9              0.097                    
##                                            
## PAQ665: 2 vs 1    0.038          0.034     
##                                            
## PAQ650: 2 vs 1    0.56           0.555     
##                                            
## Log-likelihood = -363.006
## No. of observations = 1503
## AIC value = 776.012
summary(Model3_4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650, family = binomial, 
##     data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3394  -0.4427  -0.3030  -0.1762   3.0726  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -1.713e+00  7.265e-01  -2.358  0.01838 *  
## uHCOT        3.749e-05  1.593e-05   2.354  0.01858 *  
## age         -6.734e-03  7.597e-03  -0.886  0.37538    
## sex2         9.217e-01  2.236e-01   4.123 3.74e-05 ***
## ethnic2     -7.080e-02  4.637e-01  -0.153  0.87865    
## ethnic3      2.750e-01  3.598e-01   0.764  0.44460    
## ethnic4      4.026e-01  3.871e-01   1.040  0.29827    
## ethnic6     -7.212e-02  6.082e-01  -0.119  0.90561    
## ethnic7      5.624e-01  5.754e-01   0.977  0.32841    
## educ2       -3.392e-01  4.211e-01  -0.805  0.42053    
## educ3       -4.550e-01  4.064e-01  -1.120  0.26278    
## educ4       -4.904e-01  4.067e-01  -1.206  0.22788    
## educ5       -1.340e+00  5.179e-01  -2.587  0.00969 ** 
## masts2       6.109e-02  4.061e-01   0.150  0.88041    
## masts3       4.515e-01  2.925e-01   1.544  0.12263    
## masts4       3.781e-02  5.509e-01   0.069  0.94529    
## masts5      -3.373e-01  3.297e-01  -1.023  0.30627    
## masts6      -1.728e-01  3.944e-01  -0.438  0.66125    
## finc        -1.707e-01  6.979e-02  -2.446  0.01445 *  
## PIR          1.295e-01  1.732e-01   0.748  0.45474    
## SMQ0202     -3.106e-01  2.300e-01  -1.350  0.17688    
## ALQ1012     -5.580e-01  2.670e-01  -2.089  0.03666 *  
## ALQ1019      2.762e+00  1.531e+00   1.804  0.07118 .  
## PAQ6652      4.853e-01  2.270e-01   2.138  0.03252 *  
## PAQ6502      2.247e-01  3.207e-01   0.701  0.48358    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 841.69  on 1502  degrees of freedom
## Residual deviance: 728.67  on 1478  degrees of freedom
##   (3869 observations deleted due to missingness)
## AIC: 778.67
## 
## Number of Fisher Scoring iterations: 6
logistic.display(Model3_4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)        adj. OR(95%CI)         
## uHCOT (cont. var.) 1.0001 (1,1.0001)      1 (1,1.0001)           
##                                                                  
## age (cont. var.)   1.0027 (0.992,1.0135)  0.9933 (0.9786,1.0082) 
##                                                                  
## sex: 2 vs 1        1.97 (1.34,2.91)       2.51 (1.62,3.9)        
##                                                                  
## ethnic: ref.=1                                                   
##    2               1.01 (0.43,2.39)       0.93 (0.38,2.31)       
##    3               1.2 (0.67,2.16)        1.32 (0.65,2.66)       
##    4               1.37 (0.71,2.64)       1.5 (0.7,3.19)         
##    6               0.33 (0.11,1.02)       0.93 (0.28,3.06)       
##    7               2.01 (0.73,5.51)       1.75 (0.57,5.42)       
##                                                                  
## educ: ref.=1                                                     
##    2               1.08 (0.52,2.24)       0.71 (0.31,1.63)       
##    3               0.89 (0.45,1.76)       0.63 (0.29,1.41)       
##    4               0.73 (0.38,1.42)       0.61 (0.28,1.36)       
##    5               0.2 (0.08,0.46)        0.26 (0.09,0.72)       
##                                                                  
## masts: ref.=1                                                    
##    2               2.16 (1.08,4.35)       1.06 (0.48,2.36)       
##    3               3.3 (1.99,5.46)        1.57 (0.89,2.79)       
##    4               2.46 (0.92,6.6)        1.04 (0.35,3.06)       
##    5               1.28 (0.75,2.17)       0.71 (0.37,1.36)       
##    6               1.69 (0.84,3.37)       0.84 (0.39,1.82)       
##                                                                  
## finc (cont. var.)  0.84 (0.8,0.89)        0.84 (0.74,0.97)       
##                                                                  
## PIR (cont. var.)   0.67 (0.58,0.76)       1.14 (0.81,1.6)        
##                                                                  
## SMQ020: 2 vs 1     0.46 (0.32,0.68)       0.73 (0.47,1.15)       
##                                                                  
## ALQ101: ref.=1                                                   
##    2               0.7 (0.44,1.11)        0.57 (0.34,0.97)       
##    9               10.58 (0.66,170.54)    15.83 (0.79,318.09)    
##                                                                  
## PAQ665: 2 vs 1     1.99 (1.32,2.99)       1.62 (1.04,2.53)       
##                                                                  
## PAQ650: 2 vs 1     2.35 (1.33,4.16)       1.25 (0.67,2.35)       
##                                                                  
##                    P(Wald's test) P(LR-test)
## uHCOT (cont. var.) 0.019          0.031     
##                                             
## age (cont. var.)   0.375          0.374     
##                                             
## sex: 2 vs 1        < 0.001        < 0.001   
##                                             
## ethnic: ref.=1                    0.769     
##    2               0.879                    
##    3               0.445                    
##    4               0.298                    
##    6               0.906                    
##    7               0.328                    
##                                             
## educ: ref.=1                      0.075     
##    2               0.421                    
##    3               0.263                    
##    4               0.228                    
##    5               0.01                     
##                                             
## masts: ref.=1                     0.332     
##    2               0.88                     
##    3               0.123                    
##    4               0.945                    
##    5               0.306                    
##    6               0.661                    
##                                             
## finc (cont. var.)  0.014          0.012     
##                                             
## PIR (cont. var.)   0.455          0.456     
##                                             
## SMQ020: 2 vs 1     0.177          0.175     
##                                             
## ALQ101: ref.=1                    0.023     
##    2               0.037                    
##    9               0.071                    
##                                             
## PAQ665: 2 vs 1     0.033          0.029     
##                                             
## PAQ650: 2 vs 1     0.484          0.476     
##                                             
## Log-likelihood = -364.3357
## No. of observations = 1503
## AIC value = 778.6713
# Plot forest
forest_Model3_1 = ggcoef(Model3_1, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
forest_Model3_1
## Warning: Removed 2 rows containing missing values (`geom_errorbarh()`).

forest_Model3_2 = ggcoef(Model3_2, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
forest_Model3_2
## Warning: Removed 2 rows containing missing values (`geom_errorbarh()`).

forest_Model3_3 = ggcoef(Model3_3, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model3_3

forest_Model3_4 = ggcoef(Model3_4, exponentiate=T, exclude_intercept=T, vline_color = "red", 
       errorbar_color = "blue", errorbar_height = 0.10)
forest_Model3_4

8.5 Model 4

### Adjust  for: age, sex, ethnic group, educ, marrital status + finc + PIR + smoking + alcohol + physical activity + BMI + SBP + DBP + AST + ALT + BUN + Crea + TC + TG + HDL + LDL + ApoB

Model4_1 = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, family = binomial, data = tab1)

Model4_2 = glm(dp10 ~ sHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 +BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, family = binomial, data = tab1)

Model4_3 = glm(dp10 ~ uCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, family = binomial, data = tab1)

Model4_4 = glm(dp10 ~ uHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, family = binomial, data = tab1)

# Summary the results of logistic regression
summary(Model4_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5728  -0.4601  -0.3057  -0.1827   3.3954  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -5.487e+00  1.043e+00  -5.261 1.43e-07 ***
## sCOT         1.045e-03  5.634e-04   1.855 0.063664 .  
## age          5.114e-03  7.485e-03   0.683 0.494423    
## sex2         5.876e-01  2.094e-01   2.806 0.005022 ** 
## ethnic2      2.680e-01  3.527e-01   0.760 0.447227    
## ethnic3      1.287e-01  2.892e-01   0.445 0.656257    
## ethnic4      8.379e-02  3.364e-01   0.249 0.803298    
## ethnic6     -5.808e-01  5.335e-01  -1.089 0.276333    
## ethnic7      8.288e-02  6.315e-01   0.131 0.895596    
## educ2       -1.729e-01  3.483e-01  -0.496 0.619681    
## educ3       -4.452e-01  3.498e-01  -1.273 0.203156    
## educ4       -1.878e-01  3.381e-01  -0.555 0.578622    
## educ5       -4.198e-01  4.090e-01  -1.026 0.304714    
## educ9       -1.383e+01  8.827e+02  -0.016 0.987501    
## masts2       2.090e-01  3.212e-01   0.651 0.515368    
## masts3       4.968e-01  2.485e-01   1.999 0.045572 *  
## masts4       1.148e-01  4.369e-01   0.263 0.792768    
## masts5      -2.976e-01  2.969e-01  -1.002 0.316107    
## masts6      -2.532e-01  3.630e-01  -0.698 0.485352    
## finc        -9.181e-02  5.722e-02  -1.604 0.108615    
## PIR         -8.402e-02  1.502e-01  -0.559 0.576013    
## SMQ0202     -1.426e-01  1.950e-01  -0.731 0.464490    
## SMQ0209     -1.259e+01  8.827e+02  -0.014 0.988623    
## ALQ1012     -1.826e-01  2.120e-01  -0.861 0.389174    
## ALQ1019     -1.202e+01  4.362e+02  -0.028 0.978023    
## PAQ6652      5.995e-01  1.967e-01   3.047 0.002312 ** 
## PAQ6502      4.203e-01  2.953e-01   1.423 0.154682    
## BMI          4.337e-02  1.138e-02   3.811 0.000139 ***
## SBP         -3.509e-03  5.589e-03  -0.628 0.530098    
## DBP          1.099e-03  7.360e-03   0.149 0.881337    
## AST          1.687e-03  3.576e-03   0.472 0.637054    
## ALT          3.549e-03  6.158e-03   0.576 0.564401    
## BUN          1.352e-02  1.648e-02   0.820 0.412054    
## crea         1.257e-01  1.833e-01   0.686 0.492999    
## TC          -1.626e-01  2.988e-01  -0.544 0.586309    
## TG           3.698e-02  5.973e-02   0.619 0.535894    
## HDL          1.731e-01  2.987e-01   0.579 0.562338    
## LDL          1.596e-01  2.986e-01   0.534 0.593024    
## apoB         7.649e-03  1.017e-02   0.752 0.452185    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1170.32  on 1935  degrees of freedom
## Residual deviance:  997.34  on 1897  degrees of freedom
##   (3436 observations deleted due to missingness)
## AIC: 1075.3
## 
## Number of Fisher Scoring iterations: 13
logistic.display(Model4_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## sCOT (cont. var.) 1.0015 (1.0006,1.0024)  1.001 (0.9999,1.0022)  
##                                                                  
## age (cont. var.)  1.0151 (1.006,1.0242)   1.0051 (0.9905,1.02)   
##                                                                  
## sex: 2 vs 1       1.75 (1.26,2.41)        1.8 (1.19,2.71)        
##                                                                  
## ethnic: ref.=1                                                   
##    2              1.16 (0.62,2.2)         1.31 (0.65,2.61)       
##    3              1 (0.62,1.61)           1.14 (0.65,2)          
##    4              0.89 (0.51,1.55)        1.09 (0.56,2.1)        
##    6              0.22 (0.08,0.59)        0.56 (0.2,1.59)        
##    7              0.89 (0.29,2.7)         1.09 (0.32,3.75)       
##                                                                  
## educ: ref.=1                                                     
##    2              0.66 (0.36,1.19)        0.84 (0.43,1.67)       
##    3              0.45 (0.25,0.81)        0.64 (0.32,1.27)       
##    4              0.52 (0.31,0.9)         0.83 (0.43,1.61)       
##    5              0.2 (0.11,0.39)         0.66 (0.29,1.46)       
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## masts: ref.=1                                                    
##    2              2.3 (1.35,3.91)         1.23 (0.66,2.31)       
##    3              2.74 (1.78,4.2)         1.64 (1.01,2.67)       
##    4              2.39 (1.13,5.05)        1.12 (0.48,2.64)       
##    5              0.87 (0.53,1.43)        0.74 (0.42,1.33)       
##    6              1.24 (0.65,2.34)        0.78 (0.38,1.58)       
##                                                                  
## finc (cont. var.) 0.86 (0.82,0.89)        0.91 (0.82,1.02)       
##                                                                  
## PIR (cont. var.)  0.69 (0.62,0.77)        0.92 (0.68,1.23)       
##                                                                  
## SMQ020: ref.=1                                                   
##    2              0.59 (0.43,0.81)        0.87 (0.59,1.27)       
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## ALQ101: ref.=1                                                   
##    2              1.03 (0.73,1.46)        0.83 (0.55,1.26)       
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## PAQ665: 2 vs 1    2.43 (1.7,3.47)         1.82 (1.24,2.68)       
##                                                                  
## PAQ650: 2 vs 1    3.25 (1.92,5.49)        1.52 (0.85,2.72)       
##                                                                  
## BMI (cont. var.)  1.06 (1.04,1.08)        1.04 (1.02,1.07)       
##                                                                  
## SBP (cont. var.)  1.0086 (1.0003,1.017)   0.9965 (0.9856,1.0075) 
##                                                                  
## DBP (cont. var.)  1.0008 (0.9885,1.0133)  1.0011 (0.9868,1.0156) 
##                                                                  
## AST (cont. var.)  1.0026 (0.9985,1.0066)  1.0017 (0.9947,1.0087) 
##                                                                  
## ALT (cont. var.)  1.005 (0.998,1.0121)    1.0036 (0.9915,1.0157) 
##                                                                  
## BUN (cont. var.)  1.03 (1,1.05)           1.01 (0.98,1.05)       
##                                                                  
## crea (cont. var.) 1.07 (0.85,1.35)        1.13 (0.79,1.62)       
##                                                                  
## TC (cont. var.)   1 (1,1.01)              0.85 (0.47,1.53)       
##                                                                  
## TG (cont. var.)   1.01 (1,1.01)           1.04 (0.92,1.17)       
##                                                                  
## HDL (cont. var.)  0.99 (0.98,1)           1.19 (0.66,2.14)       
##                                                                  
## LDL (cont. var.)  1 (1,1.01)              1.17 (0.65,2.11)       
##                                                                  
## apoB (cont. var.) 1.0091 (1.0029,1.0153)  1.0077 (0.9878,1.028)  
##                                                                  
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) 0.064          0.068     
##                                            
## age (cont. var.)  0.494          0.494     
##                                            
## sex: 2 vs 1       0.005          0.005     
##                                            
## ethnic: ref.=1                   0.694     
##    2              0.447                    
##    3              0.656                    
##    4              0.803                    
##    6              0.276                    
##    7              0.896                    
##                                            
## educ: ref.=1                     0.674     
##    2              0.62                     
##    3              0.203                    
##    4              0.579                    
##    5              0.305                    
##    9              0.988                    
##                                            
## masts: ref.=1                    0.2       
##    2              0.515                    
##    3              0.046                    
##    4              0.793                    
##    5              0.316                    
##    6              0.485                    
##                                            
## finc (cont. var.) 0.109          0.105     
##                                            
## PIR (cont. var.)  0.576          0.575     
##                                            
## SMQ020: ref.=1                   0.677     
##    2              0.464                    
##    9              0.989                    
##                                            
## ALQ101: ref.=1                   0.518     
##    2              0.389                    
##    9              0.978                    
##                                            
## PAQ665: 2 vs 1    0.002          0.002     
##                                            
## PAQ650: 2 vs 1    0.155          0.141     
##                                            
## BMI (cont. var.)  < 0.001        < 0.001   
##                                            
## SBP (cont. var.)  0.53           0.528     
##                                            
## DBP (cont. var.)  0.881          0.881     
##                                            
## AST (cont. var.)  0.637          0.647     
##                                            
## ALT (cont. var.)  0.564          0.57      
##                                            
## BUN (cont. var.)  0.412          0.411     
##                                            
## crea (cont. var.) 0.493          0.538     
##                                            
## TC (cont. var.)   0.586          0.586     
##                                            
## TG (cont. var.)   0.536          0.536     
##                                            
## HDL (cont. var.)  0.562          0.562     
##                                            
## LDL (cont. var.)  0.593          0.593     
##                                            
## apoB (cont. var.) 0.452          0.448     
##                                            
## Log-likelihood = -498.6712
## No. of observations = 1936
## AIC value = 1075.3423
summary(Model4_2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5810  -0.4613  -0.3046  -0.1851   3.3808  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -5.375094   1.039564  -5.171 2.33e-07 ***
## sHCOT         0.001424   0.001066   1.336 0.181448    
## age           0.004630   0.007459   0.621 0.534834    
## sex2          0.575037   0.208958   2.752 0.005925 ** 
## ethnic2       0.279215   0.352146   0.793 0.427838    
## ethnic3       0.153210   0.289383   0.529 0.596503    
## ethnic4       0.129321   0.333818   0.387 0.698460    
## ethnic6      -0.547393   0.532604  -1.028 0.304060    
## ethnic7       0.118463   0.632535   0.187 0.851439    
## educ2        -0.162492   0.348120  -0.467 0.640664    
## educ3        -0.449882   0.349625  -1.287 0.198180    
## educ4        -0.197054   0.338275  -0.583 0.560211    
## educ5        -0.443828   0.408570  -1.086 0.277349    
## educ9       -13.841853 882.743540  -0.016 0.987489    
## masts2        0.205386   0.321185   0.639 0.522521    
## masts3        0.498732   0.248551   2.007 0.044797 *  
## masts4        0.123695   0.438460   0.282 0.777858    
## masts5       -0.276765   0.296408  -0.934 0.350444    
## masts6       -0.252265   0.362842  -0.695 0.486901    
## finc         -0.093045   0.057250  -1.625 0.104114    
## PIR          -0.080751   0.150415  -0.537 0.591365    
## SMQ0202      -0.188241   0.191186  -0.985 0.324823    
## SMQ0209     -12.667449 882.743511  -0.014 0.988551    
## ALQ1012      -0.184514   0.211820  -0.871 0.383706    
## ALQ1019     -12.080990 435.413908  -0.028 0.977865    
## PAQ6652       0.601003   0.196609   3.057 0.002237 ** 
## PAQ6502       0.427161   0.295225   1.447 0.147925    
## BMI           0.042822   0.011379   3.763 0.000168 ***
## SBP          -0.003325   0.005591  -0.595 0.552047    
## DBP           0.001317   0.007370   0.179 0.858197    
## AST           0.001585   0.003584   0.442 0.658445    
## ALT           0.003533   0.006172   0.572 0.567013    
## BUN           0.011936   0.016446   0.726 0.467971    
## crea          0.128157   0.183195   0.700 0.484197    
## TC           -0.156119   0.298962  -0.522 0.601530    
## TG            0.035560   0.059760   0.595 0.551809    
## HDL           0.165615   0.298874   0.554 0.579491    
## LDL           0.153322   0.298711   0.513 0.607757    
## apoB          0.007581   0.010143   0.747 0.454812    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1170.32  on 1935  degrees of freedom
## Residual deviance:  998.95  on 1897  degrees of freedom
##   (3436 observations deleted due to missingness)
## AIC: 1076.9
## 
## Number of Fisher Scoring iterations: 13
logistic.display(Model4_2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)         adj. OR(95%CI)         
## sHCOT (cont. var.) 1.0031 (1.0012,1.005)   1.0014 (0.9993,1.0035) 
##                                                                   
## age (cont. var.)   1.0151 (1.006,1.0242)   1.0046 (0.9901,1.0194) 
##                                                                   
## sex: 2 vs 1        1.75 (1.26,2.41)        1.78 (1.18,2.68)       
##                                                                   
## ethnic: ref.=1                                                    
##    2               1.16 (0.62,2.2)         1.32 (0.66,2.64)       
##    3               1 (0.62,1.61)           1.17 (0.66,2.06)       
##    4               0.89 (0.51,1.55)        1.14 (0.59,2.19)       
##    6               0.22 (0.08,0.59)        0.58 (0.2,1.64)        
##    7               0.89 (0.29,2.7)         1.13 (0.33,3.89)       
##                                                                   
## educ: ref.=1                                                      
##    2               0.66 (0.36,1.19)        0.85 (0.43,1.68)       
##    3               0.45 (0.25,0.81)        0.64 (0.32,1.27)       
##    4               0.52 (0.31,0.9)         0.82 (0.42,1.59)       
##    5               0.2 (0.11,0.39)         0.64 (0.29,1.43)       
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## masts: ref.=1                                                     
##    2               2.3 (1.35,3.91)         1.23 (0.65,2.3)        
##    3               2.74 (1.78,4.2)         1.65 (1.01,2.68)       
##    4               2.39 (1.13,5.05)        1.13 (0.48,2.67)       
##    5               0.87 (0.53,1.43)        0.76 (0.42,1.36)       
##    6               1.24 (0.65,2.34)        0.78 (0.38,1.58)       
##                                                                   
## finc (cont. var.)  0.86 (0.82,0.89)        0.91 (0.81,1.02)       
##                                                                   
## PIR (cont. var.)   0.69 (0.62,0.77)        0.92 (0.69,1.24)       
##                                                                   
## SMQ020: ref.=1                                                    
##    2               0.59 (0.43,0.81)        0.83 (0.57,1.2)        
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## ALQ101: ref.=1                                                    
##    2               1.03 (0.73,1.46)        0.83 (0.55,1.26)       
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## PAQ665: 2 vs 1     2.43 (1.7,3.47)         1.82 (1.24,2.68)       
##                                                                   
## PAQ650: 2 vs 1     3.25 (1.92,5.49)        1.53 (0.86,2.73)       
##                                                                   
## BMI (cont. var.)   1.06 (1.04,1.08)        1.04 (1.02,1.07)       
##                                                                   
## SBP (cont. var.)   1.0086 (1.0003,1.017)   0.9967 (0.9858,1.0077) 
##                                                                   
## DBP (cont. var.)   1.0008 (0.9885,1.0133)  1.0013 (0.987,1.0159)  
##                                                                   
## AST (cont. var.)   1.0026 (0.9985,1.0066)  1.0016 (0.9946,1.0086) 
##                                                                   
## ALT (cont. var.)   1.005 (0.998,1.0121)    1.0035 (0.9915,1.0158) 
##                                                                   
## BUN (cont. var.)   1.03 (1,1.05)           1.01 (0.98,1.05)       
##                                                                   
## crea (cont. var.)  1.07 (0.85,1.35)        1.14 (0.79,1.63)       
##                                                                   
## TC (cont. var.)    1 (1,1.01)              0.86 (0.48,1.54)       
##                                                                   
## TG (cont. var.)    1.01 (1,1.01)           1.04 (0.92,1.16)       
##                                                                   
## HDL (cont. var.)   0.99 (0.98,1)           1.18 (0.66,2.12)       
##                                                                   
## LDL (cont. var.)   1 (1,1.01)              1.17 (0.65,2.09)       
##                                                                   
## apoB (cont. var.)  1.0091 (1.0029,1.0153)  1.0076 (0.9878,1.0278) 
##                                                                   
##                    P(Wald's test) P(LR-test)
## sHCOT (cont. var.) 0.181          0.187     
##                                             
## age (cont. var.)   0.535          0.535     
##                                             
## sex: 2 vs 1        0.006          0.006     
##                                             
## ethnic: ref.=1                    0.705     
##    2               0.428                    
##    3               0.597                    
##    4               0.698                    
##    6               0.304                    
##    7               0.851                    
##                                             
## educ: ref.=1                      0.65      
##    2               0.641                    
##    3               0.198                    
##    4               0.56                     
##    5               0.277                    
##    9               0.987                    
##                                             
## masts: ref.=1                     0.214     
##    2               0.523                    
##    3               0.045                    
##    4               0.778                    
##    5               0.35                     
##    6               0.487                    
##                                             
## finc (cont. var.)  0.104          0.101     
##                                             
## PIR (cont. var.)   0.591          0.591     
##                                             
## SMQ020: ref.=1                    0.539     
##    2               0.325                    
##    9               0.989                    
##                                             
## ALQ101: ref.=1                    0.504     
##    2               0.384                    
##    9               0.978                    
##                                             
## PAQ665: 2 vs 1     0.002          0.002     
##                                             
## PAQ650: 2 vs 1     0.148          0.135     
##                                             
## BMI (cont. var.)   < 0.001        < 0.001   
##                                             
## SBP (cont. var.)   0.552          0.55      
##                                             
## DBP (cont. var.)   0.858          0.858     
##                                             
## AST (cont. var.)   0.658          0.668     
##                                             
## ALT (cont. var.)   0.567          0.572     
##                                             
## BUN (cont. var.)   0.468          0.467     
##                                             
## crea (cont. var.)  0.484          0.53      
##                                             
## TC (cont. var.)    0.602          0.601     
##                                             
## TG (cont. var.)    0.552          0.552     
##                                             
## HDL (cont. var.)   0.579          0.579     
##                                             
## LDL (cont. var.)   0.608          0.608     
##                                             
## apoB (cont. var.)  0.455          0.451     
##                                             
## Log-likelihood = -499.4738
## No. of observations = 1936
## AIC value = 1076.9475
summary(Model4_3)
## 
## Call:
## glm(formula = dp10 ~ uCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7043  -0.3850  -0.2423  -0.1348   2.9197  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -4.111e+00  2.291e+00  -1.794   0.0727 .
## uCOT         1.357e-04  6.405e-05   2.118   0.0342 *
## age          1.514e-02  1.490e-02   1.016   0.3095  
## sex2         5.587e-01  4.462e-01   1.252   0.2105  
## ethnic2      6.054e-01  8.631e-01   0.701   0.4830  
## ethnic3      1.307e+00  7.473e-01   1.749   0.0803 .
## ethnic4      1.259e+00  8.370e-01   1.504   0.1325  
## ethnic6      1.251e+00  1.060e+00   1.180   0.2379  
## ethnic7     -1.281e+01  7.069e+02  -0.018   0.9855  
## educ2       -6.786e-01  7.617e-01  -0.891   0.3730  
## educ3       -8.407e-01  7.087e-01  -1.186   0.2355  
## educ4       -2.803e-01  6.836e-01  -0.410   0.6817  
## educ5       -7.310e-01  8.044e-01  -0.909   0.3634  
## masts2      -5.876e-03  7.147e-01  -0.008   0.9934  
## masts3       7.187e-01  4.902e-01   1.466   0.1426  
## masts4       5.946e-01  8.098e-01   0.734   0.4628  
## masts5      -6.124e-01  6.052e-01  -1.012   0.3116  
## masts6      -5.664e-01  7.675e-01  -0.738   0.4606  
## finc        -1.922e-01  1.233e-01  -1.559   0.1190  
## PIR         -2.591e-02  3.168e-01  -0.082   0.9348  
## SMQ0202      1.673e-02  3.926e-01   0.043   0.9660  
## ALQ1012     -8.142e-01  4.646e-01  -1.753   0.0797 .
## PAQ6652      3.973e-01  3.908e-01   1.017   0.3093  
## PAQ6502      4.231e-01  5.606e-01   0.755   0.4503  
## BMI          3.988e-02  2.626e-02   1.519   0.1289  
## SBP         -2.914e-02  1.314e-02  -2.219   0.0265 *
## DBP          1.441e-02  1.594e-02   0.904   0.3659  
## AST          2.486e-02  2.365e-02   1.051   0.2932  
## ALT         -8.692e-03  2.152e-02  -0.404   0.6862  
## BUN          9.009e-03  3.525e-02   0.256   0.7983  
## crea         5.627e-01  5.442e-01   1.034   0.3012  
## TC          -8.099e-01  6.261e-01  -1.294   0.1958  
## TG           1.632e-01  1.252e-01   1.303   0.1924  
## HDL          8.167e-01  6.259e-01   1.305   0.1919  
## LDL          8.194e-01  6.263e-01   1.308   0.1908  
## apoB        -5.891e-03  2.129e-02  -0.277   0.7820  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 325.77  on 606  degrees of freedom
## Residual deviance: 256.84  on 571  degrees of freedom
##   (4765 observations deleted due to missingness)
## AIC: 328.84
## 
## Number of Fisher Scoring iterations: 15
logistic.display(Model4_3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## uCOT (cont. var.) 1.0002 (1.0001,1.0003)  1.0001 (1,1.0003)      
##                                                                  
## age (cont. var.)  1.02 (1,1.03)           1.02 (0.99,1.05)       
##                                                                  
## sex: 2 vs 1       1.4 (0.76,2.57)         1.75 (0.73,4.19)       
##                                                                  
## ethnic: ref.=1                                                   
##    2              2.01 (0.43,9.33)        1.83 (0.34,9.94)       
##    3              3.16 (0.94,10.66)       3.69 (0.85,15.99)      
##    4              2.61 (0.68,9.93)        3.52 (0.68,18.17)      
##    6              1.04 (0.17,6.44)        3.49 (0.44,27.86)      
##    7              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## educ: ref.=1                                                     
##    2              0.62 (0.18,2.16)        0.51 (0.11,2.26)       
##    3              0.65 (0.21,2.01)        0.43 (0.11,1.73)       
##    4              0.72 (0.25,2.05)        0.76 (0.2,2.88)        
##    5              0.28 (0.08,0.98)        0.48 (0.1,2.33)        
##                                                                  
## masts: ref.=1                                                    
##    2              2.4856 (0.7849,7.8714)  0.9941 (0.2449,4.0348) 
##    3              3.87 (1.76,8.51)        2.05 (0.79,5.36)       
##    4              3.73 (1.14,12.17)       1.81 (0.37,8.86)       
##    5              0.7 (0.26,1.94)         0.54 (0.17,1.77)       
##    6              1.17 (0.33,4.14)        0.57 (0.13,2.55)       
##                                                                  
## finc (cont. var.) 0.83 (0.75,0.91)        0.83 (0.65,1.05)       
##                                                                  
## PIR (cont. var.)  0.65 (0.52,0.82)        0.97 (0.52,1.81)       
##                                                                  
## SMQ020: 2 vs 1    0.54 (0.29,1)           1.02 (0.47,2.2)        
##                                                                  
## ALQ101: 2 vs 1    0.89 (0.44,1.79)        0.44 (0.18,1.1)        
##                                                                  
## PAQ665: 2 vs 1    1.72 (0.9,3.3)          1.49 (0.69,3.2)        
##                                                                  
## PAQ650: 2 vs 1    2.55 (0.99,6.58)        1.53 (0.51,4.58)       
##                                                                  
## BMI (cont. var.)  1.03 (0.99,1.07)        1.04 (0.99,1.1)        
##                                                                  
## SBP (cont. var.)  0.99 (0.98,1.01)        0.97 (0.95,1)          
##                                                                  
## DBP (cont. var.)  1 (0.98,1.03)           1.01 (0.98,1.05)       
##                                                                  
## AST (cont. var.)  1.01 (0.99,1.04)        1.03 (0.98,1.07)       
##                                                                  
## ALT (cont. var.)  1.0005 (0.9782,1.0234)  0.9913 (0.9504,1.034)  
##                                                                  
## BUN (cont. var.)  1.039 (0.9945,1.0854)   1.009 (0.9417,1.0812)  
##                                                                  
## crea (cont. var.) 1.92 (0.95,3.85)        1.76 (0.6,5.1)         
##                                                                  
## TC (cont. var.)   1 (1,1.01)              0.44 (0.13,1.52)       
##                                                                  
## TG (cont. var.)   1 (1,1.01)              1.18 (0.92,1.5)        
##                                                                  
## HDL (cont. var.)  0.99 (0.97,1.01)        2.26 (0.66,7.72)       
##                                                                  
## LDL (cont. var.)  1 (1,1.01)              2.27 (0.66,7.74)       
##                                                                  
## apoB (cont. var.) 1.0052 (0.9936,1.017)   0.9941 (0.9535,1.0365) 
##                                                                  
##                   P(Wald's test) P(LR-test)
## uCOT (cont. var.) 0.034          0.029     
##                                            
## age (cont. var.)  0.31           0.309     
##                                            
## sex: 2 vs 1       0.21           0.209     
##                                            
## ethnic: ref.=1                   0.347     
##    2              0.483                    
##    3              0.08                     
##    4              0.132                    
##    6              0.238                    
##    7              0.986                    
##                                            
## educ: ref.=1                     0.637     
##    2              0.373                    
##    3              0.236                    
##    4              0.682                    
##    5              0.363                    
##                                            
## masts: ref.=1                    0.363     
##    2              0.993                    
##    3              0.143                    
##    4              0.463                    
##    5              0.312                    
##    6              0.461                    
##                                            
## finc (cont. var.) 0.119          0.108     
##                                            
## PIR (cont. var.)  0.935          0.935     
##                                            
## SMQ020: 2 vs 1    0.966          0.966     
##                                            
## ALQ101: 2 vs 1    0.08           0.069     
##                                            
## PAQ665: 2 vs 1    0.309          0.304     
##                                            
## PAQ650: 2 vs 1    0.45           0.438     
##                                            
## BMI (cont. var.)  0.129          0.133     
##                                            
## SBP (cont. var.)  0.027          0.02      
##                                            
## DBP (cont. var.)  0.366          0.351     
##                                            
## AST (cont. var.)  0.293          0.309     
##                                            
## ALT (cont. var.)  0.686          0.682     
##                                            
## BUN (cont. var.)  0.798          0.799     
##                                            
## crea (cont. var.) 0.301          0.306     
##                                            
## TC (cont. var.)   0.196          0.191     
##                                            
## TG (cont. var.)   0.192          0.188     
##                                            
## HDL (cont. var.)  0.192          0.188     
##                                            
## LDL (cont. var.)  0.191          0.186     
##                                            
## apoB (cont. var.) 0.782          0.783     
##                                            
## Log-likelihood = -128.4201
## No. of observations = 607
## AIC value = 328.8401
summary(Model4_4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB, 
##     family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4144  -0.3897  -0.2435  -0.1343   2.8941  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -3.769e+00  2.271e+00  -1.660   0.0969 .
## uHCOT        3.053e-05  2.208e-05   1.383   0.1668  
## age          1.177e-02  1.467e-02   0.802   0.4226  
## sex2         4.747e-01  4.415e-01   1.075   0.2823  
## ethnic2      6.262e-01  8.587e-01   0.729   0.4658  
## ethnic3      1.393e+00  7.468e-01   1.865   0.0622 .
## ethnic4      1.315e+00  8.360e-01   1.573   0.1156  
## ethnic6      1.239e+00  1.059e+00   1.170   0.2418  
## ethnic7     -1.274e+01  7.084e+02  -0.018   0.9856  
## educ2       -6.574e-01  7.621e-01  -0.863   0.3883  
## educ3       -7.260e-01  6.986e-01  -1.039   0.2987  
## educ4       -2.717e-01  6.849e-01  -0.397   0.6916  
## educ5       -7.280e-01  8.068e-01  -0.902   0.3669  
## masts2       1.876e-02  7.154e-01   0.026   0.9791  
## masts3       7.711e-01  4.856e-01   1.588   0.1123  
## masts4       6.784e-01  8.061e-01   0.842   0.4000  
## masts5      -6.195e-01  6.053e-01  -1.023   0.3061  
## masts6      -5.244e-01  7.645e-01  -0.686   0.4928  
## finc        -1.832e-01  1.229e-01  -1.491   0.1359  
## PIR         -4.844e-02  3.154e-01  -0.154   0.8780  
## SMQ0202     -7.683e-02  3.856e-01  -0.199   0.8421  
## ALQ1012     -7.070e-01  4.529e-01  -1.561   0.1186  
## PAQ6652      3.888e-01  3.879e-01   1.002   0.3163  
## PAQ6502      4.899e-01  5.587e-01   0.877   0.3806  
## BMI          3.653e-02  2.613e-02   1.398   0.1622  
## SBP         -2.924e-02  1.316e-02  -2.223   0.0262 *
## DBP          1.508e-02  1.607e-02   0.939   0.3479  
## AST          2.510e-02  2.352e-02   1.067   0.2860  
## ALT         -9.660e-03  2.159e-02  -0.447   0.6546  
## BUN          1.248e-02  3.502e-02   0.356   0.7215  
## crea         4.811e-01  5.394e-01   0.892   0.3724  
## TC          -9.449e-01  6.182e-01  -1.528   0.1264  
## TG           1.899e-01  1.236e-01   1.536   0.1246  
## HDL          9.496e-01  6.181e-01   1.536   0.1245  
## LDL          9.555e-01  6.184e-01   1.545   0.1223  
## apoB        -6.665e-03  2.110e-02  -0.316   0.7521  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 325.77  on 606  degrees of freedom
## Residual deviance: 259.85  on 571  degrees of freedom
##   (4765 observations deleted due to missingness)
## AIC: 331.85
## 
## Number of Fisher Scoring iterations: 15
logistic.display(Model4_4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)         adj. OR(95%CI)         
## uHCOT (cont. var.) 1 (1,1.0001)            1 (1,1.0001)           
##                                                                   
## age (cont. var.)   1.02 (1,1.03)           1.01 (0.98,1.04)       
##                                                                   
## sex: 2 vs 1        1.4 (0.76,2.57)         1.61 (0.68,3.82)       
##                                                                   
## ethnic: ref.=1                                                    
##    2               2.01 (0.43,9.33)        1.87 (0.35,10.07)      
##    3               3.16 (0.94,10.66)       4.03 (0.93,17.4)       
##    4               2.61 (0.68,9.93)        3.73 (0.72,19.18)      
##    6               1.04 (0.17,6.44)        3.45 (0.43,27.5)       
##    7               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## educ: ref.=1                                                      
##    2               0.62 (0.18,2.16)        0.52 (0.12,2.31)       
##    3               0.65 (0.21,2.01)        0.48 (0.12,1.9)        
##    4               0.72 (0.25,2.05)        0.76 (0.2,2.92)        
##    5               0.28 (0.08,0.98)        0.48 (0.1,2.35)        
##                                                                   
## masts: ref.=1                                                     
##    2               2.49 (0.78,7.87)        1.02 (0.25,4.14)       
##    3               3.87 (1.76,8.51)        2.16 (0.83,5.6)        
##    4               3.73 (1.14,12.17)       1.97 (0.41,9.57)       
##    5               0.7 (0.26,1.94)         0.54 (0.16,1.76)       
##    6               1.17 (0.33,4.14)        0.59 (0.13,2.65)       
##                                                                   
## finc (cont. var.)  0.83 (0.75,0.91)        0.83 (0.65,1.06)       
##                                                                   
## PIR (cont. var.)   0.65 (0.52,0.82)        0.95 (0.51,1.77)       
##                                                                   
## SMQ020: 2 vs 1     0.54 (0.29,1)           0.93 (0.43,1.97)       
##                                                                   
## ALQ101: 2 vs 1     0.89 (0.44,1.79)        0.49 (0.2,1.2)         
##                                                                   
## PAQ665: 2 vs 1     1.72 (0.9,3.3)          1.48 (0.69,3.16)       
##                                                                   
## PAQ650: 2 vs 1     2.55 (0.99,6.58)        1.63 (0.55,4.88)       
##                                                                   
## BMI (cont. var.)   1.03 (0.99,1.07)        1.04 (0.99,1.09)       
##                                                                   
## SBP (cont. var.)   0.99 (0.98,1.01)        0.97 (0.95,1)          
##                                                                   
## DBP (cont. var.)   1 (0.98,1.03)           1.02 (0.98,1.05)       
##                                                                   
## AST (cont. var.)   1.01 (0.99,1.04)        1.03 (0.98,1.07)       
##                                                                   
## ALT (cont. var.)   1.0005 (0.9782,1.0234)  0.9904 (0.9493,1.0332) 
##                                                                   
## BUN (cont. var.)   1.04 (0.99,1.09)        1.01 (0.95,1.08)       
##                                                                   
## crea (cont. var.)  1.92 (0.95,3.85)        1.62 (0.56,4.66)       
##                                                                   
## TC (cont. var.)    1 (1,1.01)              0.39 (0.12,1.31)       
##                                                                   
## TG (cont. var.)    1 (1,1.01)              1.21 (0.95,1.54)       
##                                                                   
## HDL (cont. var.)   0.99 (0.97,1.01)        2.58 (0.77,8.68)       
##                                                                   
## LDL (cont. var.)   1 (1,1.01)              2.6 (0.77,8.74)        
##                                                                   
## apoB (cont. var.)  1.0052 (0.9936,1.017)   0.9934 (0.9531,1.0353) 
##                                                                   
##                    P(Wald's test) P(LR-test)
## uHCOT (cont. var.) 0.167          0.183     
##                                             
## age (cont. var.)   0.423          0.423     
##                                             
## sex: 2 vs 1        0.282          0.281     
##                                             
## ethnic: ref.=1                    0.293     
##    2               0.466                    
##    3               0.062                    
##    4               0.116                    
##    6               0.242                    
##    7               0.986                    
##                                             
## educ: ref.=1                      0.719     
##    2               0.388                    
##    3               0.299                    
##    4               0.692                    
##    5               0.367                    
##                                             
## masts: ref.=1                     0.31      
##    2               0.979                    
##    3               0.112                    
##    4               0.4                      
##    5               0.306                    
##    6               0.493                    
##                                             
## finc (cont. var.)  0.136          0.125     
##                                             
## PIR (cont. var.)   0.878          0.878     
##                                             
## SMQ020: 2 vs 1     0.842          0.842     
##                                             
## ALQ101: 2 vs 1     0.119          0.108     
##                                             
## PAQ665: 2 vs 1     0.316          0.311     
##                                             
## PAQ650: 2 vs 1     0.381          0.365     
##                                             
## BMI (cont. var.)   0.162          0.166     
##                                             
## SBP (cont. var.)   0.026          0.02      
##                                             
## DBP (cont. var.)   0.348          0.332     
##                                             
## AST (cont. var.)   0.286          0.302     
##                                             
## ALT (cont. var.)   0.655          0.649     
##                                             
## BUN (cont. var.)   0.722          0.723     
##                                             
## crea (cont. var.)  0.372          0.377     
##                                             
## TC (cont. var.)    0.126          0.122     
##                                             
## TG (cont. var.)    0.125          0.12      
##                                             
## HDL (cont. var.)   0.124          0.12      
##                                             
## LDL (cont. var.)   0.122          0.118     
##                                             
## apoB (cont. var.)  0.752          0.754     
##                                             
## Log-likelihood = -129.9242
## No. of observations = 607
## AIC value = 331.8483

8.6 Model 5

### Adjust  for: age, sex, ethnic group, educ, marrital status + finc + PIR + smoking + alcohol + physical activity + BMI + SBP + DBP + AST + ALT + BUN + Crea + TC + TG + HDL + LDL + ApoB + hyper + diab + dyslip

Model5_1 = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = tab1)

Model5_2 = glm(dp10 ~ sHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 +BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = tab1)

Model5_3 = glm(dp10 ~ uCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = tab1)

Model5_4 = glm(dp10 ~ uHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = tab1)

# Summary the results of logistic regression
summary(Model5_1)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + 
##     hyper + db + dyslip, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4731  -0.4645  -0.3015  -0.1799   3.4276  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -4.700e+00  1.103e+00  -4.260 2.04e-05 ***
## sCOT         1.010e-03  5.661e-04   1.784 0.074492 .  
## age         -8.583e-05  8.146e-03  -0.011 0.991594    
## sex2         5.667e-01  2.107e-01   2.690 0.007150 ** 
## ethnic2      2.774e-01  3.536e-01   0.785 0.432709    
## ethnic3      1.196e-01  2.893e-01   0.413 0.679302    
## ethnic4      2.893e-02  3.368e-01   0.086 0.931539    
## ethnic6     -6.089e-01  5.338e-01  -1.141 0.254034    
## ethnic7      9.657e-02  6.241e-01   0.155 0.877035    
## educ2       -2.001e-01  3.487e-01  -0.574 0.565944    
## educ3       -5.077e-01  3.511e-01  -1.446 0.148108    
## educ4       -2.371e-01  3.384e-01  -0.701 0.483456    
## educ5       -4.483e-01  4.089e-01  -1.096 0.272921    
## educ9       -1.483e+01  1.455e+03  -0.010 0.991869    
## masts2       2.103e-01  3.219e-01   0.653 0.513452    
## masts3       5.003e-01  2.495e-01   2.005 0.044915 *  
## masts4       9.218e-02  4.385e-01   0.210 0.833507    
## masts5      -3.002e-01  2.968e-01  -1.012 0.311654    
## masts6      -2.638e-01  3.641e-01  -0.725 0.468708    
## finc        -9.393e-02  5.738e-02  -1.637 0.101660    
## PIR         -7.574e-02  1.503e-01  -0.504 0.614277    
## SMQ0202     -1.345e-01  1.960e-01  -0.686 0.492477    
## SMQ0209     -1.315e+01  1.455e+03  -0.009 0.992794    
## ALQ1012     -1.881e-01  2.130e-01  -0.883 0.377302    
## ALQ1019     -1.300e+01  7.133e+02  -0.018 0.985458    
## PAQ6652      5.698e-01  1.976e-01   2.884 0.003930 ** 
## PAQ6502      4.366e-01  2.960e-01   1.475 0.140158    
## BMI          3.998e-02  1.171e-02   3.415 0.000637 ***
## SBP         -7.295e-03  5.875e-03  -1.242 0.214319    
## DBP          1.651e-04  7.360e-03   0.022 0.982099    
## AST          9.757e-04  3.618e-03   0.270 0.787440    
## ALT          3.905e-03  6.221e-03   0.628 0.530167    
## BUN          1.105e-02  1.657e-02   0.667 0.504634    
## crea         1.159e-01  1.812e-01   0.640 0.522395    
## TC          -1.756e-01  2.998e-01  -0.586 0.558129    
## TG           3.956e-02  5.992e-02   0.660 0.509098    
## HDL          1.861e-01  2.998e-01   0.621 0.534724    
## LDL          1.740e-01  2.995e-01   0.581 0.561385    
## apoB         7.840e-03  1.025e-02   0.765 0.444180    
## hyper1       4.334e-01  2.223e-01   1.950 0.051225 .  
## db1          1.497e-01  2.134e-01   0.702 0.482941    
## dyslip1     -2.129e-01  2.827e-01  -0.753 0.451290    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1170.32  on 1935  degrees of freedom
## Residual deviance:  992.63  on 1894  degrees of freedom
##   (3436 observations deleted due to missingness)
## AIC: 1076.6
## 
## Number of Fisher Scoring iterations: 14
logistic.display(Model5_1)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## sCOT (cont. var.) 1.0015 (1.0006,1.0024)  1.001 (0.9999,1.0021)  
##                                                                  
## age (cont. var.)  1.0151 (1.006,1.0242)   0.9999 (0.9841,1.016)  
##                                                                  
## sex: 2 vs 1       1.75 (1.26,2.41)        1.76 (1.17,2.66)       
##                                                                  
## ethnic: ref.=1                                                   
##    2              1.16 (0.62,2.2)         1.32 (0.66,2.64)       
##    3              1 (0.62,1.61)           1.13 (0.64,1.99)       
##    4              0.89 (0.51,1.55)        1.03 (0.53,1.99)       
##    6              0.22 (0.08,0.59)        0.54 (0.19,1.55)       
##    7              0.89 (0.29,2.7)         1.1 (0.32,3.74)        
##                                                                  
## educ: ref.=1                                                     
##    2              0.66 (0.36,1.19)        0.82 (0.41,1.62)       
##    3              0.45 (0.25,0.81)        0.6 (0.3,1.2)          
##    4              0.52 (0.31,0.9)         0.79 (0.41,1.53)       
##    5              0.2 (0.11,0.39)         0.64 (0.29,1.42)       
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## masts: ref.=1                                                    
##    2              2.3 (1.35,3.91)         1.23 (0.66,2.32)       
##    3              2.74 (1.78,4.2)         1.65 (1.01,2.69)       
##    4              2.39 (1.13,5.05)        1.1 (0.46,2.59)        
##    5              0.87 (0.53,1.43)        0.74 (0.41,1.32)       
##    6              1.24 (0.65,2.34)        0.77 (0.38,1.57)       
##                                                                  
## finc (cont. var.) 0.86 (0.82,0.89)        0.91 (0.81,1.02)       
##                                                                  
## PIR (cont. var.)  0.69 (0.62,0.77)        0.93 (0.69,1.24)       
##                                                                  
## SMQ020: ref.=1                                                   
##    2              0.59 (0.43,0.81)        0.87 (0.6,1.28)        
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## ALQ101: ref.=1                                                   
##    2              1.03 (0.73,1.46)        0.83 (0.55,1.26)       
##    9              0 (0,Inf)               0 (0,Inf)              
##                                                                  
## PAQ665: 2 vs 1    2.43 (1.7,3.47)         1.77 (1.2,2.6)         
##                                                                  
## PAQ650: 2 vs 1    3.25 (1.92,5.49)        1.55 (0.87,2.76)       
##                                                                  
## BMI (cont. var.)  1.06 (1.04,1.08)        1.04 (1.02,1.06)       
##                                                                  
## SBP (cont. var.)  1.0086 (1.0003,1.017)   0.9927 (0.9814,1.0042) 
##                                                                  
## DBP (cont. var.)  1.0008 (0.9885,1.0133)  1.0002 (0.9858,1.0147) 
##                                                                  
## AST (cont. var.)  1.0026 (0.9985,1.0066)  1.001 (0.9939,1.0081)  
##                                                                  
## ALT (cont. var.)  1.005 (0.998,1.0121)    1.0039 (0.9917,1.0162) 
##                                                                  
## BUN (cont. var.)  1.03 (1,1.05)           1.01 (0.98,1.04)       
##                                                                  
## crea (cont. var.) 1.07 (0.85,1.35)        1.12 (0.79,1.6)        
##                                                                  
## TC (cont. var.)   1 (1,1.01)              0.84 (0.47,1.51)       
##                                                                  
## TG (cont. var.)   1.01 (1,1.01)           1.04 (0.93,1.17)       
##                                                                  
## HDL (cont. var.)  0.99 (0.98,1)           1.2 (0.67,2.17)        
##                                                                  
## LDL (cont. var.)  1 (1,1.01)              1.19 (0.66,2.14)       
##                                                                  
## apoB (cont. var.) 1.0091 (1.0029,1.0153)  1.0079 (0.9878,1.0283) 
##                                                                  
## hyper: 1 vs 0     2.23 (1.63,3.05)        1.54 (1,2.38)          
##                                                                  
## db: 1 vs 0        1.89 (1.33,2.69)        1.16 (0.76,1.76)       
##                                                                  
## dyslip: 1 vs 0    1.53 (0.99,2.35)        0.81 (0.46,1.41)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) 0.074          0.078     
##                                            
## age (cont. var.)  0.992          0.992     
##                                            
## sex: 2 vs 1       0.007          0.007     
##                                            
## ethnic: ref.=1                   0.654     
##    2              0.433                    
##    3              0.679                    
##    4              0.932                    
##    6              0.254                    
##    7              0.877                    
##                                            
## educ: ref.=1                     0.613     
##    2              0.566                    
##    3              0.148                    
##    4              0.483                    
##    5              0.273                    
##    9              0.992                    
##                                            
## masts: ref.=1                    0.194     
##    2              0.513                    
##    3              0.045                    
##    4              0.834                    
##    5              0.312                    
##    6              0.469                    
##                                            
## finc (cont. var.) 0.102          0.098     
##                                            
## PIR (cont. var.)  0.614          0.614     
##                                            
## SMQ020: ref.=1                   0.729     
##    2              0.492                    
##    9              0.993                    
##                                            
## ALQ101: ref.=1                   0.508     
##    2              0.377                    
##    9              0.985                    
##                                            
## PAQ665: 2 vs 1    0.004          0.003     
##                                            
## PAQ650: 2 vs 1    0.14           0.127     
##                                            
## BMI (cont. var.)  < 0.001        < 0.001   
##                                            
## SBP (cont. var.)  0.214          0.211     
##                                            
## DBP (cont. var.)  0.982          0.982     
##                                            
## AST (cont. var.)  0.787          0.791     
##                                            
## ALT (cont. var.)  0.53           0.537     
##                                            
## BUN (cont. var.)  0.505          0.504     
##                                            
## crea (cont. var.) 0.522          0.563     
##                                            
## TC (cont. var.)   0.558          0.558     
##                                            
## TG (cont. var.)   0.509          0.509     
##                                            
## HDL (cont. var.)  0.535          0.535     
##                                            
## LDL (cont. var.)  0.561          0.561     
##                                            
## apoB (cont. var.) 0.444          0.44      
##                                            
## hyper: 1 vs 0     0.051          0.051     
##                                            
## db: 1 vs 0        0.483          0.485     
##                                            
## dyslip: 1 vs 0    0.451          0.454     
##                                            
## Log-likelihood = -496.313
## No. of observations = 1936
## AIC value = 1076.6261
summary(Model5_2)
## 
## Call:
## glm(formula = dp10 ~ sHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + 
##     hyper + db + dyslip, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4425  -0.4629  -0.3010  -0.1798   3.4143  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -4.587e+00  1.100e+00  -4.169 3.06e-05 ***
## sHCOT        1.333e-03  1.073e-03   1.242 0.214282    
## age         -5.302e-04  8.125e-03  -0.065 0.947970    
## sex2         5.540e-01  2.101e-01   2.636 0.008379 ** 
## ethnic2      2.884e-01  3.532e-01   0.817 0.414154    
## ethnic3      1.448e-01  2.895e-01   0.500 0.617031    
## ethnic4      7.489e-02  3.342e-01   0.224 0.822707    
## ethnic6     -5.773e-01  5.330e-01  -1.083 0.278778    
## ethnic7      1.338e-01  6.245e-01   0.214 0.830323    
## educ2       -1.899e-01  3.486e-01  -0.545 0.585944    
## educ3       -5.131e-01  3.511e-01  -1.461 0.143909    
## educ4       -2.470e-01  3.388e-01  -0.729 0.465984    
## educ5       -4.728e-01  4.087e-01  -1.157 0.247351    
## educ9       -1.485e+01  1.455e+03  -0.010 0.991861    
## masts2       2.067e-01  3.219e-01   0.642 0.520835    
## masts3       5.027e-01  2.495e-01   2.015 0.043916 *  
## masts4       1.017e-01  4.400e-01   0.231 0.817232    
## masts5      -2.806e-01  2.963e-01  -0.947 0.343702    
## masts6      -2.633e-01  3.640e-01  -0.723 0.469484    
## finc        -9.521e-02  5.739e-02  -1.659 0.097127 .  
## PIR         -7.258e-02  1.504e-01  -0.483 0.629365    
## SMQ0202     -1.807e-01  1.922e-01  -0.940 0.347024    
## SMQ0209     -1.323e+01  1.455e+03  -0.009 0.992749    
## ALQ1012     -1.904e-01  2.128e-01  -0.895 0.370931    
## ALQ1019     -1.307e+01  7.119e+02  -0.018 0.985354    
## PAQ6652      5.716e-01  1.975e-01   2.895 0.003794 ** 
## PAQ6502      4.440e-01  2.960e-01   1.500 0.133558    
## BMI          3.942e-02  1.170e-02   3.368 0.000757 ***
## SBP         -7.124e-03  5.881e-03  -1.211 0.225717    
## DBP          3.943e-04  7.369e-03   0.054 0.957326    
## AST          8.742e-04  3.627e-03   0.241 0.809535    
## ALT          3.897e-03  6.236e-03   0.625 0.532068    
## BUN          9.517e-03  1.654e-02   0.575 0.564983    
## crea         1.187e-01  1.810e-01   0.656 0.511817    
## TC          -1.693e-01  3.000e-01  -0.564 0.572484    
## TG           3.820e-02  5.995e-02   0.637 0.523990    
## HDL          1.789e-01  2.999e-01   0.596 0.550922    
## LDL          1.679e-01  2.997e-01   0.560 0.575208    
## apoB         7.761e-03  1.021e-02   0.760 0.447314    
## hyper1       4.318e-01  2.225e-01   1.940 0.052327 .  
## db1          1.505e-01  2.132e-01   0.706 0.480436    
## dyslip1     -2.172e-01  2.824e-01  -0.769 0.441773    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1170.32  on 1935  degrees of freedom
## Residual deviance:  994.23  on 1894  degrees of freedom
##   (3436 observations deleted due to missingness)
## AIC: 1078.2
## 
## Number of Fisher Scoring iterations: 14
logistic.display(Model5_2)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)         adj. OR(95%CI)         
## sHCOT (cont. var.) 1.0031 (1.0012,1.005)   1.0013 (0.9992,1.0034) 
##                                                                   
## age (cont. var.)   1.0151 (1.006,1.0242)   0.9995 (0.9837,1.0155) 
##                                                                   
## sex: 2 vs 1        1.75 (1.26,2.41)        1.74 (1.15,2.63)       
##                                                                   
## ethnic: ref.=1                                                    
##    2               1.16 (0.62,2.2)         1.33 (0.67,2.67)       
##    3               1 (0.62,1.61)           1.16 (0.66,2.04)       
##    4               0.89 (0.51,1.55)        1.08 (0.56,2.07)       
##    6               0.22 (0.08,0.59)        0.56 (0.2,1.6)         
##    7               0.89 (0.29,2.7)         1.14 (0.34,3.89)       
##                                                                   
## educ: ref.=1                                                      
##    2               0.66 (0.36,1.19)        0.83 (0.42,1.64)       
##    3               0.45 (0.25,0.81)        0.6 (0.3,1.19)         
##    4               0.52 (0.31,0.9)         0.78 (0.4,1.52)        
##    5               0.2 (0.11,0.39)         0.62 (0.28,1.39)       
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## masts: ref.=1                                                     
##    2               2.3 (1.35,3.91)         1.23 (0.65,2.31)       
##    3               2.74 (1.78,4.2)         1.65 (1.01,2.7)        
##    4               2.39 (1.13,5.05)        1.11 (0.47,2.62)       
##    5               0.87 (0.53,1.43)        0.76 (0.42,1.35)       
##    6               1.24 (0.65,2.34)        0.77 (0.38,1.57)       
##                                                                   
## finc (cont. var.)  0.86 (0.82,0.89)        0.91 (0.81,1.02)       
##                                                                   
## PIR (cont. var.)   0.69 (0.62,0.77)        0.93 (0.69,1.25)       
##                                                                   
## SMQ020: ref.=1                                                    
##    2               0.59 (0.43,0.81)        0.83 (0.57,1.22)       
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## ALQ101: ref.=1                                                    
##    2               1.03 (0.73,1.46)        0.83 (0.54,1.25)       
##    9               0 (0,Inf)               0 (0,Inf)              
##                                                                   
## PAQ665: 2 vs 1     2.43 (1.7,3.47)         1.77 (1.2,2.61)        
##                                                                   
## PAQ650: 2 vs 1     3.25 (1.92,5.49)        1.56 (0.87,2.78)       
##                                                                   
## BMI (cont. var.)   1.06 (1.04,1.08)        1.04 (1.02,1.06)       
##                                                                   
## SBP (cont. var.)   1.0086 (1.0003,1.017)   0.9929 (0.9815,1.0044) 
##                                                                   
## DBP (cont. var.)   1.0008 (0.9885,1.0133)  1.0004 (0.986,1.0149)  
##                                                                   
## AST (cont. var.)   1.0026 (0.9985,1.0066)  1.0009 (0.9938,1.008)  
##                                                                   
## ALT (cont. var.)   1.005 (0.998,1.0121)    1.0039 (0.9917,1.0162) 
##                                                                   
## BUN (cont. var.)   1.0252 (1.0014,1.0495)  1.0096 (0.9774,1.0428) 
##                                                                   
## crea (cont. var.)  1.07 (0.85,1.35)        1.13 (0.79,1.61)       
##                                                                   
## TC (cont. var.)    1 (1,1.01)              0.84 (0.47,1.52)       
##                                                                   
## TG (cont. var.)    1.01 (1,1.01)           1.04 (0.92,1.17)       
##                                                                   
## HDL (cont. var.)   0.99 (0.98,1)           1.2 (0.66,2.15)        
##                                                                   
## LDL (cont. var.)   1 (1,1.01)              1.18 (0.66,2.13)       
##                                                                   
## apoB (cont. var.)  1.0091 (1.0029,1.0153)  1.0078 (0.9878,1.0282) 
##                                                                   
## hyper: 1 vs 0      2.23 (1.63,3.05)        1.54 (1,2.38)          
##                                                                   
## db: 1 vs 0         1.89 (1.33,2.69)        1.16 (0.77,1.77)       
##                                                                   
## dyslip: 1 vs 0     1.53 (0.99,2.35)        0.8 (0.46,1.4)         
##                                                                   
##                    P(Wald's test) P(LR-test)
## sHCOT (cont. var.) 0.214          0.219     
##                                             
## age (cont. var.)   0.948          0.948     
##                                             
## sex: 2 vs 1        0.008          0.008     
##                                             
## ethnic: ref.=1                    0.67      
##    2               0.414                    
##    3               0.617                    
##    4               0.823                    
##    6               0.279                    
##    7               0.83                     
##                                             
## educ: ref.=1                      0.589     
##    2               0.586                    
##    3               0.144                    
##    4               0.466                    
##    5               0.247                    
##    9               0.992                    
##                                             
## masts: ref.=1                     0.206     
##    2               0.521                    
##    3               0.044                    
##    4               0.817                    
##    5               0.344                    
##    6               0.469                    
##                                             
## finc (cont. var.)  0.097          0.094     
##                                             
## PIR (cont. var.)   0.629          0.629     
##                                             
## SMQ020: ref.=1                    0.589     
##    2               0.347                    
##    9               0.993                    
##                                             
## ALQ101: ref.=1                    0.493     
##    2               0.371                    
##    9               0.985                    
##                                             
## PAQ665: 2 vs 1     0.004          0.003     
##                                             
## PAQ650: 2 vs 1     0.134          0.12      
##                                             
## BMI (cont. var.)   < 0.001        < 0.001   
##                                             
## SBP (cont. var.)   0.226          0.222     
##                                             
## DBP (cont. var.)   0.957          0.957     
##                                             
## AST (cont. var.)   0.81           0.812     
##                                             
## ALT (cont. var.)   0.532          0.539     
##                                             
## BUN (cont. var.)   0.565          0.565     
##                                             
## crea (cont. var.)  0.512          0.554     
##                                             
## TC (cont. var.)    0.572          0.572     
##                                             
## TG (cont. var.)    0.524          0.524     
##                                             
## HDL (cont. var.)   0.551          0.551     
##                                             
## LDL (cont. var.)   0.575          0.575     
##                                             
## apoB (cont. var.)  0.447          0.444     
##                                             
## hyper: 1 vs 0      0.052          0.052     
##                                             
## db: 1 vs 0         0.48           0.482     
##                                             
## dyslip: 1 vs 0     0.442          0.445     
##                                             
## Log-likelihood = -497.1138
## No. of observations = 1936
## AIC value = 1078.2276
summary(Model5_3)
## 
## Call:
## glm(formula = dp10 ~ uCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + 
##     hyper + db + dyslip, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6971  -0.3829  -0.2384  -0.1268   2.8235  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -3.730e+00  2.424e+00  -1.539   0.1238  
## uCOT         1.403e-04  6.535e-05   2.147   0.0318 *
## age          1.536e-02  1.670e-02   0.920   0.3575  
## sex2         4.950e-01  4.497e-01   1.101   0.2711  
## ethnic2      6.795e-01  8.702e-01   0.781   0.4349  
## ethnic3      1.317e+00  7.528e-01   1.749   0.0803 .
## ethnic4      1.196e+00  8.476e-01   1.411   0.1582  
## ethnic6      1.325e+00  1.066e+00   1.242   0.2141  
## ethnic7     -1.371e+01  1.161e+03  -0.012   0.9906  
## educ2       -6.872e-01  7.661e-01  -0.897   0.3697  
## educ3       -8.145e-01  7.115e-01  -1.145   0.2524  
## educ4       -3.192e-01  6.875e-01  -0.464   0.6425  
## educ5       -7.215e-01  8.111e-01  -0.890   0.3737  
## masts2       2.236e-02  7.224e-01   0.031   0.9753  
## masts3       7.478e-01  4.941e-01   1.514   0.1301  
## masts4       4.881e-01  8.333e-01   0.586   0.5580  
## masts5      -6.799e-01  6.100e-01  -1.115   0.2650  
## masts6      -5.164e-01  7.778e-01  -0.664   0.5068  
## finc        -2.116e-01  1.258e-01  -1.682   0.0925 .
## PIR          2.911e-02  3.216e-01   0.091   0.9279  
## SMQ0202     -3.432e-02  3.993e-01  -0.086   0.9315  
## ALQ1012     -7.847e-01  4.678e-01  -1.678   0.0934 .
## PAQ6652      4.370e-01  3.968e-01   1.101   0.2707  
## PAQ6502      3.834e-01  5.640e-01   0.680   0.4967  
## BMI          4.201e-02  2.699e-02   1.557   0.1196  
## SBP         -3.325e-02  1.410e-02  -2.357   0.0184 *
## DBP          1.536e-02  1.601e-02   0.959   0.3376  
## AST          2.781e-02  2.427e-02   1.146   0.2519  
## ALT         -1.426e-02  2.221e-02  -0.642   0.5209  
## BUN          5.946e-03  3.586e-02   0.166   0.8683  
## crea         5.883e-01  5.494e-01   1.071   0.2842  
## TC          -7.612e-01  6.288e-01  -1.210   0.2261  
## TG           1.538e-01  1.258e-01   1.223   0.2213  
## HDL          7.686e-01  6.288e-01   1.222   0.2216  
## LDL          7.728e-01  6.290e-01   1.229   0.2192  
## apoB        -2.167e-03  2.187e-02  -0.099   0.9211  
## hyper1       2.668e-01  4.690e-01   0.569   0.5695  
## db1          1.675e-01  4.867e-01   0.344   0.7308  
## dyslip1     -8.397e-01  5.861e-01  -1.433   0.1519  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 325.77  on 606  degrees of freedom
## Residual deviance: 254.44  on 568  degrees of freedom
##   (4765 observations deleted due to missingness)
## AIC: 332.44
## 
## Number of Fisher Scoring iterations: 16
logistic.display(Model5_3)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         P(Wald's test)
## uCOT (cont. var.) 1.0002 (1.0001,1.0003)  1.0001 (1,1.0003)      0.032         
##                                                                                
## age (cont. var.)  1.02 (1,1.03)           1.02 (0.98,1.05)       0.358         
##                                                                                
## sex: 2 vs 1       1.4 (0.76,2.57)         1.64 (0.68,3.96)       0.271         
##                                                                                
## ethnic: ref.=1                                                                 
##    2              2.01 (0.43,9.33)        1.97 (0.36,10.86)      0.435         
##    3              3.16 (0.94,10.66)       3.73 (0.85,16.31)      0.08          
##    4              2.61 (0.68,9.93)        3.31 (0.63,17.41)      0.158         
##    6              1.04 (0.17,6.44)        3.76 (0.47,30.41)      0.214         
##    7              0 (0,Inf)               0 (0,Inf)              0.991         
##                                                                                
## educ: ref.=1                                                                   
##    2              0.62 (0.18,2.16)        0.5 (0.11,2.26)        0.37          
##    3              0.65 (0.21,2.01)        0.44 (0.11,1.79)       0.252         
##    4              0.72 (0.25,2.05)        0.73 (0.19,2.8)        0.642         
##    5              0.28 (0.08,0.98)        0.49 (0.1,2.38)        0.374         
##                                                                                
## masts: ref.=1                                                                  
##    2              2.49 (0.78,7.87)        1.02 (0.25,4.21)       0.975         
##    3              3.87 (1.76,8.51)        2.11 (0.8,5.56)        0.13          
##    4              3.73 (1.14,12.17)       1.63 (0.32,8.34)       0.558         
##    5              0.7 (0.26,1.94)         0.51 (0.15,1.67)       0.265         
##    6              1.17 (0.33,4.14)        0.6 (0.13,2.74)        0.507         
##                                                                                
## finc (cont. var.) 0.83 (0.75,0.91)        0.81 (0.63,1.04)       0.093         
##                                                                                
## PIR (cont. var.)  0.65 (0.52,0.82)        1.03 (0.55,1.93)       0.928         
##                                                                                
## SMQ020: 2 vs 1    0.54 (0.29,1)           0.97 (0.44,2.11)       0.932         
##                                                                                
## ALQ101: 2 vs 1    0.89 (0.44,1.79)        0.46 (0.18,1.14)       0.093         
##                                                                                
## PAQ665: 2 vs 1    1.72 (0.9,3.3)          1.55 (0.71,3.37)       0.271         
##                                                                                
## PAQ650: 2 vs 1    2.55 (0.99,6.58)        1.47 (0.49,4.43)       0.497         
##                                                                                
## BMI (cont. var.)  1.03 (0.99,1.07)        1.04 (0.99,1.1)        0.12          
##                                                                                
## SBP (cont. var.)  0.99 (0.98,1.01)        0.97 (0.94,0.99)       0.018         
##                                                                                
## DBP (cont. var.)  1 (0.98,1.03)           1.02 (0.98,1.05)       0.338         
##                                                                                
## AST (cont. var.)  1.01 (0.99,1.04)        1.03 (0.98,1.08)       0.252         
##                                                                                
## ALT (cont. var.)  1 (0.98,1.02)           0.99 (0.94,1.03)       0.521         
##                                                                                
## BUN (cont. var.)  1.039 (0.9945,1.0854)   1.006 (0.9377,1.0792)  0.868         
##                                                                                
## crea (cont. var.) 1.92 (0.95,3.85)        1.8 (0.61,5.29)        0.284         
##                                                                                
## TC (cont. var.)   1 (1,1.01)              0.47 (0.14,1.6)        0.226         
##                                                                                
## TG (cont. var.)   1 (1,1.01)              1.17 (0.91,1.49)       0.221         
##                                                                                
## HDL (cont. var.)  0.99 (0.97,1.01)        2.16 (0.63,7.4)        0.222         
##                                                                                
## LDL (cont. var.)  1 (1,1.01)              2.17 (0.63,7.43)       0.219         
##                                                                                
## apoB (cont. var.) 1.0052 (0.9936,1.017)   0.9978 (0.956,1.0415)  0.921         
##                                                                                
## hyper: 1 vs 0     1.63 (0.89,2.98)        1.31 (0.52,3.27)       0.569         
##                                                                                
## db: 1 vs 0        1.29 (0.6,2.77)         1.18 (0.46,3.07)       0.731         
##                                                                                
## dyslip: 1 vs 0    1.06 (0.5,2.26)         0.43 (0.14,1.36)       0.152         
##                                                                                
##                   P(LR-test)
## uCOT (cont. var.) 0.026     
##                             
## age (cont. var.)  0.359     
##                             
## sex: 2 vs 1       0.27      
##                             
## ethnic: ref.=1    0.379     
##    2                        
##    3                        
##    4                        
##    6                        
##    7                        
##                             
## educ: ref.=1      0.705     
##    2                        
##    3                        
##    4                        
##    5                        
##                             
## masts: ref.=1     0.343     
##    2                        
##    3                        
##    4                        
##    5                        
##    6                        
##                             
## finc (cont. var.) 0.081     
##                             
## PIR (cont. var.)  0.928     
##                             
## SMQ020: 2 vs 1    0.932     
##                             
## ALQ101: 2 vs 1    0.083     
##                             
## PAQ665: 2 vs 1    0.265     
##                             
## PAQ650: 2 vs 1    0.486     
##                             
## BMI (cont. var.)  0.124     
##                             
## SBP (cont. var.)  0.014     
##                             
## DBP (cont. var.)  0.321     
##                             
## AST (cont. var.)  0.267     
##                             
## ALT (cont. var.)  0.51      
##                             
## BUN (cont. var.)  0.869     
##                             
## crea (cont. var.) 0.29      
##                             
## TC (cont. var.)   0.222     
##                             
## TG (cont. var.)   0.217     
##                             
## HDL (cont. var.)  0.217     
##                             
## LDL (cont. var.)  0.215     
##                             
## apoB (cont. var.) 0.921     
##                             
## hyper: 1 vs 0     0.569     
##                             
## db: 1 vs 0        0.732     
##                             
## dyslip: 1 vs 0    0.156     
##                             
## Log-likelihood = -127.2205
## No. of observations = 607
## AIC value = 332.441
summary(Model5_4)
## 
## Call:
## glm(formula = dp10 ~ uHCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + 
##     hyper + db + dyslip, family = binomial, data = tab1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5166  -0.3912  -0.2371  -0.1291   2.7453  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -3.258e+00  2.397e+00  -1.359   0.1741  
## uHCOT        3.172e-05  2.217e-05   1.431   0.1525  
## age          1.088e-02  1.640e-02   0.664   0.5070  
## sex2         3.990e-01  4.452e-01   0.896   0.3702  
## ethnic2      7.091e-01  8.659e-01   0.819   0.4128  
## ethnic3      1.409e+00  7.523e-01   1.873   0.0611 .
## ethnic4      1.264e+00  8.461e-01   1.494   0.1353  
## ethnic6      1.309e+00  1.065e+00   1.229   0.2192  
## ethnic7     -1.263e+01  7.070e+02  -0.018   0.9857  
## educ2       -6.642e-01  7.668e-01  -0.866   0.3864  
## educ3       -7.085e-01  7.016e-01  -1.010   0.3125  
## educ4       -3.121e-01  6.880e-01  -0.454   0.6501  
## educ5       -7.199e-01  8.124e-01  -0.886   0.3756  
## masts2       3.671e-02  7.233e-01   0.051   0.9595  
## masts3       7.959e-01  4.898e-01   1.625   0.1042  
## masts4       5.879e-01  8.263e-01   0.712   0.4768  
## masts5      -6.857e-01  6.086e-01  -1.127   0.2599  
## masts6      -4.917e-01  7.761e-01  -0.634   0.5264  
## finc        -2.009e-01  1.251e-01  -1.605   0.1084  
## PIR          1.354e-03  3.200e-01   0.004   0.9966  
## SMQ0202     -1.173e-01  3.929e-01  -0.299   0.7652  
## ALQ1012     -6.793e-01  4.562e-01  -1.489   0.1364  
## PAQ6652      4.156e-01  3.940e-01   1.055   0.2915  
## PAQ6502      4.501e-01  5.625e-01   0.800   0.4236  
## BMI          3.818e-02  2.687e-02   1.421   0.1554  
## SBP         -3.420e-02  1.414e-02  -2.419   0.0156 *
## DBP          1.616e-02  1.618e-02   0.999   0.3177  
## AST          2.786e-02  2.414e-02   1.154   0.2484  
## ALT         -1.514e-02  2.230e-02  -0.679   0.4971  
## BUN          9.932e-03  3.560e-02   0.279   0.7802  
## crea         4.984e-01  5.441e-01   0.916   0.3597  
## TC          -8.987e-01  6.213e-01  -1.446   0.1480  
## TG           1.809e-01  1.243e-01   1.456   0.1454  
## HDL          9.042e-01  6.214e-01   1.455   0.1456  
## LDL          9.113e-01  6.214e-01   1.466   0.1425  
## apoB        -2.895e-03  2.166e-02  -0.134   0.8937  
## hyper1       3.358e-01  4.642e-01   0.723   0.4695  
## db1          1.546e-01  4.868e-01   0.318   0.7508  
## dyslip1     -7.751e-01  5.793e-01  -1.338   0.1809  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 325.77  on 606  degrees of freedom
## Residual deviance: 257.51  on 568  degrees of freedom
##   (4765 observations deleted due to missingness)
## AIC: 335.51
## 
## Number of Fisher Scoring iterations: 15
logistic.display(Model5_4)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                    crude OR(95%CI)        adj. OR(95%CI)         
## uHCOT (cont. var.) 1 (1,1.0001)           1 (1,1.0001)           
##                                                                  
## age (cont. var.)   1.02 (1,1.03)          1.01 (0.98,1.04)       
##                                                                  
## sex: 2 vs 1        1.4 (0.76,2.57)        1.49 (0.62,3.57)       
##                                                                  
## ethnic: ref.=1                                                   
##    2               2.01 (0.43,9.33)       2.03 (0.37,11.09)      
##    3               3.16 (0.94,10.66)      4.09 (0.94,17.87)      
##    4               2.61 (0.68,9.93)       3.54 (0.67,18.58)      
##    6               1.04 (0.17,6.44)       3.7 (0.46,29.88)       
##    7               0 (0,Inf)              0 (0,Inf)              
##                                                                  
## educ: ref.=1                                                     
##    2               0.62 (0.18,2.16)       0.51 (0.11,2.31)       
##    3               0.65 (0.21,2.01)       0.49 (0.12,1.95)       
##    4               0.72 (0.25,2.05)       0.73 (0.19,2.82)       
##    5               0.28 (0.08,0.98)       0.49 (0.1,2.39)        
##                                                                  
## masts: ref.=1                                                    
##    2               2.49 (0.78,7.87)       1.04 (0.25,4.28)       
##    3               3.87 (1.76,8.51)       2.22 (0.85,5.79)       
##    4               3.73 (1.14,12.17)      1.8 (0.36,9.09)        
##    5               0.7 (0.26,1.94)        0.5 (0.15,1.66)        
##    6               1.17 (0.33,4.14)       0.61 (0.13,2.8)        
##                                                                  
## finc (cont. var.)  0.83 (0.75,0.91)       0.82 (0.64,1.05)       
##                                                                  
## PIR (cont. var.)   0.6519 (0.518,0.8204)  1.0014 (0.5348,1.8751) 
##                                                                  
## SMQ020: 2 vs 1     0.54 (0.29,1)          0.89 (0.41,1.92)       
##                                                                  
## ALQ101: 2 vs 1     0.89 (0.44,1.79)       0.51 (0.21,1.24)       
##                                                                  
## PAQ665: 2 vs 1     1.72 (0.9,3.3)         1.52 (0.7,3.28)        
##                                                                  
## PAQ650: 2 vs 1     2.55 (0.99,6.58)       1.57 (0.52,4.72)       
##                                                                  
## BMI (cont. var.)   1.03 (0.99,1.07)       1.04 (0.99,1.1)        
##                                                                  
## SBP (cont. var.)   0.99 (0.98,1.01)       0.97 (0.94,0.99)       
##                                                                  
## DBP (cont. var.)   1 (0.98,1.03)          1.02 (0.98,1.05)       
##                                                                  
## AST (cont. var.)   1.01 (0.99,1.04)       1.03 (0.98,1.08)       
##                                                                  
## ALT (cont. var.)   1 (0.98,1.02)          0.98 (0.94,1.03)       
##                                                                  
## BUN (cont. var.)   1.039 (0.9945,1.0854)  1.01 (0.9419,1.083)    
##                                                                  
## crea (cont. var.)  1.92 (0.95,3.85)       1.65 (0.57,4.78)       
##                                                                  
## TC (cont. var.)    1 (1,1.01)             0.41 (0.12,1.38)       
##                                                                  
## TG (cont. var.)    1 (1,1.01)             1.2 (0.94,1.53)        
##                                                                  
## HDL (cont. var.)   0.99 (0.97,1.01)       2.47 (0.73,8.35)       
##                                                                  
## LDL (cont. var.)   1 (1,1.01)             2.49 (0.74,8.41)       
##                                                                  
## apoB (cont. var.)  1.0052 (0.9936,1.017)  0.9971 (0.9557,1.0404) 
##                                                                  
## hyper: 1 vs 0      1.63 (0.89,2.98)       1.4 (0.56,3.48)        
##                                                                  
## db: 1 vs 0         1.29 (0.6,2.77)        1.17 (0.45,3.03)       
##                                                                  
## dyslip: 1 vs 0     1.06 (0.5,2.26)        0.46 (0.15,1.43)       
##                                                                  
##                    P(Wald's test) P(LR-test)
## uHCOT (cont. var.) 0.153          0.169     
##                                             
## age (cont. var.)   0.507          0.508     
##                                             
## sex: 2 vs 1        0.37           0.369     
##                                             
## ethnic: ref.=1                    0.319     
##    2               0.413                    
##    3               0.061                    
##    4               0.135                    
##    6               0.219                    
##    7               0.986                    
##                                             
## educ: ref.=1                      0.777     
##    2               0.386                    
##    3               0.313                    
##    4               0.65                     
##    5               0.376                    
##                                             
## masts: ref.=1                     0.29      
##    2               0.96                     
##    3               0.104                    
##    4               0.477                    
##    5               0.26                     
##    6               0.526                    
##                                             
## finc (cont. var.)  0.108          0.097     
##                                             
## PIR (cont. var.)   0.997          0.997     
##                                             
## SMQ020: 2 vs 1     0.765          0.765     
##                                             
## ALQ101: 2 vs 1     0.136          0.126     
##                                             
## PAQ665: 2 vs 1     0.292          0.286     
##                                             
## PAQ650: 2 vs 1     0.424          0.41      
##                                             
## BMI (cont. var.)   0.155          0.159     
##                                             
## SBP (cont. var.)   0.016          0.012     
##                                             
## DBP (cont. var.)   0.318          0.3       
##                                             
## AST (cont. var.)   0.248          0.263     
##                                             
## ALT (cont. var.)   0.497          0.486     
##                                             
## BUN (cont. var.)   0.78           0.781     
##                                             
## crea (cont. var.)  0.36           0.365     
##                                             
## TC (cont. var.)    0.148          0.143     
##                                             
## TG (cont. var.)    0.145          0.141     
##                                             
## HDL (cont. var.)   0.146          0.141     
##                                             
## LDL (cont. var.)   0.143          0.138     
##                                             
## apoB (cont. var.)  0.894          0.894     
##                                             
## hyper: 1 vs 0      0.47           0.468     
##                                             
## db: 1 vs 0         0.751          0.752     
##                                             
## dyslip: 1 vs 0     0.181          0.186     
##                                             
## Log-likelihood = -128.755
## No. of observations = 607
## AIC value = 335.51

9. Filter out values ‘7, 77’ and ‘9, 99’ from categorical variables column

filter_edu <- tab1 %>% filter(educ %in% c('1', '2', '3', '4', '5'))

filter_masts <- filter_edu %>% filter(masts %in% c('1', '2', '3', '4', '5', '6'))

filter_alc <- filter_masts %>% filter(ALQ101 %in% c('1', '2'))

filter_smk <- filter_alc %>% filter(SMQ020 %in% c('1', '2'))
# Descriptive analyis

comp = compareGroups(dp10 ~ age + sex + ethnic + educ + masts + SBP + DBP + BMI + finc  + PIR + 
          BUN + crea + AST + ALT + apoB + HDL + LDL + TG + TC + 
          Glu + tolGlu + ALQ101 + SMQ020 + PAQ650 + PAQ665 +
          sCOT + sHCOT + uCOT + uHCOT + db + dyslip + hyper , data = filter_smk)
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'educ' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'masts' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'ALQ101' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'SMQ020' are removed since no observation in that/those levels

Check normal distribution with ggplot2

# Depressive disorder distribution

ggplot(data = filter_smk, mapping = aes(dp10, fill = dp10)) + geom_bar(width = 0.5) +
  xlab("Depressive Disorder") +
  scale_x_discrete(labels = c ("No", "Yes")) +
  ylab("Count") +
   
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(legend.position = "none") +
  geom_text(stat='count', aes(label=..count..), vjust=-0.5) +
  geom_text(stat='count', aes(label=paste0(round(after_stat(count/sum(count)*100),1),'%')), vjust=2, color = "black") 
## Warning: The dot-dot notation (`..count..`) was deprecated in ggplot2 3.4.0.
## i Please use `after_stat(count)` instead.

  # theme_economist() 
fivenum(filter_smk$sCOT)
## [1]    0.011    0.011    0.036   10.900 1820.000
fivenum(filter_smk$sHCOT)
## [1]    0.011    0.011    0.011    3.680 1150.000
fivenum(filter_smk$uCOT)
## [1] 2.10e-02 1.43e-01 4.51e-01 1.31e+02 2.68e+04
fivenum(filter_smk$uHCOT)
## [1] 2.10e-02 2.31e-01 8.29e-01 2.08e+02 7.06e+04
# Independent variables
ggplot(data = filter_smk, mapping = aes(sCOT)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 175 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(sHCOT)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 175 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(uCOT)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 3430 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(uHCOT)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 3430 rows containing non-finite values (`stat_bin()`).

# Covariates
ggplot(data = filter_smk, mapping = aes(SBP)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 467 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(DBP)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 467 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(finc)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 49 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(PIR)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 364 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(BUN)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 190 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(crea)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 190 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(AST)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 192 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(ALT)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 192 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(TC)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 176 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(TG)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2719 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(HDL)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 176 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(LDL)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2756 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(apoB)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2720 rows containing non-finite values (`stat_bin()`).

ggplot(data = filter_smk, mapping = aes(Glu)) + 
  geom_histogram(fill = "blue", color = "white")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2705 rows containing non-finite values (`stat_bin()`).

createTable(comp)
## 
## --------Summary descriptives table by 'dp10'---------
## 
## ________________________________________________________________________ 
##                                            0            1      p.overall 
##                                          N=4553       N=487              
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## Age in years at screening             48.9 (17.6)  51.6 (16.4)   0.001   
## sex:                                                            <0.001   
##     1                                 2275 (50.0%) 158 (32.4%)           
##     2                                 2278 (50.0%) 329 (67.6%)           
## ethnic:                                                         <0.001   
##     1                                 607 (13.3%)  67 (13.8%)            
##     2                                 392 (8.61%)  57 (11.7%)            
##     3                                 2006 (44.1%) 216 (44.4%)           
##     4                                 905 (19.9%)  105 (21.6%)           
##     6                                 509 (11.2%)  17 (3.49%)            
##     7                                 134 (2.94%)  25 (5.13%)            
## educ:                                                           <0.001   
##     1                                 292 (6.41%)  64 (13.1%)            
##     2                                 575 (12.6%)  103 (21.1%)           
##     3                                 1009 (22.2%) 117 (24.0%)           
##     4                                 1442 (31.7%) 148 (30.4%)           
##     5                                 1235 (27.1%) 55 (11.3%)            
## masts:                                                          <0.001   
##     1                                 2443 (53.7%) 187 (38.4%)           
##     2                                 309 (6.79%)  57 (11.7%)            
##     3                                 484 (10.6%)  98 (20.1%)            
##     4                                 123 (2.70%)  27 (5.54%)            
##     5                                 872 (19.2%)  82 (16.8%)            
##     6                                 322 (7.07%)  36 (7.39%)            
## Systolic: Blood pres (1st rdg) mm Hg   123 (17.2)  125 (19.1)    0.003   
## Diastolic: Blood pres (1st rdg) mm Hg 69.4 (12.5)  69.7 (12.4)   0.656   
## Body Mass Index (kg/m**2)             28.9 (6.87)  31.9 (9.32)  <0.001   
## Annual family income                  10.8 (13.4)  8.97 (15.0)   0.010   
## Ratio of family income to poverty     2.62 (1.66)  1.74 (1.33)  <0.001   
## Blood urea nitrogen (mg/dL)           13.4 (5.73)  13.6 (9.17)   0.597   
## Creatinine (mg/dL)                    0.91 (0.44)  0.99 (1.09)   0.103   
## Aspartate aminotransferase AST (U/L)  25.3 (18.6)  26.6 (21.7)   0.216   
## Alanine aminotransferase ALT (U/L)    25.0 (18.9)  25.7 (21.5)   0.521   
## Apolipoprotein (B) (mg/dL)            89.8 (24.6)  95.3 (26.5)   0.004   
## Direct HDL-Cholesterol (mg/dL)        52.9 (16.2)  51.2 (15.5)   0.019   
## LDL-cholesterol (mg/dL)                111 (34.6)  113 (37.1)    0.359   
## Triglyceride (mg/dL)                   120 (130)   142 (98.7)    0.002   
## Total Cholesterol( mg/dL)              189 (41.9)  192 (41.3)    0.090   
## Fasting Glucose (mg/dL)                107 (32.6)  117 (43.8)    0.001   
## Two Hour Glucose(OGTT) (mg/dL)         118 (50.1)  129 (52.3)    0.016   
## ALQ101:                                                          0.872   
##     1                                 3293 (72.3%) 350 (71.9%)           
##     2                                 1260 (27.7%) 137 (28.1%)           
## SMQ020:                                                         <0.001   
##     1                                 1924 (42.3%) 280 (57.5%)           
##     2                                 2629 (57.7%) 207 (42.5%)           
## PAQ650:                                                         <0.001   
##     1                                 1090 (23.9%) 48 (9.86%)            
##     2                                 3463 (76.1%) 439 (90.1%)           
## PAQ665:                                                         <0.001   
##     1                                 2009 (44.1%) 123 (25.3%)           
##     2                                 2544 (55.9%) 364 (74.7%)           
## Cotinine, Serum (ng/mL)                56.7 (131)   104 (163)   <0.001   
## Hematocrit (%)                        22.6 (60.9)  45.4 (78.0)  <0.001   
## Total Cotinine, urine (ng/mL)          686 (1833)  1573 (3242)   0.002   
## Total Hydroxycotinine, urine (ng/mL)  1348 (4209)  3143 (6196)   0.001   
## db:                                                             <0.001   
##     0                                 3849 (84.5%) 364 (74.7%)           
##     1                                 704 (15.5%)  123 (25.3%)           
## dyslip:                                                          0.013   
##     0                                 1354 (29.7%) 118 (24.2%)           
##     1                                 3199 (70.3%) 369 (75.8%)           
## hyper:                                                          <0.001   
##     0                                 2915 (64.0%) 225 (46.2%)           
##     1                                 1638 (36.0%) 262 (53.8%)           
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
# Describe by median and IQR, for example: age

med_iqr <- compareGroups(dp10 ~ . -ALQ110, data = filter_smk, method = c(age = 2, finc = 2, PIR = 2, crea = 2, AST = 2, ALT = 2, TG = 2, Glu = 2))
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'educ' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'masts' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'ALQ101' are removed since no observation in that/those levels
## Warning in compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i], :
## Some levels of 'SMQ020' are removed since no observation in that/those levels
med_iqr
## 
## 
## -------- Summary of results by groups of 'dp10'---------
## 
## 
##    var                                   N    p.value  method               
## 1  Age in years at screening             5040 0.001**  continuous non-normal
## 2  sex                                   5040 <0.001** categorical          
## 3  ethnic                                5040 <0.001** categorical          
## 4  educ                                  5040 <0.001** categorical          
## 5  masts                                 5040 <0.001** categorical          
## 6  Systolic: Blood pres (1st rdg) mm Hg  4573 0.003**  continuous normal    
## 7  Diastolic: Blood pres (1st rdg) mm Hg 4573 0.656    continuous normal    
## 8  Body Mass Index (kg/m**2)             4994 <0.001** continuous normal    
## 9  Annual family income                  4991 <0.001** continuous non-normal
## 10 Ratio of family income to poverty     4676 <0.001** continuous non-normal
## 11 Blood urea nitrogen (mg/dL)           4850 0.597    continuous normal    
## 12 Creatinine (mg/dL)                    4850 0.052*   continuous non-normal
## 13 Aspartate aminotransferase AST (U/L)  4848 0.467    continuous non-normal
## 14 Alanine aminotransferase ALT (U/L)    4848 0.369    continuous non-normal
## 15 Apolipoprotein (B) (mg/dL)            2320 0.004**  continuous normal    
## 16 Direct HDL-Cholesterol (mg/dL)        4864 0.019**  continuous normal    
## 17 LDL-cholesterol (mg/dL)               2284 0.359    continuous normal    
## 18 Triglyceride (mg/dL)                  2321 <0.001** continuous non-normal
## 19 Total Cholesterol( mg/dL)             4864 0.090*   continuous normal    
## 20 Fasting Glucose (mg/dL)               2335 <0.001** continuous non-normal
## 21 Two Hour Glucose(OGTT) (mg/dL)        1804 0.016**  continuous normal    
## 22 ALQ101                                5040 0.872    categorical          
## 23 SMQ020                                5040 <0.001** categorical          
## 24 PAQ665                                5040 <0.001** categorical          
## 25 PAQ650                                5040 <0.001** categorical          
## 26 Cotinine, Serum (ng/mL)               4865 <0.001** continuous normal    
## 27 Hematocrit (%)                        4865 <0.001** continuous normal    
## 28 Total Cotinine, urine (ng/mL)         1610 0.002**  continuous normal    
## 29 Total Hydroxycotinine, urine (ng/mL)  1610 0.001**  continuous normal    
## 30 db                                    5040 <0.001** categorical          
## 31 dyslip                                5040 0.013**  categorical          
## 32 hyper                                 5040 <0.001** categorical          
##    selection
## 1  ALL      
## 2  ALL      
## 3  ALL      
## 4  ALL      
## 5  ALL      
## 6  ALL      
## 7  ALL      
## 8  ALL      
## 9  ALL      
## 10 ALL      
## 11 ALL      
## 12 ALL      
## 13 ALL      
## 14 ALL      
## 15 ALL      
## 16 ALL      
## 17 ALL      
## 18 ALL      
## 19 ALL      
## 20 ALL      
## 21 ALL      
## 22 ALL      
## 23 ALL      
## 24 ALL      
## 25 ALL      
## 26 ALL      
## 27 ALL      
## 28 ALL      
## 29 ALL      
## 30 ALL      
## 31 ALL      
## 32 ALL      
## -----
## Signif. codes:  0 '**' 0.05 '*' 0.1 ' ' 1
createTable(med_iqr)
## 
## --------Summary descriptives table by 'dp10'---------
## 
## _________________________________________________________________________________ 
##                                              0                1         p.overall 
##                                            N=4553           N=487                 
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## Age in years at screening             48.0 [34.0;63.0] 54.0 [38.0;63.0]   0.001   
## sex:                                                                     <0.001   
##     1                                   2275 (50.0%)     158 (32.4%)              
##     2                                   2278 (50.0%)     329 (67.6%)              
## ethnic:                                                                  <0.001   
##     1                                   607 (13.3%)       67 (13.8%)              
##     2                                   392 (8.61%)       57 (11.7%)              
##     3                                   2006 (44.1%)     216 (44.4%)              
##     4                                   905 (19.9%)      105 (21.6%)              
##     6                                   509 (11.2%)       17 (3.49%)              
##     7                                   134 (2.94%)       25 (5.13%)              
## educ:                                                                    <0.001   
##     1                                   292 (6.41%)       64 (13.1%)              
##     2                                   575 (12.6%)      103 (21.1%)              
##     3                                   1009 (22.2%)     117 (24.0%)              
##     4                                   1442 (31.7%)     148 (30.4%)              
##     5                                   1235 (27.1%)      55 (11.3%)              
## masts:                                                                   <0.001   
##     1                                   2443 (53.7%)     187 (38.4%)              
##     2                                   309 (6.79%)       57 (11.7%)              
##     3                                   484 (10.6%)       98 (20.1%)              
##     4                                   123 (2.70%)       27 (5.54%)              
##     5                                   872 (19.2%)       82 (16.8%)              
##     6                                   322 (7.07%)       36 (7.39%)              
## Systolic: Blood pres (1st rdg) mm Hg     123 (17.2)       125 (19.1)      0.003   
## Diastolic: Blood pres (1st rdg) mm Hg   69.4 (12.5)      69.7 (12.4)      0.656   
## Body Mass Index (kg/m**2)               28.9 (6.87)      31.9 (9.32)     <0.001   
## Annual family income                  8.00 [5.00;14.0] 6.00 [3.00;8.00]  <0.001   
## Ratio of family income to poverty     2.26 [1.13;4.28] 1.27 [0.78;2.35]  <0.001   
## Blood urea nitrogen (mg/dL)             13.4 (5.73)      13.6 (9.17)      0.597   
## Creatinine (mg/dL)                    0.86 [0.72;1.02] 0.82 [0.71;1.01]   0.052   
## Aspartate aminotransferase AST (U/L)  22.0 [19.0;27.0] 22.0 [18.5;28.0]   0.467   
## Alanine aminotransferase ALT (U/L)    20.0 [16.0;28.0] 20.0 [15.0;28.0]   0.369   
## Apolipoprotein (B) (mg/dL)              89.8 (24.6)      95.3 (26.5)      0.004   
## Direct HDL-Cholesterol (mg/dL)          52.9 (16.2)      51.2 (15.5)      0.019   
## LDL-cholesterol (mg/dL)                  111 (34.6)       113 (37.1)      0.359   
## Triglyceride (mg/dL)                  94.0 [64.0;139]   120 [80.0;183]   <0.001   
## Total Cholesterol( mg/dL)                189 (41.9)       192 (41.3)      0.090   
## Fasting Glucose (mg/dL)               99.0 [92.0;108]   102 [95.0;117]   <0.001   
## Two Hour Glucose(OGTT) (mg/dL)           118 (50.1)       129 (52.3)      0.016   
## ALQ101:                                                                   0.872   
##     1                                   3293 (72.3%)     350 (71.9%)              
##     2                                   1260 (27.7%)     137 (28.1%)              
## SMQ020:                                                                  <0.001   
##     1                                   1924 (42.3%)     280 (57.5%)              
##     2                                   2629 (57.7%)     207 (42.5%)              
## PAQ665:                                                                  <0.001   
##     1                                   2009 (44.1%)     123 (25.3%)              
##     2                                   2544 (55.9%)     364 (74.7%)              
## PAQ650:                                                                  <0.001   
##     1                                   1090 (23.9%)      48 (9.86%)              
##     2                                   3463 (76.1%)     439 (90.1%)              
## Cotinine, Serum (ng/mL)                  56.7 (131)       104 (163)      <0.001   
## Hematocrit (%)                          22.6 (60.9)      45.4 (78.0)     <0.001   
## Total Cotinine, urine (ng/mL)            686 (1833)      1573 (3242)      0.002   
## Total Hydroxycotinine, urine (ng/mL)    1348 (4209)      3143 (6196)      0.001   
## db:                                                                      <0.001   
##     0                                   3849 (84.5%)     364 (74.7%)              
##     1                                   704 (15.5%)      123 (25.3%)              
## dyslip:                                                                   0.013   
##     0                                   1354 (29.7%)     118 (24.2%)              
##     1                                   3199 (70.3%)     369 (75.8%)              
## hyper:                                                                   <0.001   
##     0                                   2915 (64.0%)     225 (46.2%)              
##     1                                   1638 (36.0%)     262 (53.8%)              
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ggplot(filter_smk, aes(x = dp10, y = sCOT, fill = dp10)) + geom_boxplot() +
  xlab("Depressive Disorder") +
  scale_x_discrete(labels = c ("No", "Yes")) +
  ylab("Serum Cotinine") +
  ggtitle("Relationship between Serum Cotinine & Depressive Disorder") +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(legend.position = "none")
## Warning: Removed 175 rows containing non-finite values (`stat_boxplot()`).

# Check logistic regression

dat = filter_smk

mo_sCOT = glm(dp10 ~ sCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = dat)

mo_sHCOT = glm(dp10 ~ sHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 +BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = dat)

mo_uCOT = glm(dp10 ~ uCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = dat)

mo_sHCOT = glm(dp10 ~ uHCOT + age + sex + ethnic + educ + masts + finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = dat)

# Summary the results of logistic regression
summary(mo_sCOT)
## 
## Call:
## glm(formula = dp10 ~ sCOT + age + sex + ethnic + educ + masts + 
##     finc + PIR + SMQ020 + ALQ101 + PAQ665 + PAQ650 + BMI + SBP + 
##     DBP + AST + ALT + BUN + crea + TC + TG + HDL + LDL + apoB + 
##     hyper + db + dyslip, family = binomial, data = dat)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4731  -0.4650  -0.3023  -0.1811   3.4276  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -4.700e+00  1.103e+00  -4.260 2.04e-05 ***
## sCOT         1.010e-03  5.661e-04   1.784 0.074491 .  
## age         -8.583e-05  8.146e-03  -0.011 0.991594    
## sex2         5.667e-01  2.107e-01   2.690 0.007150 ** 
## ethnic2      2.774e-01  3.536e-01   0.785 0.432708    
## ethnic3      1.196e-01  2.893e-01   0.413 0.679301    
## ethnic4      2.893e-02  3.368e-01   0.086 0.931538    
## ethnic6     -6.089e-01  5.338e-01  -1.141 0.253996    
## ethnic7      9.657e-02  6.241e-01   0.155 0.877034    
## educ2       -2.001e-01  3.487e-01  -0.574 0.565943    
## educ3       -5.077e-01  3.511e-01  -1.446 0.148106    
## educ4       -2.371e-01  3.384e-01  -0.701 0.483454    
## educ5       -4.483e-01  4.089e-01  -1.096 0.272917    
## masts2       2.103e-01  3.219e-01   0.653 0.513450    
## masts3       5.003e-01  2.495e-01   2.005 0.044914 *  
## masts4       9.218e-02  4.385e-01   0.210 0.833507    
## masts5      -3.002e-01  2.968e-01  -1.012 0.311651    
## masts6      -2.638e-01  3.641e-01  -0.725 0.468706    
## finc        -9.393e-02  5.738e-02  -1.637 0.101657    
## PIR         -7.574e-02  1.503e-01  -0.504 0.614274    
## SMQ0202     -1.345e-01  1.960e-01  -0.686 0.492474    
## ALQ1012     -1.881e-01  2.130e-01  -0.883 0.377299    
## PAQ6652      5.698e-01  1.976e-01   2.884 0.003930 ** 
## PAQ6502      4.366e-01  2.960e-01   1.475 0.140151    
## BMI          3.998e-02  1.171e-02   3.415 0.000637 ***
## SBP         -7.295e-03  5.875e-03  -1.242 0.214317    
## DBP          1.651e-04  7.360e-03   0.022 0.982099    
## AST          9.757e-04  3.618e-03   0.270 0.787439    
## ALT          3.905e-03  6.221e-03   0.628 0.530166    
## BUN          1.105e-02  1.657e-02   0.667 0.504631    
## crea         1.159e-01  1.812e-01   0.640 0.522391    
## TC          -1.756e-01  2.998e-01  -0.586 0.558126    
## TG           3.956e-02  5.992e-02   0.660 0.509095    
## HDL          1.861e-01  2.998e-01   0.621 0.534722    
## LDL          1.740e-01  2.995e-01   0.581 0.561383    
## apoB         7.840e-03  1.025e-02   0.765 0.444177    
## hyper1       4.334e-01  2.223e-01   1.950 0.051224 .  
## db1          1.497e-01  2.134e-01   0.702 0.482940    
## dyslip1     -2.129e-01  2.827e-01  -0.753 0.451287    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1169.18  on 1929  degrees of freedom
## Residual deviance:  992.63  on 1891  degrees of freedom
##   (3110 observations deleted due to missingness)
## AIC: 1070.6
## 
## Number of Fisher Scoring iterations: 6
logistic.display(mo_sCOT)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## sCOT (cont. var.) 1.0015 (1.0006,1.0024)  1.001 (0.9999,1.0021)  
##                                                                  
## age (cont. var.)  1.0152 (1.0062,1.0244)  0.9999 (0.9841,1.016)  
##                                                                  
## sex: 2 vs 1       1.74 (1.26,2.41)        1.76 (1.17,2.66)       
##                                                                  
## ethnic: ref.=1                                                   
##    2              1.16 (0.61,2.19)        1.32 (0.66,2.64)       
##    3              1 (0.62,1.61)           1.13 (0.64,1.99)       
##    4              0.89 (0.51,1.56)        1.03 (0.53,1.99)       
##    6              0.22 (0.08,0.59)        0.54 (0.19,1.55)       
##    7              0.89 (0.29,2.69)        1.1 (0.32,3.74)        
##                                                                  
## educ: ref.=1                                                     
##    2              0.66 (0.36,1.19)        0.82 (0.41,1.62)       
##    3              0.45 (0.25,0.8)         0.6 (0.3,1.2)          
##    4              0.52 (0.3,0.89)         0.79 (0.41,1.53)       
##    5              0.2 (0.11,0.38)         0.64 (0.29,1.42)       
##                                                                  
## masts: ref.=1                                                    
##    2              2.34 (1.37,3.97)        1.23 (0.66,2.32)       
##    3              2.73 (1.78,4.19)        1.65 (1.01,2.69)       
##    4              2.43 (1.15,5.14)        1.1 (0.46,2.59)        
##    5              0.87 (0.53,1.42)        0.74 (0.41,1.32)       
##    6              1.23 (0.65,2.33)        0.77 (0.38,1.57)       
##                                                                  
## finc (cont. var.) 0.86 (0.82,0.89)        0.91 (0.81,1.02)       
##                                                                  
## PIR (cont. var.)  0.69 (0.61,0.77)        0.93 (0.69,1.24)       
##                                                                  
## SMQ020: 2 vs 1    0.59 (0.43,0.81)        0.87 (0.6,1.28)        
##                                                                  
## ALQ101: 2 vs 1    1.03 (0.72,1.46)        0.83 (0.55,1.26)       
##                                                                  
## PAQ665: 2 vs 1    2.44 (1.71,3.49)        1.77 (1.2,2.6)         
##                                                                  
## PAQ650: 2 vs 1    3.25 (1.92,5.5)         1.55 (0.87,2.76)       
##                                                                  
## BMI (cont. var.)  1.06 (1.04,1.08)        1.04 (1.02,1.06)       
##                                                                  
## SBP (cont. var.)  1.0088 (1.0004,1.0172)  0.9927 (0.9814,1.0042) 
##                                                                  
## DBP (cont. var.)  1.001 (0.9886,1.0135)   1.0002 (0.9858,1.0147) 
##                                                                  
## AST (cont. var.)  1.0026 (0.9985,1.0066)  1.001 (0.9939,1.0081)  
##                                                                  
## ALT (cont. var.)  1.005 (0.998,1.0121)    1.0039 (0.9917,1.0162) 
##                                                                  
## BUN (cont. var.)  1.03 (1,1.05)           1.01 (0.98,1.04)       
##                                                                  
## crea (cont. var.) 1.07 (0.85,1.35)        1.12 (0.79,1.6)        
##                                                                  
## TC (cont. var.)   1 (1,1.01)              0.84 (0.47,1.51)       
##                                                                  
## TG (cont. var.)   1.01 (1,1.01)           1.04 (0.93,1.17)       
##                                                                  
## HDL (cont. var.)  0.99 (0.98,1)           1.2 (0.67,2.17)        
##                                                                  
## LDL (cont. var.)  1 (1,1.01)              1.19 (0.66,2.14)       
##                                                                  
## apoB (cont. var.) 1.009 (1.0029,1.0152)   1.0079 (0.9878,1.0283) 
##                                                                  
## hyper: 1 vs 0     2.24 (1.63,3.07)        1.54 (1,2.38)          
##                                                                  
## db: 1 vs 0        1.89 (1.33,2.69)        1.16 (0.76,1.76)       
##                                                                  
## dyslip: 1 vs 0    1.54 (1,2.37)           0.81 (0.46,1.41)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) 0.074          0.078     
##                                            
## age (cont. var.)  0.992          0.992     
##                                            
## sex: 2 vs 1       0.007          0.007     
##                                            
## ethnic: ref.=1                   0.654     
##    2              0.433                    
##    3              0.679                    
##    4              0.932                    
##    6              0.254                    
##    7              0.877                    
##                                            
## educ: ref.=1                     0.564     
##    2              0.566                    
##    3              0.148                    
##    4              0.483                    
##    5              0.273                    
##                                            
## masts: ref.=1                    0.194     
##    2              0.513                    
##    3              0.045                    
##    4              0.834                    
##    5              0.312                    
##    6              0.469                    
##                                            
## finc (cont. var.) 0.102          0.098     
##                                            
## PIR (cont. var.)  0.614          0.614     
##                                            
## SMQ020: 2 vs 1    0.492          0.492     
##                                            
## ALQ101: 2 vs 1    0.377          0.374     
##                                            
## PAQ665: 2 vs 1    0.004          0.003     
##                                            
## PAQ650: 2 vs 1    0.14           0.127     
##                                            
## BMI (cont. var.)  < 0.001        < 0.001   
##                                            
## SBP (cont. var.)  0.214          0.211     
##                                            
## DBP (cont. var.)  0.982          0.982     
##                                            
## AST (cont. var.)  0.787          0.791     
##                                            
## ALT (cont. var.)  0.53           0.537     
##                                            
## BUN (cont. var.)  0.505          0.504     
##                                            
## crea (cont. var.) 0.522          0.563     
##                                            
## TC (cont. var.)   0.558          0.558     
##                                            
## TG (cont. var.)   0.509          0.509     
##                                            
## HDL (cont. var.)  0.535          0.535     
##                                            
## LDL (cont. var.)  0.561          0.561     
##                                            
## apoB (cont. var.) 0.444          0.44      
##                                            
## hyper: 1 vs 0     0.051          0.051     
##                                            
## db: 1 vs 0        0.483          0.485     
##                                            
## dyslip: 1 vs 0    0.451          0.454     
##                                            
## Log-likelihood = -496.313
## No. of observations = 1930
## AIC value = 1070.6261
mo_sCOT = glm(dp10 ~ sCOT + age + sex + educ + masts + PIR + SMQ020 + ALQ101 + PAQ665 + BMI + SBP + DBP + AST + ALT + Glu + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, family = binomial, data = dat)

logistic.display(mo_sCOT)
## 
## Logistic regression predicting dp10 : 1 vs 0 
##  
##                   crude OR(95%CI)         adj. OR(95%CI)         
## sCOT (cont. var.) 1.0015 (1.0006,1.0024)  1.0011 (1,1.0022)      
##                                                                  
## age (cont. var.)  1.0152 (1.0061,1.0244)  1.0062 (0.9908,1.0217) 
##                                                                  
## sex: 2 vs 1       1.74 (1.26,2.41)        1.81 (1.2,2.73)        
##                                                                  
## educ: ref.=1                                                     
##    2              0.66 (0.36,1.19)        0.91 (0.47,1.77)       
##    3              0.45 (0.25,0.8)         0.67 (0.35,1.28)       
##    4              0.52 (0.3,0.89)         0.88 (0.47,1.65)       
##    5              0.2 (0.11,0.38)         0.67 (0.31,1.43)       
##                                                                  
## masts: ref.=1                                                    
##    2              2.33 (1.37,3.96)        1.38 (0.74,2.58)       
##    3              2.72 (1.77,4.18)        1.83 (1.15,2.93)       
##    4              2.42 (1.15,5.13)        1.25 (0.54,2.91)       
##    5              0.87 (0.53,1.42)        0.81 (0.47,1.43)       
##    6              1.23 (0.65,2.33)        0.88 (0.44,1.77)       
##                                                                  
## PIR (cont. var.)  0.69 (0.61,0.77)        0.74 (0.64,0.85)       
##                                                                  
## SMQ020: 2 vs 1    0.59 (0.43,0.81)        0.84 (0.57,1.23)       
##                                                                  
## ALQ101: 2 vs 1    1.03 (0.73,1.46)        0.8 (0.53,1.21)        
##                                                                  
## PAQ665: 2 vs 1    2.43 (1.7,3.48)         1.83 (1.25,2.69)       
##                                                                  
## BMI (cont. var.)  1.06 (1.04,1.08)        1.05 (1.02,1.07)       
##                                                                  
## SBP (cont. var.)  1.0088 (1.0004,1.0172)  0.9933 (0.9821,1.0046) 
##                                                                  
## DBP (cont. var.)  1.001 (0.9887,1.0135)   0.9996 (0.9853,1.0141) 
##                                                                  
## AST (cont. var.)  1.0026 (0.9985,1.0066)  1.0017 (0.9947,1.0088) 
##                                                                  
## ALT (cont. var.)  1.005 (0.998,1.0121)    1.0027 (0.9906,1.0149) 
##                                                                  
## Glu (cont. var.)  1.0073 (1.0037,1.0109)  1.0022 (0.9968,1.0075) 
##                                                                  
## BUN (cont. var.)  1.0254 (1.0017,1.0497)  1.0089 (0.9772,1.0416) 
##                                                                  
## crea (cont. var.) 1.07 (0.85,1.35)        1.15 (0.82,1.62)       
##                                                                  
## TC (cont. var.)   1 (1,1.01)              0.86 (0.48,1.54)       
##                                                                  
## TG (cont. var.)   1.01 (1,1.01)           1.04 (0.92,1.16)       
##                                                                  
## HDL (cont. var.)  0.99 (0.98,1)           1.18 (0.66,2.11)       
##                                                                  
## LDL (cont. var.)  1 (1,1.01)              1.17 (0.65,2.09)       
##                                                                  
## apoB (cont. var.) 1.009 (1.0029,1.0152)   1.0062 (0.9862,1.0265) 
##                                                                  
## hyper: 1 vs 0     2.24 (1.63,3.07)        1.51 (0.98,2.33)       
##                                                                  
## db: 1 vs 0        1.89 (1.33,2.69)        1.02 (0.61,1.7)        
##                                                                  
## dyslip: 1 vs 0    1.54 (1,2.37)           0.83 (0.48,1.44)       
##                                                                  
##                   P(Wald's test) P(LR-test)
## sCOT (cont. var.) 0.043          0.046     
##                                            
## age (cont. var.)  0.433          0.433     
##                                            
## sex: 2 vs 1       0.005          0.004     
##                                            
## educ: ref.=1                     0.565     
##    2              0.792                    
##    3              0.226                    
##    4              0.698                    
##    5              0.301                    
##                                            
## masts: ref.=1                    0.128     
##    2              0.305                    
##    3              0.011                    
##    4              0.597                    
##    5              0.473                    
##    6              0.717                    
##                                            
## PIR (cont. var.)  < 0.001        < 0.001   
##                                            
## SMQ020: 2 vs 1    0.36           0.359     
##                                            
## ALQ101: 2 vs 1    0.289          0.285     
##                                            
## PAQ665: 2 vs 1    0.002          0.001     
##                                            
## BMI (cont. var.)  < 0.001        < 0.001   
##                                            
## SBP (cont. var.)  0.245          0.242     
##                                            
## DBP (cont. var.)  0.956          0.956     
##                                            
## AST (cont. var.)  0.628          0.639     
##                                            
## ALT (cont. var.)  0.663          0.666     
##                                            
## Glu (cont. var.)  0.426          0.432     
##                                            
## BUN (cont. var.)  0.586          0.586     
##                                            
## crea (cont. var.) 0.426          0.481     
##                                            
## TC (cont. var.)   0.604          0.603     
##                                            
## TG (cont. var.)   0.553          0.553     
##                                            
## HDL (cont. var.)  0.583          0.583     
##                                            
## LDL (cont. var.)  0.605          0.605     
##                                            
## apoB (cont. var.) 0.548          0.545     
##                                            
## hyper: 1 vs 0     0.061          0.06      
##                                            
## db: 1 vs 0        0.948          0.948     
##                                            
## dyslip: 1 vs 0    0.507          0.51      
##                                            
## Log-likelihood = -500.4239
## No. of observations = 1928
## AIC value = 1066.8478
# Figure of OR (95% CI) of having Depressive Disorder;

ggcoef(mo_sCOT, exponentiate=T, exclude_intercept=T, vline_color = "red", errorbar_color = "blue", errorbar_height = 0.10)

# Danh gia tinh phan dinh (Discrimination)
library(Epi)

ROC(form = dp10 ~ sCOT + age + sex + educ + masts + PIR + SMQ020 + ALQ101 + PAQ665 + BMI + SBP + DBP + AST + ALT + Glu + BUN + crea + TC + TG + HDL + LDL + apoB + hyper + db + dyslip, data=dat, plot = "ROC", lwd=2)