Cumulative and reversible impact of cigarette smoking on fragility fractures

Statistical analysis plan: - Aims: to quantify the association between cigarette smoking and risks of (i) any fracture and (ii) hip fracture to quantify number of fractures possibly prevented if smokers woult quit - Design: + Participants: MrOS participants + Outcomes: (i) any fracture, (ii) hip fracture, and (iii) post-fracture death + Exposures: (i) Smoking status (smoke_status): none, past and current (ii) Number of pack-years (smoke_packyrs): continuous; quintiles; excess smoking (different thresholds: 20 pack-years) (iii) No. cigarettes smoked per day over a lifetime (smoke_perddlife): (iv) Duration of smoking: [smoke_agestop (or age if no smoke_agestop) - smoke_age1st] (v) Whether the participants smoked 100+ cigarettes in their lifetime (smoke_100life) + Covariates: risk factors for fractures (age, FNBMD, history of falls, history of fractures), lifestyle factors (alcohol drinking, calcium/ protein intake, physical activity) and comorbidity. - Analysis: + Descriptive analysis + Cox’s regression + Heuristic PAR

libraries

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.3     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(table1)
## 
## Attaching package: 'table1'
## 
## The following objects are masked from 'package:base':
## 
##     units, units<-
library(compareGroups)
library(survival)
library(expss)
## Warning: package 'expss' was built under R version 4.3.2
## Loading required package: maditr
## Warning: package 'maditr' was built under R version 4.3.2
## 
## To aggregate data: take(mtcars, mean_mpg = mean(mpg), by = am)
## 
## 
## Attaching package: 'maditr'
## 
## The following objects are masked from 'package:dplyr':
## 
##     between, coalesce, first, last
## 
## The following object is masked from 'package:purrr':
## 
##     transpose
## 
## The following object is masked from 'package:readr':
## 
##     cols
## 
## 
## Use 'expss_output_viewer()' to display tables in the RStudio Viewer.
##  To return to the console output, use 'expss_output_default()'.
## 
## 
## Attaching package: 'expss'
## 
## The following objects are masked from 'package:stringr':
## 
##     fixed, regex
## 
## The following objects are masked from 'package:dplyr':
## 
##     compute, contains, na_if, recode, vars, where
## 
## The following objects are masked from 'package:purrr':
## 
##     keep, modify, modify_if, when
## 
## The following objects are masked from 'package:tidyr':
## 
##     contains, nest
## 
## The following object is masked from 'package:ggplot2':
## 
##     vars
library(ggfortify)
## Warning: package 'ggfortify' was built under R version 4.3.2

Data set-up:

data = read.csv("C:\\Thach\\Research projects\\PAR for lifestyle factors\\SOF_MrOS_Nick_lifestyle_02aug24.csv")
data = data %>% mutate(race.n = case_when(race == "1:WHITE" ~ "1_White",
                                        race == "2:AFRICAN AMERICAN" ~ "2_African",
                                        race == "3:ASIAN" ~ "3_Asian",
                                        race == "4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER" | race == "5:AMERICAN INDIAN OR ALASKAN NATIVE" | race == "6:MULTI RACIAL" | race == "7:UNKNOWN" ~ "0_Other"))

data = data %>% mutate(fall_bin = case_when(no_falls == 0 ~ "1.No falls",
                                            no_falls > 0 ~ "2.Falls 1+"))

data = data %>% mutate(smoke_bin = case_when(smoke == "Never" | smoke == "Past" ~ "1.No/past smoking",
                                             smoke == "Current" ~ "2.Current smoking"))

data = data %>% mutate(physical_bin = case_when(physical4 == "Moderate" | physical4 == "High" | physical4 == "Low" ~ "1.Proactive",
                                                physical4 == "No" ~ "2.Less active"))

data = data %>% mutate(calci_bin = case_when(calcium2 >= 1000 ~ "1.Sufficient Calcium",
                                           calcium2 < 1000 ~ "2.Insufficient Calcium"))

data = data %>% mutate(age_bin = case_when(age < 75 ~ "1.Age< 75",
                                           age >= 75 ~ "2.Age>= 75"))

data = data %>% mutate(bmd_bin = case_when(Tscore > -2.5 ~ "1.BMD> -2.5",
                                           Tscore <= -2.5 ~ "2.BMD<= -2.5"))

data = data %>% mutate(fx50_bin = case_when(fx50 == 0 ~ "1.No fx",
                                            fx50 > 0 ~ "2.Fx 1+"))

data = data %>% mutate(drink_bin = case_when(drink4 == "No" | drink4 == "Low" | drink4 == "Moderate" ~ "1.Less drinking",
                                             drink4 == "High" ~ "2.Excessive drinking"))

data = data %>% mutate(activity_bin = case_when(physical4 == "Moderate" | physical4 == "High" ~ "1.Proactive",
                                                physical4 == "No" | physical4 == "Low" ~ "2.Less active"))

men = subset(data, gender == "M")

# Combination of risk factors for smoking (Current vs. None/Past):
men = men %>% mutate(group = case_when(age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 1,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 2,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 3,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 4,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 5,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 6,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 7,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 8,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 9,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 10,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 11,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 12,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 13,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 14,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 15,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 16,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "1.No/past smoking" ~ 17,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 18,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 19,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 20,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 21,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 22,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 23,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 24,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 25,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 26,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "1.No/past smoking" ~ 27,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke_bin == "2.Current smoking" ~ 28,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 29,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 30,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 31,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke_bin == "2.Current smoking" ~ 32))

men = men %>% mutate(fu_anyfx = case_when(anyfx == 0 ~ time2end,
                                          anyfx == 1 ~ time2any))

men = men %>% mutate(fu_hipfx = case_when(hipfx == 0 ~ time2end,
                                          hipfx == 1 ~ time2hip))
                                             
men = men %>% mutate(protein_bin = case_when(protein2 >= 78.2 ~ "1.Sufficient protein",
                                             protein2 < 78.2 ~ "2.Insufficient protein"))

Smoking data

smoke = read.csv("C:\\Thach\\Research projects\\PAR for lifestyle factors\\Smoking\\smoking_data.csv")
head(smoke)
##       ID smoke_status smoke_packyrs cigar_yrs cigar_perwk cigar_status
## 1 BI0001         0:NO            NA        NA          NA        0: No
## 2 BI0002       1:PAST          0.15        NA          NA        0: No
## 3 BI0003       1:PAST          6.50        NA          NA        0: No
## 4 BI0004       1:PAST         27.00         3           8       1: Yes
## 5 BI0005       1:PAST         72.50        NA          NA        0: No
## 6 BI0006       1:PAST         24.00        NA          NA        0: No
##   smoke_age1st smoke_perdd smoke_perddlife smoke_agestop smoke_100life
## 1           NA          NA              NA            NA         0: No
## 2           21          NA               3            22        1: Yes
## 3           18          NA              10            31        1: Yes
## 4           13          NA              20            40        1: Yes
## 5           21          NA              50            50        1: Yes
## 6           16          NA              20            40        1: Yes
##   smoke_yrsstop snuff_age1st snuff_perwk snuff_current snuff_agestop snuff_ever
## 1            NA           NA          NA                          NA      0: No
## 2            45           NA          NA                          NA      0: No
## 3            41           NA          NA                          NA      0: No
## 4            25           NA          NA                          NA      0: No
## 5            28           NA          NA                          NA      0: No
## 6            38           NA          NA                          NA      0: No
men.smk = merge(men, smoke, by = "ID", all.x = TRUE)
men.smk = men.smk %>% mutate(smk_dur = case_when(smoke_status == "1:PAST" ~ smoke_agestop - smoke_age1st,
                                                 smoke_status == "2:CURRENT" ~ age - smoke_age1st,
                                                 smoke_status == "0:NO" ~ 0))
men.smk[is.na(men.smk)] = 0
head(men.smk)
##       ID data Visit gender age    race education weight height      BMI
## 1 BI0001 MrOS     1      M  67 1:WHITE         7   87.8 172.75 29.42107
## 2 BI0002 MrOS     1      M  67 1:WHITE         7   99.4 176.60 31.87168
## 3 BI0003 MrOS     1      M  72 1:WHITE         5   83.1 178.45 26.09564
## 4 BI0004 MrOS     1      M  65 1:WHITE         7   97.4 184.65 28.56672
## 5 BI0005 MrOS     1      M  78 1:WHITE         5   82.9 168.75 29.11166
## 6 BI0006 MrOS     1      M  78 1:WHITE         3   76.3 163.75 28.45522
##   no_falls fx50 physical hypertension copd parkinson cancer rheumatoid cvd
## 1        0    0        1            0    0         1      0          0   0
## 2        0    0        1            1    0         1      0          1   1
## 3        0    1        1            0    0         0      0          0   1
## 4        0    0        0            0    0         0      0          0   0
## 5        1    0        1            0    0         0      1          0   0
## 6        1    0        0            0    1         0      0          1   0
##   renal depression diabetes MedYes DeathX     fnbmd time2visit anyfx  time2any
## 1     1          0        0      0      0 0.8674233          0     0 13.971300
## 2     1          0        0      0      0 0.7402350          0     0 14.636600
## 3     0          0        0      0      1 0.6918427          0     1  8.421629
## 4     0          0        0      0      1 0.8783067          0     0 19.540000
## 5     0          0        0      0      3 0.9194940          0     0  3.036300
## 6     0          1        0      0      3 0.8862731          0     0 13.149900
##   hipfx time2hip death time2end     Tscore      Osteo smoke physical4 physical7
## 1     0  13.9713     1  13.9713 -0.4859616     Normal Never      High         0
## 2     0  14.6366     1  14.6366 -1.4143433 Osteopenia  Past        No      8897
## 3     0  13.9493     1  13.9493 -1.7675718 Osteopenia  Past       Low      5957
## 4     0  19.5400     0  19.5400 -0.4065204     Normal  Past       Low      2905
## 5     0   3.0363     1   3.0363 -0.1058833     Normal  Past        No         0
## 6     0  13.1499     0  13.1499 -0.3483715     Normal  Past        No       714
##   drink4 drink7  coffee4 calcium2 protein2  race.n   fall_bin         smoke_bin
## 1     No      0 Moderate   1588.5     74.2 1_White 1.No falls 1.No/past smoking
## 2     No      0 Moderate    416.8     58.1 1_White 1.No falls 1.No/past smoking
## 3   High      5 Moderate    815.1     50.0 1_White 1.No falls 1.No/past smoking
## 4    Low      1      Low    900.0     85.5 1_White 1.No falls 1.No/past smoking
## 5     No      0       No    569.1     41.4 1_White 2.Falls 1+ 1.No/past smoking
## 6     No      0      Low    797.7     46.2 1_White 2.Falls 1+ 1.No/past smoking
##    physical_bin              calci_bin    age_bin     bmd_bin fx50_bin
## 1   1.Proactive   1.Sufficient Calcium  1.Age< 75 1.BMD> -2.5  1.No fx
## 2 2.Less active 2.Insufficient Calcium  1.Age< 75 1.BMD> -2.5  1.No fx
## 3   1.Proactive 2.Insufficient Calcium  1.Age< 75 1.BMD> -2.5  2.Fx 1+
## 4   1.Proactive 2.Insufficient Calcium  1.Age< 75 1.BMD> -2.5  1.No fx
## 5 2.Less active 2.Insufficient Calcium 2.Age>= 75 1.BMD> -2.5  1.No fx
## 6 2.Less active 2.Insufficient Calcium 2.Age>= 75 1.BMD> -2.5  1.No fx
##              drink_bin  activity_bin group  fu_anyfx fu_hipfx
## 1      1.Less drinking   1.Proactive     1 13.971300  13.9713
## 2      1.Less drinking 2.Less active     1 14.636600  14.6366
## 3 2.Excessive drinking 2.Less active     3  8.421629  13.9493
## 4      1.Less drinking 2.Less active     1 19.540000  19.5400
## 5      1.Less drinking 2.Less active     8  3.036300   3.0363
## 6      1.Less drinking 2.Less active     8 13.149900  13.1499
##              protein_bin smoke_status smoke_packyrs cigar_yrs cigar_perwk
## 1 2.Insufficient protein         0:NO          0.00         0           0
## 2 2.Insufficient protein       1:PAST          0.15         0           0
## 3 2.Insufficient protein       1:PAST          6.50         0           0
## 4   1.Sufficient protein       1:PAST         27.00         3           8
## 5 2.Insufficient protein       1:PAST         72.50         0           0
## 6 2.Insufficient protein       1:PAST         24.00         0           0
##   cigar_status smoke_age1st smoke_perdd smoke_perddlife smoke_agestop
## 1        0: No            0           0               0             0
## 2        0: No           21           0               3            22
## 3        0: No           18           0              10            31
## 4       1: Yes           13           0              20            40
## 5        0: No           21           0              50            50
## 6        0: No           16           0              20            40
##   smoke_100life smoke_yrsstop snuff_age1st snuff_perwk snuff_current
## 1         0: No             0            0           0              
## 2        1: Yes            45            0           0              
## 3        1: Yes            41            0           0              
## 4        1: Yes            25            0           0              
## 5        1: Yes            28            0           0              
## 6        1: Yes            38            0           0              
##   snuff_agestop snuff_ever smk_dur
## 1             0      0: No       0
## 2             0      0: No       1
## 3             0      0: No      13
## 4             0      0: No      27
## 5             0      0: No      29
## 6             0      0: No      24

Flowchart

Data management

men.smk = men.smk %>% mutate(fx_death = case_when(anyfx == 0 & death == 0 ~ "Event-free",
                                                  anyfx == 1 & death == 0 ~ "Fractured",
                                                  anyfx == 0 & death == 1 ~ "Dead w/o fracture"))
men.smk = men.smk %>% mutate(hip_death = case_when(hipfx == 0 & death == 0 ~ "Event-free",
                                                  hipfx == 1 & death == 0 ~ "Fractured",
                                                  hipfx == 0 & death == 1 ~ "Dead w/o fracture"))
men.anyfx = subset(men.smk, anyfx == 1)
men.anyfx$postfx_death = ifelse(men.anyfx$death == 1, 1, 0)
men.hipfx = subset(men.smk, hipfx == 1)
men.hipfx$postfx_death = ifelse(men.hipfx$death == 1, 1, 0)

Flowchart

table(men.smk$fx_death)
## 
## Dead w/o fracture        Event-free         Fractured 
##              2918              1990               391
table(men.smk$hip_death)
## 
## Dead w/o fracture        Event-free         Fractured 
##              3437              2318                63
table(men.anyfx$postfx_death)
## 
##   0   1 
## 391 693
table(men.hipfx$postfx_death)
## 
##   0   1 
##  63 174

(1) Descriptive analysis

(1.1) Any fracture:

table1(~ age + as.factor(age_bin) + race + fnbmd + Tscore + as.factor(bmd_bin) + as.factor(no_falls) + as.factor(fall_bin) + as.factor(fx50) + as.factor(fx50_bin) + as.factor(smoke) + as.factor(smoke_bin) +  smoke_status + smoke_packyrs + smoke_perddlife + smoke_perdd + smk_dur + smoke_age1st + smoke_agestop + as.factor(smoke_100life) + drink4 + as.factor(drink_bin) + physical4 + as.factor(activity_bin) + calcium2 + as.factor(calci_bin) + protein2 + as.factor(education) + BMI + as.factor(cvd) + as.factor(hypertension) + as.factor(copd) + as.factor(diabetes) + as.factor(cancer) + as.factor(renal) + as.factor(parkinson) + as.factor(depression) + as.factor(rheumatoid) + as.factor(death) | anyfx, data = men.smk, render.continuous = c(. = "Mean(SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + as.factor(age_bin) + race + fnbmd + Tscore + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
0
(N=4908)
1
(N=1084)
Overall
(N=5992)
age
Mean(SD) 73.5(5.86) 74.5(5.88) 73.7(5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 74.0 [70.0, 78.0] 73.0 [69.0, 78.0]
as.factor(age_bin)
1.Age< 75 2909 (59.3%) 567 (52.3%) 3476 (58.0%)
2.Age>= 75 1999 (40.7%) 517 (47.7%) 2516 (42.0%)
race
1:WHITE 4368 (89.0%) 1016 (93.7%) 5384 (89.9%)
2:AFRICAN AMERICAN 226 (4.6%) 18 (1.7%) 244 (4.1%)
3:ASIAN 166 (3.4%) 26 (2.4%) 192 (3.2%)
4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER 6 (0.1%) 1 (0.1%) 7 (0.1%)
5:AMERICAN INDIAN OR ALASKAN NATIVE 6 (0.1%) 1 (0.1%) 7 (0.1%)
6:MULTI RACIAL 58 (1.2%) 3 (0.3%) 61 (1.0%)
7:UNKNOWN 78 (1.6%) 19 (1.8%) 97 (1.6%)
fnbmd
Mean(SD) 0.794(0.127) 0.739(0.122) 0.784(0.128)
Median [Q1, Q3] 0.783 [0.707, 0.870] 0.728 [0.652, 0.812] 0.774 [0.696, 0.860]
Tscore
Mean(SD) -1.02(0.930) -1.43(0.887) -1.09(0.935)
Median [Q1, Q3] -1.10 [-1.66, -0.466] -1.50 [-2.06, -0.894] -1.17 [-1.73, -0.539]
as.factor(bmd_bin)
1.BMD> -2.5 4721 (96.2%) 976 (90.0%) 5697 (95.1%)
2.BMD<= -2.5 187 (3.8%) 108 (10.0%) 295 (4.9%)
as.factor(no_falls)
0 3924 (80.0%) 801 (73.9%) 4725 (78.9%)
1 984 (20.0%) 283 (26.1%) 1267 (21.1%)
as.factor(fall_bin)
1.No falls 3924 (80.0%) 801 (73.9%) 4725 (78.9%)
2.Falls 1+ 984 (20.0%) 283 (26.1%) 1267 (21.1%)
as.factor(fx50)
0 4141 (84.4%) 820 (75.6%) 4961 (82.8%)
1 595 (12.1%) 184 (17.0%) 779 (13.0%)
2 133 (2.7%) 59 (5.4%) 192 (3.2%)
3 31 (0.6%) 12 (1.1%) 43 (0.7%)
4 7 (0.1%) 6 (0.6%) 13 (0.2%)
5 0 (0%) 2 (0.2%) 2 (0.0%)
6 1 (0.0%) 1 (0.1%) 2 (0.0%)
as.factor(fx50_bin)
1.No fx 4141 (84.4%) 820 (75.6%) 4961 (82.8%)
2.Fx 1+ 767 (15.6%) 264 (24.4%) 1031 (17.2%)
as.factor(smoke)
Current 162 (3.3%) 44 (4.1%) 206 (3.4%)
Never 1837 (37.4%) 412 (38.0%) 2249 (37.5%)
Past 2909 (59.3%) 628 (57.9%) 3537 (59.0%)
as.factor(smoke_bin)
1.No/past smoking 4746 (96.7%) 1040 (95.9%) 5786 (96.6%)
2.Current smoking 162 (3.3%) 44 (4.1%) 206 (3.4%)
smoke_status
1 (0.0%) 0 (0%) 1 (0.0%)
0:NO 1836 (37.4%) 412 (38.0%) 2248 (37.5%)
1:PAST 2909 (59.3%) 628 (57.9%) 3537 (59.0%)
2:CURRENT 162 (3.3%) 44 (4.1%) 206 (3.4%)
smoke_packyrs
Mean(SD) 18.1(24.6) 17.7(24.6) 18.1(24.6)
Median [Q1, Q3] 7.40 [0, 29.0] 5.65 [0, 29.0] 7.00 [0, 29.0]
smoke_perddlife
Mean(SD) 12.6(13.9) 12.1(13.6) 12.5(13.8)
Median [Q1, Q3] 10.0 [0, 20.0] 10.0 [0, 20.0] 10.0 [0, 20.0]
smoke_perdd
Mean(SD) 0.540(3.45) 0.705(3.96) 0.570(3.55)
Median [Q1, Q3] 0 [0, 0] 0 [0, 0] 0 [0, 0]
smk_dur
Mean(SD) 16.7(17.6) 16.6(18.0) 16.7(17.6)
Median [Q1, Q3] 12.0 [0, 30.0] 11.0 [0, 30.0] 12.0 [0, 30.0]
smoke_age1st
Mean(SD) 11.4(9.55) 11.6(9.89) 11.5(9.61)
Median [Q1, Q3] 15.0 [0, 18.0] 16.0 [0, 19.0] 15.0 [0, 18.0]
smoke_agestop
Mean(SD) 25.8(23.8) 25.3(24.0) 25.7(23.8)
Median [Q1, Q3] 30.0 [0, 45.0] 27.0 [0, 45.0] 29.0 [0, 45.0]
as.factor(smoke_100life)
0: No 1836 (37.4%) 412 (38.0%) 2248 (37.5%)
1: Yes 3072 (62.6%) 672 (62.0%) 3744 (62.5%)
drink4
High 1578 (32.2%) 372 (34.3%) 1950 (32.5%)
Low 726 (14.8%) 155 (14.3%) 881 (14.7%)
Moderate 393 (8.0%) 70 (6.5%) 463 (7.7%)
No 2211 (45.0%) 487 (44.9%) 2698 (45.0%)
as.factor(drink_bin)
1.Less drinking 3330 (67.8%) 712 (65.7%) 4042 (67.5%)
2.Excessive drinking 1578 (32.2%) 372 (34.3%) 1950 (32.5%)
physical4
High 695 (14.2%) 171 (15.8%) 866 (14.5%)
Low 1361 (27.7%) 281 (25.9%) 1642 (27.4%)
Moderate 558 (11.4%) 121 (11.2%) 679 (11.3%)
No 2294 (46.7%) 511 (47.1%) 2805 (46.8%)
as.factor(activity_bin)
1.Proactive 1253 (25.5%) 292 (26.9%) 1545 (25.8%)
2.Less active 3655 (74.5%) 792 (73.1%) 4447 (74.2%)
calcium2
Mean(SD) 795(392) 784(388) 793(391)
Median [Q1, Q3] 730 [523, 991] 720 [515, 993] 728 [522, 991]
as.factor(calci_bin)
1.Sufficient Calcium 1194 (24.3%) 264 (24.4%) 1458 (24.3%)
2.Insufficient Calcium 3714 (75.7%) 820 (75.6%) 4534 (75.7%)
protein2
Mean(SD) 64.4(27.6) 62.6(26.1) 64.1(27.4)
Median [Q1, Q3] 60.2 [45.8, 78.7] 59.5 [45.2, 76.7] 60.2 [45.7, 78.2]
as.factor(education)
1 13 (0.3%) 3 (0.3%) 16 (0.3%)
2 82 (1.7%) 15 (1.4%) 97 (1.6%)
3 243 (5.0%) 35 (3.2%) 278 (4.6%)
4 860 (17.5%) 176 (16.2%) 1036 (17.3%)
5 1132 (23.1%) 245 (22.6%) 1377 (23.0%)
6 874 (17.8%) 220 (20.3%) 1094 (18.3%)
7 507 (10.3%) 126 (11.6%) 633 (10.6%)
8 1197 (24.4%) 264 (24.4%) 1461 (24.4%)
BMI
Mean(SD) 27.4(3.95) 27.1(3.88) 27.3(3.94)
Median [Q1, Q3] 26.9 [24.9, 29.5] 26.6 [24.4, 29.3] 26.9 [24.8, 29.5]
as.factor(cvd)
0 3889 (79.2%) 852 (78.6%) 4741 (79.1%)
1 1019 (20.8%) 232 (21.4%) 1251 (20.9%)
as.factor(hypertension)
0 2804 (57.1%) 607 (56.0%) 3411 (56.9%)
1 2104 (42.9%) 477 (44.0%) 2581 (43.1%)
as.factor(copd)
0 4393 (89.5%) 959 (88.5%) 5352 (89.3%)
1 515 (10.5%) 125 (11.5%) 640 (10.7%)
as.factor(diabetes)
0 4370 (89.0%) 969 (89.4%) 5339 (89.1%)
1 538 (11.0%) 115 (10.6%) 653 (10.9%)
as.factor(cancer)
0 4011 (81.7%) 889 (82.0%) 4900 (81.8%)
1 897 (18.3%) 195 (18.0%) 1092 (18.2%)
as.factor(renal)
0 4472 (91.1%) 967 (89.2%) 5439 (90.8%)
1 436 (8.9%) 117 (10.8%) 553 (9.2%)
as.factor(parkinson)
0 4253 (86.7%) 950 (87.6%) 5203 (86.8%)
1 655 (13.3%) 134 (12.4%) 789 (13.2%)
as.factor(depression)
0 4750 (96.8%) 1031 (95.1%) 5781 (96.5%)
1 158 (3.2%) 53 (4.9%) 211 (3.5%)
as.factor(rheumatoid)
0 2573 (52.4%) 574 (53.0%) 3147 (52.5%)
1 2335 (47.6%) 510 (47.0%) 2845 (47.5%)
as.factor(death)
0 1990 (40.5%) 391 (36.1%) 2381 (39.7%)
1 2918 (59.5%) 693 (63.9%) 3611 (60.3%)
createTable(compareGroups(anyfx ~ age + age_bin + race + fnbmd + Tscore + bmd_bin + no_falls + fall_bin + fx50 + fx50_bin + smoke + smoke_bin +  smoke_status + smoke_packyrs + smoke_perddlife + smoke_perdd + smk_dur + smoke_age1st + smoke_agestop + smoke_100life + drink4 + drink_bin + physical4 + activity_bin + calcium2 + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)) 
## 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 'anyfx'---------
## 
## __________________________________________________________________________________ 
##                                                     0            1       p.overall 
##                                                   N=4908       N=1084              
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## age                                            73.5 (5.86)  74.5 (5.88)   <0.001   
## age_bin:                                                                  <0.001   
##     1.Age< 75                                  2909 (59.3%) 567 (52.3%)            
##     2.Age>= 75                                 1999 (40.7%) 517 (47.7%)            
## race:                                                                        .     
##     1:WHITE                                    4368 (89.0%) 1016 (93.7%)           
##     2:AFRICAN AMERICAN                         226 (4.60%)   18 (1.66%)            
##     3:ASIAN                                    166 (3.38%)   26 (2.40%)            
##     4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER  6 (0.12%)    1 (0.09%)             
##     5:AMERICAN INDIAN OR ALASKAN NATIVE         6 (0.12%)    1 (0.09%)             
##     6:MULTI RACIAL                              58 (1.18%)   3 (0.28%)             
##     7:UNKNOWN                                   78 (1.59%)   19 (1.75%)            
## fnbmd                                          0.79 (0.13)  0.74 (0.12)   <0.001   
## Tscore                                         -1.02 (0.93) -1.43 (0.89)  <0.001   
## bmd_bin:                                                                  <0.001   
##     1.BMD> -2.5                                4721 (96.2%) 976 (90.0%)            
##     2.BMD<= -2.5                               187 (3.81%)  108 (9.96%)            
## no_falls                                       0.20 (0.40)  0.26 (0.44)   <0.001   
## fall_bin:                                                                 <0.001   
##     1.No falls                                 3924 (80.0%) 801 (73.9%)            
##     2.Falls 1+                                 984 (20.0%)  283 (26.1%)            
## fx50                                           0.20 (0.53)  0.35 (0.73)   <0.001   
## fx50_bin:                                                                 <0.001   
##     1.No fx                                    4141 (84.4%) 820 (75.6%)            
##     2.Fx 1+                                    767 (15.6%)  264 (24.4%)            
## smoke:                                                                     0.400   
##     Current                                    162 (3.30%)   44 (4.06%)            
##     Never                                      1837 (37.4%) 412 (38.0%)            
##     Past                                       2909 (59.3%) 628 (57.9%)            
## smoke_bin:                                                                 0.251   
##     1.No/past smoking                          4746 (96.7%) 1040 (95.9%)           
##     2.Current smoking                          162 (3.30%)   44 (4.06%)            
## smoke_status:                                                              0.497   
##                                                 1 (0.02%)    0 (0.00%)             
##     0:NO                                       1836 (37.4%) 412 (38.0%)            
##     1:PAST                                     2909 (59.3%) 628 (57.9%)            
##     2:CURRENT                                  162 (3.30%)   44 (4.06%)            
## smoke_packyrs                                  18.1 (24.6)  17.7 (24.6)    0.586   
## smoke_perddlife                                12.6 (13.9)  12.1 (13.6)    0.312   
## smoke_perdd                                    0.54 (3.45)  0.70 (3.96)    0.205   
## smk_dur                                        16.7 (17.6)  16.6 (18.0)    0.871   
## smoke_age1st                                   11.4 (9.55)  11.6 (9.89)    0.658   
## smoke_agestop                                  25.8 (23.8)  25.3 (24.0)    0.501   
## smoke_100life:                                                             0.738   
##     0: No                                      1836 (37.4%) 412 (38.0%)            
##     1: Yes                                     3072 (62.6%) 672 (62.0%)            
## drink4:                                                                    0.242   
##     High                                       1578 (32.2%) 372 (34.3%)            
##     Low                                        726 (14.8%)  155 (14.3%)            
##     Moderate                                   393 (8.01%)   70 (6.46%)            
##     No                                         2211 (45.0%) 487 (44.9%)            
## drink_bin:                                                                 0.180   
##     1.Less drinking                            3330 (67.8%) 712 (65.7%)            
##     2.Excessive drinking                       1578 (32.2%) 372 (34.3%)            
## physical4:                                                                 0.436   
##     High                                       695 (14.2%)  171 (15.8%)            
##     Low                                        1361 (27.7%) 281 (25.9%)            
##     Moderate                                   558 (11.4%)  121 (11.2%)            
##     No                                         2294 (46.7%) 511 (47.1%)            
## activity_bin:                                                              0.357   
##     1.Proactive                                1253 (25.5%) 292 (26.9%)            
##     2.Less active                              3655 (74.5%) 792 (73.1%)            
## calcium2                                        795 (392)    784 (388)     0.409   
## calci_bin:                                                                 1.000   
##     1.Sufficient Calcium                       1194 (24.3%) 264 (24.4%)            
##     2.Insufficient Calcium                     3714 (75.7%) 820 (75.6%)            
## protein2                                       64.4 (27.6)  62.6 (26.1)    0.049   
## education                                      5.78 (1.66)  5.89 (1.59)    0.051   
## BMI                                            27.4 (3.95)  27.1 (3.88)    0.016   
## cvd                                            0.21 (0.41)  0.21 (0.41)    0.641   
## hypertension                                   0.43 (0.49)  0.44 (0.50)    0.496   
## copd                                           0.10 (0.31)  0.12 (0.32)    0.330   
## diabetes                                       0.11 (0.31)  0.11 (0.31)    0.734   
## cancer                                         0.18 (0.39)  0.18 (0.38)    0.824   
## renal                                          0.09 (0.28)  0.11 (0.31)    0.063   
## parkinson                                      0.13 (0.34)  0.12 (0.33)    0.376   
## depression                                     0.03 (0.18)  0.05 (0.22)    0.017   
## rheumatoid                                     0.48 (0.50)  0.47 (0.50)    0.753   
## death                                          0.59 (0.49)  0.64 (0.48)    0.006   
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

(1.2) Hip fracture:

table1(~ age + as.factor(age_bin) + race + fnbmd + Tscore + as.factor(bmd_bin) + as.factor(no_falls) + as.factor(fall_bin) + as.factor(fx50) + as.factor(fx50_bin) + as.factor(smoke) + as.factor(smoke_bin) +  smoke_status + smoke_packyrs + smoke_perddlife + smoke_perdd + smk_dur + smoke_age1st + smoke_agestop + as.factor(smoke_100life) + drink4 + as.factor(drink_bin) + physical4 + as.factor(activity_bin) + calcium2 + as.factor(calci_bin) + protein2 + as.factor(education) + BMI + as.factor(cvd) + as.factor(hypertension) + as.factor(copd) + as.factor(diabetes) + as.factor(cancer) + as.factor(renal) + as.factor(parkinson) + as.factor(depression) + as.factor(rheumatoid) + as.factor(death) | hipfx, data = men.smk, render.continuous = c(. = "Mean(SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + as.factor(age_bin) + race + fnbmd + Tscore + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
0
(N=5755)
1
(N=237)
Overall
(N=5992)
age
Mean(SD) 73.5(5.84) 76.4(6.09) 73.7(5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 76.0 [72.0, 80.0] 73.0 [69.0, 78.0]
as.factor(age_bin)
1.Age< 75 3384 (58.8%) 92 (38.8%) 3476 (58.0%)
2.Age>= 75 2371 (41.2%) 145 (61.2%) 2516 (42.0%)
race
1:WHITE 5157 (89.6%) 227 (95.8%) 5384 (89.9%)
2:AFRICAN AMERICAN 241 (4.2%) 3 (1.3%) 244 (4.1%)
3:ASIAN 188 (3.3%) 4 (1.7%) 192 (3.2%)
4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER 7 (0.1%) 0 (0%) 7 (0.1%)
5:AMERICAN INDIAN OR ALASKAN NATIVE 7 (0.1%) 0 (0%) 7 (0.1%)
6:MULTI RACIAL 60 (1.0%) 1 (0.4%) 61 (1.0%)
7:UNKNOWN 95 (1.7%) 2 (0.8%) 97 (1.6%)
fnbmd
Mean(SD) 0.788(0.127) 0.689(0.115) 0.784(0.128)
Median [Q1, Q3] 0.778 [0.701, 0.863] 0.671 [0.605, 0.752] 0.774 [0.696, 0.860]
Tscore
Mean(SD) -1.06(0.928) -1.79(0.843) -1.09(0.935)
Median [Q1, Q3] -1.14 [-1.70, -0.519] -1.92 [-2.40, -1.33] -1.17 [-1.73, -0.539]
as.factor(bmd_bin)
1.BMD> -2.5 5506 (95.7%) 191 (80.6%) 5697 (95.1%)
2.BMD<= -2.5 249 (4.3%) 46 (19.4%) 295 (4.9%)
as.factor(no_falls)
0 4552 (79.1%) 173 (73.0%) 4725 (78.9%)
1 1203 (20.9%) 64 (27.0%) 1267 (21.1%)
as.factor(fall_bin)
1.No falls 4552 (79.1%) 173 (73.0%) 4725 (78.9%)
2.Falls 1+ 1203 (20.9%) 64 (27.0%) 1267 (21.1%)
as.factor(fx50)
0 4778 (83.0%) 183 (77.2%) 4961 (82.8%)
1 741 (12.9%) 38 (16.0%) 779 (13.0%)
2 183 (3.2%) 9 (3.8%) 192 (3.2%)
3 39 (0.7%) 4 (1.7%) 43 (0.7%)
4 11 (0.2%) 2 (0.8%) 13 (0.2%)
5 1 (0.0%) 1 (0.4%) 2 (0.0%)
6 2 (0.0%) 0 (0%) 2 (0.0%)
as.factor(fx50_bin)
1.No fx 4778 (83.0%) 183 (77.2%) 4961 (82.8%)
2.Fx 1+ 977 (17.0%) 54 (22.8%) 1031 (17.2%)
as.factor(smoke)
Current 194 (3.4%) 12 (5.1%) 206 (3.4%)
Never 2151 (37.4%) 98 (41.4%) 2249 (37.5%)
Past 3410 (59.3%) 127 (53.6%) 3537 (59.0%)
as.factor(smoke_bin)
1.No/past smoking 5561 (96.6%) 225 (94.9%) 5786 (96.6%)
2.Current smoking 194 (3.4%) 12 (5.1%) 206 (3.4%)
smoke_status
1 (0.0%) 0 (0%) 1 (0.0%)
0:NO 2150 (37.4%) 98 (41.4%) 2248 (37.5%)
1:PAST 3410 (59.3%) 127 (53.6%) 3537 (59.0%)
2:CURRENT 194 (3.4%) 12 (5.1%) 206 (3.4%)
smoke_packyrs
Mean(SD) 18.1(24.6) 17.6(25.3) 18.1(24.6)
Median [Q1, Q3] 7.05 [0, 29.0] 3.00 [0, 29.3] 7.00 [0, 29.0]
smoke_perddlife
Mean(SD) 12.5(13.8) 11.5(13.6) 12.5(13.8)
Median [Q1, Q3] 10.0 [0, 20.0] 8.00 [0, 20.0] 10.0 [0, 20.0]
smoke_perdd
Mean(SD) 0.560(3.53) 0.819(3.86) 0.570(3.55)
Median [Q1, Q3] 0 [0, 0] 0 [0, 0] 0 [0, 0]
smk_dur
Mean(SD) 16.7(17.6) 16.3(18.7) 16.7(17.6)
Median [Q1, Q3] 12.0 [0, 30.0] 9.00 [0, 29.0] 12.0 [0, 30.0]
smoke_age1st
Mean(SD) 11.5(9.61) 10.8(9.47) 11.5(9.61)
Median [Q1, Q3] 15.0 [0, 18.0] 15.0 [0, 18.0] 15.0 [0, 18.0]
smoke_agestop
Mean(SD) 25.8(23.8) 23.4(24.4) 25.7(23.8)
Median [Q1, Q3] 30.0 [0, 45.0] 23.0 [0, 45.0] 29.0 [0, 45.0]
as.factor(smoke_100life)
0: No 2150 (37.4%) 98 (41.4%) 2248 (37.5%)
1: Yes 3605 (62.6%) 139 (58.6%) 3744 (62.5%)
drink4
High 1888 (32.8%) 62 (26.2%) 1950 (32.5%)
Low 849 (14.8%) 32 (13.5%) 881 (14.7%)
Moderate 445 (7.7%) 18 (7.6%) 463 (7.7%)
No 2573 (44.7%) 125 (52.7%) 2698 (45.0%)
as.factor(drink_bin)
1.Less drinking 3867 (67.2%) 175 (73.8%) 4042 (67.5%)
2.Excessive drinking 1888 (32.8%) 62 (26.2%) 1950 (32.5%)
physical4
High 829 (14.4%) 37 (15.6%) 866 (14.5%)
Low 1583 (27.5%) 59 (24.9%) 1642 (27.4%)
Moderate 663 (11.5%) 16 (6.8%) 679 (11.3%)
No 2680 (46.6%) 125 (52.7%) 2805 (46.8%)
as.factor(activity_bin)
1.Proactive 1492 (25.9%) 53 (22.4%) 1545 (25.8%)
2.Less active 4263 (74.1%) 184 (77.6%) 4447 (74.2%)
calcium2
Mean(SD) 793(391) 779(387) 793(391)
Median [Q1, Q3] 727 [523, 991] 738 [500, 994] 728 [522, 991]
as.factor(calci_bin)
1.Sufficient Calcium 1401 (24.3%) 57 (24.1%) 1458 (24.3%)
2.Insufficient Calcium 4354 (75.7%) 180 (75.9%) 4534 (75.7%)
protein2
Mean(SD) 64.2(27.3) 62.2(27.9) 64.1(27.4)
Median [Q1, Q3] 60.2 [45.7, 78.3] 58.2 [45.3, 76.9] 60.2 [45.7, 78.2]
as.factor(education)
1 16 (0.3%) 0 (0%) 16 (0.3%)
2 93 (1.6%) 4 (1.7%) 97 (1.6%)
3 265 (4.6%) 13 (5.5%) 278 (4.6%)
4 992 (17.2%) 44 (18.6%) 1036 (17.3%)
5 1329 (23.1%) 48 (20.3%) 1377 (23.0%)
6 1043 (18.1%) 51 (21.5%) 1094 (18.3%)
7 603 (10.5%) 30 (12.7%) 633 (10.6%)
8 1414 (24.6%) 47 (19.8%) 1461 (24.4%)
BMI
Mean(SD) 27.4(3.95) 26.7(3.73) 27.3(3.94)
Median [Q1, Q3] 26.9 [24.8, 29.5] 26.1 [23.9, 28.7] 26.9 [24.8, 29.5]
as.factor(cvd)
0 4566 (79.3%) 175 (73.8%) 4741 (79.1%)
1 1189 (20.7%) 62 (26.2%) 1251 (20.9%)
as.factor(hypertension)
0 3298 (57.3%) 113 (47.7%) 3411 (56.9%)
1 2457 (42.7%) 124 (52.3%) 2581 (43.1%)
as.factor(copd)
0 5140 (89.3%) 212 (89.5%) 5352 (89.3%)
1 615 (10.7%) 25 (10.5%) 640 (10.7%)
as.factor(diabetes)
0 5126 (89.1%) 213 (89.9%) 5339 (89.1%)
1 629 (10.9%) 24 (10.1%) 653 (10.9%)
as.factor(cancer)
0 4705 (81.8%) 195 (82.3%) 4900 (81.8%)
1 1050 (18.2%) 42 (17.7%) 1092 (18.2%)
as.factor(renal)
0 5226 (90.8%) 213 (89.9%) 5439 (90.8%)
1 529 (9.2%) 24 (10.1%) 553 (9.2%)
as.factor(parkinson)
0 5002 (86.9%) 201 (84.8%) 5203 (86.8%)
1 753 (13.1%) 36 (15.2%) 789 (13.2%)
as.factor(depression)
0 5556 (96.5%) 225 (94.9%) 5781 (96.5%)
1 199 (3.5%) 12 (5.1%) 211 (3.5%)
as.factor(rheumatoid)
0 3030 (52.6%) 117 (49.4%) 3147 (52.5%)
1 2725 (47.4%) 120 (50.6%) 2845 (47.5%)
as.factor(death)
0 2318 (40.3%) 63 (26.6%) 2381 (39.7%)
1 3437 (59.7%) 174 (73.4%) 3611 (60.3%)
createTable(compareGroups(hipfx ~ age + age_bin + race + fnbmd + Tscore + bmd_bin + no_falls + fall_bin + fx50 + fx50_bin + smoke + smoke_bin +  smoke_status + smoke_packyrs + smoke_perddlife + smoke_perdd + smk_dur + smoke_age1st + smoke_agestop + smoke_100life + drink4 + drink_bin + physical4 + activity_bin + calcium2 + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)) 
## 
## --------Summary descriptives table by 'hipfx'---------
## 
## __________________________________________________________________________________ 
##                                                     0            1       p.overall 
##                                                   N=5755       N=237               
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ 
## age                                            73.5 (5.84)  76.4 (6.09)   <0.001   
## age_bin:                                                                  <0.001   
##     1.Age< 75                                  3384 (58.8%)  92 (38.8%)            
##     2.Age>= 75                                 2371 (41.2%) 145 (61.2%)            
## race:                                                                      0.142   
##     1:WHITE                                    5157 (89.6%) 227 (95.8%)            
##     2:AFRICAN AMERICAN                         241 (4.19%)   3 (1.27%)             
##     3:ASIAN                                    188 (3.27%)   4 (1.69%)             
##     4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER  7 (0.12%)    0 (0.00%)             
##     5:AMERICAN INDIAN OR ALASKAN NATIVE         7 (0.12%)    0 (0.00%)             
##     6:MULTI RACIAL                              60 (1.04%)   1 (0.42%)             
##     7:UNKNOWN                                   95 (1.65%)   2 (0.84%)             
## fnbmd                                          0.79 (0.13)  0.69 (0.12)   <0.001   
## Tscore                                         -1.06 (0.93) -1.79 (0.84)  <0.001   
## bmd_bin:                                                                  <0.001   
##     1.BMD> -2.5                                5506 (95.7%) 191 (80.6%)            
##     2.BMD<= -2.5                               249 (4.33%)   46 (19.4%)            
## no_falls                                       0.21 (0.41)  0.27 (0.44)    0.039   
## fall_bin:                                                                  0.030   
##     1.No falls                                 4552 (79.1%) 173 (73.0%)            
##     2.Falls 1+                                 1203 (20.9%)  64 (27.0%)            
## fx50                                           0.22 (0.56)  0.34 (0.77)    0.020   
## fx50_bin:                                                                  0.025   
##     1.No fx                                    4778 (83.0%) 183 (77.2%)            
##     2.Fx 1+                                    977 (17.0%)   54 (22.8%)            
## smoke:                                                                     0.129   
##     Current                                    194 (3.37%)   12 (5.06%)            
##     Never                                      2151 (37.4%)  98 (41.4%)            
##     Past                                       3410 (59.3%) 127 (53.6%)            
## smoke_bin:                                                                 0.223   
##     1.No/past smoking                          5561 (96.6%) 225 (94.9%)            
##     2.Current smoking                          194 (3.37%)   12 (5.06%)            
## smoke_status:                                                              0.154   
##                                                 1 (0.02%)    0 (0.00%)             
##     0:NO                                       2150 (37.4%)  98 (41.4%)            
##     1:PAST                                     3410 (59.3%) 127 (53.6%)            
##     2:CURRENT                                  194 (3.37%)   12 (5.06%)            
## smoke_packyrs                                  18.1 (24.6)  17.6 (25.3)    0.770   
## smoke_perddlife                                12.5 (13.8)  11.5 (13.6)    0.259   
## smoke_perdd                                    0.56 (3.53)  0.82 (3.86)    0.311   
## smk_dur                                        16.7 (17.6)  16.3 (18.7)    0.746   
## smoke_age1st                                   11.5 (9.61)  10.8 (9.47)    0.262   
## smoke_agestop                                  25.8 (23.8)  23.4 (24.4)    0.142   
## smoke_100life:                                                             0.240   
##     0: No                                      2150 (37.4%)  98 (41.4%)            
##     1: Yes                                     3605 (62.6%) 139 (58.6%)            
## drink4:                                                                    0.086   
##     High                                       1888 (32.8%)  62 (26.2%)            
##     Low                                        849 (14.8%)   32 (13.5%)            
##     Moderate                                   445 (7.73%)   18 (7.59%)            
##     No                                         2573 (44.7%) 125 (52.7%)            
## drink_bin:                                                                 0.039   
##     1.Less drinking                            3867 (67.2%) 175 (73.8%)            
##     2.Excessive drinking                       1888 (32.8%)  62 (26.2%)            
## physical4:                                                                 0.065   
##     High                                       829 (14.4%)   37 (15.6%)            
##     Low                                        1583 (27.5%)  59 (24.9%)            
##     Moderate                                   663 (11.5%)   16 (6.75%)            
##     No                                         2680 (46.6%) 125 (52.7%)            
## activity_bin:                                                              0.249   
##     1.Proactive                                1492 (25.9%)  53 (22.4%)            
##     2.Less active                              4263 (74.1%) 184 (77.6%)            
## calcium2                                        793 (391)    779 (387)     0.579   
## calci_bin:                                                                 0.979   
##     1.Sufficient Calcium                       1401 (24.3%)  57 (24.1%)            
##     2.Insufficient Calcium                     4354 (75.7%) 180 (75.9%)            
## protein2                                       64.2 (27.3)  62.2 (27.9)    0.294   
## education                                      5.80 (1.65)  5.72 (1.60)    0.416   
## BMI                                            27.4 (3.95)  26.7 (3.73)    0.004   
## cvd                                            0.21 (0.40)  0.26 (0.44)    0.060   
## hypertension                                   0.43 (0.49)  0.52 (0.50)    0.004   
## copd                                           0.11 (0.31)  0.11 (0.31)    0.946   
## diabetes                                       0.11 (0.31)  0.10 (0.30)    0.689   
## cancer                                         0.18 (0.39)  0.18 (0.38)    0.837   
## renal                                          0.09 (0.29)  0.10 (0.30)    0.641   
## parkinson                                      0.13 (0.34)  0.15 (0.36)    0.377   
## depression                                     0.03 (0.18)  0.05 (0.22)    0.268   
## rheumatoid                                     0.47 (0.50)  0.51 (0.50)    0.324   
## death                                          0.60 (0.49)  0.73 (0.44)   <0.001   
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

(2) Smoking status:

(2.1) Classification 1: Current vs. Past/None

(2.1.1) Prevalence

table1(~ age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin + fx50_bin + smoke_bin + drink_bin + activity_bin + as.factor(group) | anyfx, data = men.smk, render.continuous = c(. = "Mean(SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin
## + : Terms to the right of '|' in formula 'x' define table columns and are
## expected to be factors with meaningful labels.
0
(N=4908)
1
(N=1084)
Overall
(N=5992)
age
Mean(SD) 73.5(5.86) 74.5(5.88) 73.7(5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 74.0 [70.0, 78.0] 73.0 [69.0, 78.0]
age_bin
1.Age< 75 2909 (59.3%) 567 (52.3%) 3476 (58.0%)
2.Age>= 75 1999 (40.7%) 517 (47.7%) 2516 (42.0%)
fnbmd
Mean(SD) 0.794(0.127) 0.739(0.122) 0.784(0.128)
Median [Q1, Q3] 0.783 [0.707, 0.870] 0.728 [0.652, 0.812] 0.774 [0.696, 0.860]
Tscore
Mean(SD) -1.02(0.930) -1.43(0.887) -1.09(0.935)
Median [Q1, Q3] -1.10 [-1.66, -0.466] -1.50 [-2.06, -0.894] -1.17 [-1.73, -0.539]
bmd_bin
1.BMD> -2.5 4721 (96.2%) 976 (90.0%) 5697 (95.1%)
2.BMD<= -2.5 187 (3.8%) 108 (10.0%) 295 (4.9%)
fall_bin
1.No falls 3924 (80.0%) 801 (73.9%) 4725 (78.9%)
2.Falls 1+ 984 (20.0%) 283 (26.1%) 1267 (21.1%)
fx50_bin
1.No fx 4141 (84.4%) 820 (75.6%) 4961 (82.8%)
2.Fx 1+ 767 (15.6%) 264 (24.4%) 1031 (17.2%)
smoke_bin
1.No/past smoking 4746 (96.7%) 1040 (95.9%) 5786 (96.6%)
2.Current smoking 162 (3.3%) 44 (4.1%) 206 (3.4%)
drink_bin
1.Less drinking 3330 (67.8%) 712 (65.7%) 4042 (67.5%)
2.Excessive drinking 1578 (32.2%) 372 (34.3%) 1950 (32.5%)
activity_bin
1.Proactive 1253 (25.5%) 292 (26.9%) 1545 (25.8%)
2.Less active 3655 (74.5%) 792 (73.1%) 4447 (74.2%)
as.factor(group)
1 1956 (39.9%) 302 (27.9%) 2258 (37.7%)
2 93 (1.9%) 20 (1.8%) 113 (1.9%)
3 291 (5.9%) 87 (8.0%) 378 (6.3%)
4 374 (7.6%) 82 (7.6%) 456 (7.6%)
5 43 (0.9%) 15 (1.4%) 58 (1.0%)
6 1200 (24.4%) 249 (23.0%) 1449 (24.2%)
7 67 (1.4%) 32 (3.0%) 99 (1.7%)
8 346 (7.0%) 89 (8.2%) 435 (7.3%)
9 202 (4.1%) 58 (5.4%) 260 (4.3%)
10 16 (0.3%) 3 (0.3%) 19 (0.3%)
11 5 (0.1%) 5 (0.5%) 10 (0.2%)
12 8 (0.2%) 6 (0.6%) 14 (0.2%)
13 2 (0.0%) 3 (0.3%) 5 (0.1%)
14 96 (2.0%) 32 (3.0%) 128 (2.1%)
15 12 (0.2%) 3 (0.3%) 15 (0.3%)
16 19 (0.4%) 5 (0.5%) 24 (0.4%)
17 17 (0.3%) 10 (0.9%) 27 (0.5%)
18 19 (0.4%) 20 (1.8%) 39 (0.7%)
19 6 (0.1%) 0 (0%) 6 (0.1%)
20 104 (2.1%) 39 (3.6%) 143 (2.4%)
21 2 (0.0%) 5 (0.5%) 7 (0.1%)
22 2 (0.0%) 0 (0%) 2 (0.0%)
23 3 (0.1%) 3 (0.3%) 6 (0.1%)
24 1 (0.0%) 2 (0.2%) 3 (0.1%)
26 6 (0.1%) 2 (0.2%) 8 (0.1%)
27 15 (0.3%) 11 (1.0%) 26 (0.4%)
28 1 (0.0%) 0 (0%) 1 (0.0%)
29 0 (0%) 1 (0.1%) 1 (0.0%)
30 2 (0.0%) 0 (0%) 2 (0.0%)

(2.1.2) Association for any fracture

Original format of 3 categories: Never, Past vs Current

men.smk$smoke.c = factor(men.smk$smoke, levels = c("Never", "Past", "Current"))
men.smk$fnbmd.sd = men.smk$fnbmd / 0.10

any.smk.age = coxph(Surv(fu_anyfx, anyfx) ~  smoke.c + age, data = men.smk)
summary(any.smk.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke.c + age, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                    coef exp(coef) se(coef)      z Pr(>|z|)    
## smoke.cPast    0.082228  1.085703 0.063516  1.295    0.195    
## smoke.cCurrent 0.627575  1.873063 0.160191  3.918 8.94e-05 ***
## age            0.074815  1.077685 0.005404 13.844  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast        1.086     0.9211    0.9586     1.230
## smoke.cCurrent     1.873     0.5339    1.3684     2.564
## age                1.078     0.9279    1.0663     1.089
## 
## Concordance= 0.618  (se = 0.009 )
## Likelihood ratio test= 187.3  on 3 df,   p=<2e-16
## Wald test            = 195.8  on 3 df,   p=<2e-16
## Score (logrank) test = 199.6  on 3 df,   p=<2e-16
any.smk.all1 = coxph(Surv(fu_anyfx, anyfx) ~  smoke.c + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any.smk.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke.c + age_bin + bmd_bin + 
##     fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                        coef exp(coef) se(coef)     z Pr(>|z|)    
## smoke.cPast         0.05447   1.05598  0.06355 0.857 0.391394    
## smoke.cCurrent      0.55135   1.73559  0.15998 3.446 0.000568 ***
## age_bin2.Age>= 75   0.61935   1.85772  0.06324 9.793  < 2e-16 ***
## bmd_bin2.BMD<= -2.5 0.94642   2.57646  0.10294 9.194  < 2e-16 ***
## fall_bin2.Falls 1+  0.33337   1.39566  0.06982 4.774 1.80e-06 ***
## fx50_bin2.Fx 1+     0.47510   1.60818  0.07147 6.647 2.99e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast             1.056     0.9470    0.9323     1.196
## smoke.cCurrent          1.736     0.5762    1.2684     2.375
## age_bin2.Age>= 75       1.858     0.5383    1.6412     2.103
## bmd_bin2.BMD<= -2.5     2.576     0.3881    2.1057     3.152
## fall_bin2.Falls 1+      1.396     0.7165    1.2172     1.600
## fx50_bin2.Fx 1+         1.608     0.6218    1.3980     1.850
## 
## Concordance= 0.638  (se = 0.009 )
## Likelihood ratio test= 267  on 6 df,   p=<2e-16
## Wald test            = 307.3  on 6 df,   p=<2e-16
## Score (logrank) test = 327.1  on 6 df,   p=<2e-16
any.smk.all2 = coxph(Surv(fu_anyfx, anyfx) ~  smoke.c + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid, data = men.smk)
summary(any.smk.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke.c + age_bin + bmd_bin + 
##     fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + 
##     protein2 + education + BMI + cvd + hypertension + copd + 
##     diabetes + cancer + renal + parkinson + depression + rheumatoid, 
##     data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                      coef exp(coef)  se(coef)      z Pr(>|z|)
## smoke.cPast                      0.028192  1.028593  0.065577  0.430 0.667268
## smoke.cCurrent                   0.553899  1.740025  0.162155  3.416 0.000636
## age_bin2.Age>= 75                0.583400  1.792122  0.065229  8.944  < 2e-16
## bmd_bin2.BMD<= -2.5              0.963598  2.621110  0.105499  9.134  < 2e-16
## fall_bin2.Falls 1+               0.308458  1.361325  0.071011  4.344  1.4e-05
## fx50_bin2.Fx 1+                  0.478196  1.613162  0.071720  6.668  2.6e-11
## drink_bin2.Excessive drinking    0.080176  1.083478  0.065870  1.217 0.223531
## activity_bin2.Less active        0.007088  1.007114  0.070160  0.101 0.919525
## calci_bin2.Insufficient Calcium -0.080404  0.922744  0.081915 -0.982 0.326320
## protein2                        -0.003309  0.996697  0.001372 -2.412 0.015873
## education                        0.001935  1.001937  0.019381  0.100 0.920485
## BMI                             -0.004690  0.995321  0.008664 -0.541 0.588294
## cvd                              0.157894  1.171043  0.076513  2.064 0.039053
## hypertension                     0.124935  1.133075  0.063345  1.972 0.048575
## copd                             0.138593  1.148656  0.096460  1.437 0.150778
## diabetes                         0.204408  1.226799  0.101378  2.016 0.043769
## cancer                           0.051299  1.052638  0.079917  0.642 0.520932
## renal                            0.018369  1.018539  0.128268  0.143 0.886124
## parkinson                       -0.071625  0.930879  0.120286 -0.595 0.551537
## depression                       0.179663  1.196814  0.142363  1.262 0.206948
## rheumatoid                      -0.015625  0.984497  0.062836 -0.249 0.803623
##                                    
## smoke.cPast                        
## smoke.cCurrent                  ***
## age_bin2.Age>= 75               ***
## bmd_bin2.BMD<= -2.5             ***
## fall_bin2.Falls 1+              ***
## fx50_bin2.Fx 1+                 ***
## drink_bin2.Excessive drinking      
## activity_bin2.Less active          
## calci_bin2.Insufficient Calcium    
## protein2                        *  
## education                          
## BMI                                
## cvd                             *  
## hypertension                    *  
## copd                               
## diabetes                        *  
## cancer                             
## renal                              
## parkinson                          
## depression                         
## rheumatoid                         
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast                        1.0286     0.9722    0.9045    1.1697
## smoke.cCurrent                     1.7400     0.5747    1.2663    2.3910
## age_bin2.Age>= 75                  1.7921     0.5580    1.5770    2.0365
## bmd_bin2.BMD<= -2.5                2.6211     0.3815    2.1315    3.2232
## fall_bin2.Falls 1+                 1.3613     0.7346    1.1845    1.5646
## fx50_bin2.Fx 1+                    1.6132     0.6199    1.4016    1.8566
## drink_bin2.Excessive drinking      1.0835     0.9230    0.9523    1.2328
## activity_bin2.Less active          1.0071     0.9929    0.8777    1.1556
## calci_bin2.Insufficient Calcium    0.9227     1.0837    0.7859    1.0834
## protein2                           0.9967     1.0033    0.9940    0.9994
## education                          1.0019     0.9981    0.9646    1.0407
## BMI                                0.9953     1.0047    0.9786    1.0124
## cvd                                1.1710     0.8539    1.0080    1.3605
## hypertension                       1.1331     0.8826    1.0008    1.2829
## copd                               1.1487     0.8706    0.9508    1.3877
## diabetes                           1.2268     0.8151    1.0057    1.4965
## cancer                             1.0526     0.9500    0.9000    1.2311
## renal                              1.0185     0.9818    0.7921    1.3097
## parkinson                          0.9309     1.0743    0.7354    1.1784
## depression                         1.1968     0.8356    0.9054    1.5820
## rheumatoid                         0.9845     1.0157    0.8704    1.1135
## 
## Concordance= 0.647  (se = 0.009 )
## Likelihood ratio test= 292.5  on 21 df,   p=<2e-16
## Wald test            = 331.8  on 21 df,   p=<2e-16
## Score (logrank) test = 352.6  on 21 df,   p=<2e-16

Binary format for PAR

any.smk.age = coxph(Surv(fu_anyfx, anyfx) ~  smoke_bin + age, data = men.smk)
summary(any.smk.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_bin + age, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                coef exp(coef) se(coef)      z Pr(>|z|)    
## smoke_bin2.Current smoking 0.577225  1.781089 0.155247  3.718 0.000201 ***
## age                        0.074439  1.077279 0.005392 13.804  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                            exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking     1.781     0.5615     1.314     2.415
## age                            1.077     0.9283     1.066     1.089
## 
## Concordance= 0.617  (se = 0.009 )
## Likelihood ratio test= 185.6  on 2 df,   p=<2e-16
## Wald test            = 194.3  on 2 df,   p=<2e-16
## Score (logrank) test = 198.2  on 2 df,   p=<2e-16
any.smk.all1 = coxph(Surv(fu_anyfx, anyfx) ~  smoke_bin + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any.smk.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                               coef exp(coef) se(coef)     z Pr(>|z|)    
## smoke_bin2.Current smoking 0.51810   1.67883  0.15511 3.340 0.000837 ***
## age_bin2.Age>= 75          0.61663   1.85267  0.06317 9.761  < 2e-16 ***
## bmd_bin2.BMD<= -2.5        0.94618   2.57586  0.10295 9.191  < 2e-16 ***
## fall_bin2.Falls 1+         0.33490   1.39780  0.06980 4.798 1.60e-06 ***
## fx50_bin2.Fx 1+            0.47695   1.61115  0.07144 6.677 2.45e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                            exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking     1.679     0.5957     1.239     2.275
## age_bin2.Age>= 75              1.853     0.5398     1.637     2.097
## bmd_bin2.BMD<= -2.5            2.576     0.3882     2.105     3.152
## fall_bin2.Falls 1+             1.398     0.7154     1.219     1.603
## fx50_bin2.Fx 1+                1.611     0.6207     1.401     1.853
## 
## Concordance= 0.636  (se = 0.009 )
## Likelihood ratio test= 266.2  on 5 df,   p=<2e-16
## Wald test            = 306.7  on 5 df,   p=<2e-16
## Score (logrank) test = 326.5  on 5 df,   p=<2e-16
any.smk.all2 = coxph(Surv(fu_anyfx, anyfx) ~  smoke_bin + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid, data = men.smk)
summary(any.smk.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                       coef  exp(coef)   se(coef)      z
## smoke_bin2.Current smoking       0.5358238  1.7088555  0.1565659  3.422
## age_bin2.Age>= 75                0.5818252  1.7893014  0.0651334  8.933
## bmd_bin2.BMD<= -2.5              0.9647256  2.6240674  0.1054818  9.146
## fall_bin2.Falls 1+               0.3089229  1.3619573  0.0710001  4.351
## fx50_bin2.Fx 1+                  0.4790486  1.6145376  0.0716910  6.682
## drink_bin2.Excessive drinking    0.0845968  1.0882782  0.0650693  1.300
## activity_bin2.Less active        0.0072301  1.0072563  0.0701555  0.103
## calci_bin2.Insufficient Calcium -0.0801932  0.9229380  0.0819197 -0.979
## protein2                        -0.0033096  0.9966958  0.0013715 -2.413
## education                        0.0008118  1.0008122  0.0192043  0.042
## BMI                             -0.0044180  0.9955918  0.0086419 -0.511
## cvd                              0.1595742  1.1730113  0.0764134  2.088
## hypertension                     0.1256238  1.1338555  0.0633292  1.984
## copd                             0.1417496  1.1522881  0.0961836  1.474
## diabetes                         0.2042303  1.2265805  0.1013885  2.014
## cancer                           0.0510206  1.0523445  0.0799109  0.638
## renal                            0.0182944  1.0184628  0.1282469  0.143
## parkinson                       -0.0719417  0.9305851  0.1202642 -0.598
## depression                       0.1804831  1.1977958  0.1423518  1.268
## rheumatoid                      -0.0145294  0.9855757  0.0627836 -0.231
##                                 Pr(>|z|)    
## smoke_bin2.Current smoking      0.000621 ***
## age_bin2.Age>= 75                < 2e-16 ***
## bmd_bin2.BMD<= -2.5              < 2e-16 ***
## fall_bin2.Falls 1+              1.36e-05 ***
## fx50_bin2.Fx 1+                 2.35e-11 ***
## drink_bin2.Excessive drinking   0.193566    
## activity_bin2.Less active       0.917917    
## calci_bin2.Insufficient Calcium 0.327618    
## protein2                        0.015817 *  
## education                       0.966281    
## BMI                             0.609190    
## cvd                             0.036771 *  
## hypertension                    0.047293 *  
## copd                            0.140552    
## diabetes                        0.043974 *  
## cancer                          0.523169    
## renal                           0.886567    
## parkinson                       0.549708    
## depression                      0.204846    
## rheumatoid                      0.816989    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking         1.7089     0.5852    1.2573    2.3226
## age_bin2.Age>= 75                  1.7893     0.5589    1.5749    2.0329
## bmd_bin2.BMD<= -2.5                2.6241     0.3811    2.1340    3.2267
## fall_bin2.Falls 1+                 1.3620     0.7342    1.1850    1.5653
## fx50_bin2.Fx 1+                    1.6145     0.6194    1.4029    1.8581
## drink_bin2.Excessive drinking      1.0883     0.9189    0.9580    1.2363
## activity_bin2.Less active          1.0073     0.9928    0.8779    1.1557
## calci_bin2.Insufficient Calcium    0.9229     1.0835    0.7860    1.0837
## protein2                           0.9967     1.0033    0.9940    0.9994
## education                          1.0008     0.9992    0.9638    1.0392
## BMI                                0.9956     1.0044    0.9789    1.0126
## cvd                                1.1730     0.8525    1.0099    1.3625
## hypertension                       1.1339     0.8819    1.0015    1.2837
## copd                               1.1523     0.8678    0.9543    1.3913
## diabetes                           1.2266     0.8153    1.0055    1.4962
## cancer                             1.0523     0.9503    0.8998    1.2308
## renal                              1.0185     0.9819    0.7921    1.3095
## parkinson                          0.9306     1.0746    0.7352    1.1779
## depression                         1.1978     0.8349    0.9062    1.5833
## rheumatoid                         0.9856     1.0146    0.8715    1.1146
## 
## Concordance= 0.647  (se = 0.009 )
## Likelihood ratio test= 292.3  on 20 df,   p=<2e-16
## Wald test            = 331.6  on 20 df,   p=<2e-16
## Score (logrank) test = 352.5  on 20 df,   p=<2e-16
Sensitivity analysis to account for a competing risk of death

Data management:

men.smk = men.smk %>% mutate(anyfx_crr = case_when(anyfx == 0 & death == 0 ~ 0,
                                                  anyfx == 1 & death == 0 ~ 1,
                                                  anyfx == 0 & death == 1 ~ 2))
library(cmprsk)
## Warning: package 'cmprsk' was built under R version 4.3.3
library(finalfit)
## Warning: package 'finalfit' was built under R version 4.3.3

Age-adjusted

cov_age   = c("smoke_bin", "age")
anyfx_cph = "Surv(fu_anyfx, anyfx)"
anyfx_crr = "Surv(fu_anyfx, anyfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(anyfx_cph, cov_age, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(anyfx_cph, cov_age) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(anyfx_crr, cov_age) %>%
      fit2df(estimate_suffix = " (Fine-Gray subdistribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 693 cases omitted due to missing values
##   Dependent: Survival                           all       HR (Cause-specific)
## 2           smoke_bin 1.No/past smoking 5786 (96.6)                         -
## 3                     2.Current smoking   206 (3.4) 1.78 (1.31-2.41, p<0.001)
## 1                 age         Mean (SD)  73.7 (5.9) 1.08 (1.07-1.09, p<0.001)
##   HR (Fine-Gray subdistribution)
## 2                              -
## 3      0.73 (0.40-1.34, p=0.310)
## 1      0.94 (0.93-0.96, p<0.001)

Multivariable-adjusted (only fracture risk factors)

cov_multi1   = c("smoke_bin", "age_bin", "bmd_bin", "fall_bin", "fx50_bin")
anyfx_cph = "Surv(fu_anyfx, anyfx)"
anyfx_crr = "Surv(fu_anyfx, anyfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(anyfx_cph, cov_multi1, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(anyfx_cph, cov_multi1) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(anyfx_crr, cov_multi1) %>%
      fit2df(estimate_suffix = " (Fine-Gray distribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 693 cases omitted due to missing values
##    Dependent: Survival                           all       HR (Cause-specific)
## 9            smoke_bin 1.No/past smoking 5786 (96.6)                         -
## 10                     2.Current smoking   206 (3.4) 1.68 (1.24-2.28, p=0.001)
## 1              age_bin         1.Age< 75 3476 (58.0)                         -
## 2                             2.Age>= 75 2516 (42.0) 1.85 (1.64-2.10, p<0.001)
## 3              bmd_bin       1.BMD> -2.5 5697 (95.1)                         -
## 4                           2.BMD<= -2.5   295 (4.9) 2.58 (2.11-3.15, p<0.001)
## 5             fall_bin        1.No falls 4725 (78.9)                         -
## 6                             2.Falls 1+ 1267 (21.1) 1.40 (1.22-1.60, p<0.001)
## 7             fx50_bin           1.No fx 4961 (82.8)                         -
## 8                                2.Fx 1+ 1031 (17.2) 1.61 (1.40-1.85, p<0.001)
##    HR (Fine-Gray distribution)
## 9                            -
## 10   0.74 (0.40-1.34, p=0.320)
## 1                            -
## 2    0.47 (0.37-0.59, p<0.001)
## 3                            -
## 4    1.90 (1.24-2.89, p=0.003)
## 5                            -
## 6    0.97 (0.75-1.26, p=0.810)
## 7                            -
## 8    1.59 (1.26-2.02, p<0.001)

Multivariable-adjusted (only fracture risk factors)

cov_multi2   = c("smoke_bin", "age_bin", "bmd_bin", "fall_bin", "fx50_bin", "drink_bin", "activity_bin", "calci_bin", "protein2", "education", "BMI", "cvd", "hypertension", "copd", "diabetes", "cancer", "renal", "parkinson", "depression", "rheumatoid")
anyfx_cph = "Surv(fu_anyfx, anyfx)"
anyfx_crr = "Surv(fu_anyfx, anyfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(anyfx_cph, cov_multi2, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(anyfx_cph, cov_multi2) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(anyfx_crr, cov_multi2) %>%
      fit2df(estimate_suffix = " (Fine-Gray subdistribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 693 cases omitted due to missing values
##    Dependent: Survival                                all
## 45           smoke_bin      1.No/past smoking 5786 (96.6)
## 46                          2.Current smoking   206 (3.4)
## 3              age_bin              1.Age< 75 3476 (58.0)
## 4                                  2.Age>= 75 2516 (42.0)
## 5              bmd_bin            1.BMD> -2.5 5697 (95.1)
## 6                                2.BMD<= -2.5   295 (4.9)
## 28            fall_bin             1.No falls 4725 (78.9)
## 29                                 2.Falls 1+ 1267 (21.1)
## 30            fx50_bin                1.No fx 4961 (82.8)
## 31                                    2.Fx 1+ 1031 (17.2)
## 25           drink_bin        1.Less drinking 4042 (67.5)
## 26                       2.Excessive drinking 1950 (32.5)
## 1         activity_bin            1.Proactive 1545 (25.8)
## 2                               2.Less active 4447 (74.2)
## 8            calci_bin   1.Sufficient Calcium 1458 (24.3)
## 9                      2.Insufficient Calcium 4534 (75.7)
## 38            protein2              Mean (SD) 64.1 (27.4)
## 27           education              Mean (SD)   5.8 (1.6)
## 7                  BMI              Mean (SD)  27.3 (3.9)
## 17                 cvd                      0 4741 (79.1)
## 18                                          1 1251 (20.9)
## 33        hypertension                      0 3411 (56.9)
## 34                                          1 2581 (43.1)
## 14                copd                      0 5352 (89.3)
## 15                                          1  640 (10.7)
## 23            diabetes                      0 5339 (89.1)
## 24                                          1  653 (10.9)
## 11              cancer                      0 4900 (81.8)
## 12                                          1 1092 (18.2)
## 40               renal                      0 5439 (90.8)
## 41                                          1   553 (9.2)
## 36           parkinson                      0 5203 (86.8)
## 37                                          1  789 (13.2)
## 20          depression                      0 5781 (96.5)
## 21                                          1   211 (3.5)
## 43          rheumatoid                      0 3147 (52.5)
## 44                                          1 2845 (47.5)
## 10                <NA>                   <NA>        <NA>
## 13                <NA>                   <NA>        <NA>
## 16                <NA>                   <NA>        <NA>
## 19                <NA>                   <NA>        <NA>
## 22                <NA>                   <NA>        <NA>
## 32                <NA>                   <NA>        <NA>
## 35                <NA>                   <NA>        <NA>
## 39                <NA>                   <NA>        <NA>
## 42                <NA>                   <NA>        <NA>
##          HR (Cause-specific) HR (Fine-Gray subdistribution)
## 45                         -                              -
## 46 1.71 (1.26-2.32, p=0.001)      0.82 (0.45-1.49, p=0.510)
## 3                          -                              -
## 4  1.79 (1.57-2.03, p<0.001)      0.52 (0.41-0.66, p<0.001)
## 5                          -                              -
## 6  2.62 (2.13-3.23, p<0.001)      1.86 (1.21-2.85, p=0.004)
## 28                         -                              -
## 29 1.36 (1.19-1.57, p<0.001)      0.98 (0.75-1.27, p=0.860)
## 30                         -                              -
## 31 1.61 (1.40-1.86, p<0.001)      1.60 (1.26-2.03, p<0.001)
## 25                         -                              -
## 26 1.09 (0.96-1.24, p=0.194)      1.03 (0.83-1.27, p=0.820)
## 1                          -                              -
## 2  1.01 (0.88-1.16, p=0.918)      0.81 (0.66-1.01, p=0.065)
## 8                          -                              -
## 9  0.92 (0.79-1.08, p=0.328)      0.92 (0.71-1.19, p=0.530)
## 38 1.00 (0.99-1.00, p=0.016)      1.00 (1.00-1.00, p=0.840)
## 27 1.00 (0.96-1.04, p=0.966)      1.07 (1.00-1.14, p=0.036)
## 7  1.00 (0.98-1.01, p=0.609)      0.99 (0.96-1.01, p=0.350)
## 17                         -                              -
## 18                         -                              -
## 33                         -                              -
## 34                         -                              -
## 14                         -                              -
## 15                         -                              -
## 23                         -                              -
## 24                         -                              -
## 11                         -                              -
## 12                         -                              -
## 40                         -                              -
## 41                         -                              -
## 36                         -                              -
## 37                         -                              -
## 20                         -                              -
## 21                         -                              -
## 43                         -                              -
## 44                         -                              -
## 10 1.05 (0.90-1.23, p=0.523)      0.87 (0.66-1.15, p=0.340)
## 13 1.15 (0.95-1.39, p=0.141)      0.78 (0.54-1.15, p=0.210)
## 16 1.17 (1.01-1.36, p=0.037)      0.87 (0.66-1.15, p=0.330)
## 19 1.20 (0.91-1.58, p=0.205)      1.22 (0.74-2.02, p=0.430)
## 22 1.23 (1.01-1.50, p=0.044)      0.93 (0.65-1.34, p=0.710)
## 32 1.13 (1.00-1.28, p=0.047)      0.86 (0.70-1.07, p=0.170)
## 35 0.93 (0.74-1.18, p=0.550)      0.75 (0.54-1.04, p=0.085)
## 39 1.02 (0.79-1.31, p=0.887)      1.86 (1.33-2.59, p<0.001)
## 42 0.99 (0.87-1.11, p=0.817)      0.93 (0.75-1.14, p=0.480)

To obtain HR for PAR calculation

options(digits = 8)
any.smk.par = coxph(Surv(fu_anyfx, anyfx) ~ as.factor(group), data = men.smk)
## Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
## Loglik converged before variable 18,21,26,28 ; coefficient may be infinite.
summary(any.smk.par)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(group), data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                           coef   exp(coef)    se(coef)       z  Pr(>|z|)    
## as.factor(group)2   5.0358e-01  1.6546e+00  2.3097e-01  2.1803 0.0292352 *  
## as.factor(group)3   5.8961e-01  1.8033e+00  1.2169e-01  4.8451 1.266e-06 ***
## as.factor(group)4   3.5915e-01  1.4321e+00  1.2454e-01  2.8838 0.0039292 ** 
## as.factor(group)5   7.9699e-01  2.2189e+00  2.6457e-01  3.0124 0.0025918 ** 
## as.factor(group)6   6.6369e-01  1.9419e+00  8.6418e-02  7.6801 1.590e-14 ***
## as.factor(group)7   1.5168e+00  4.5578e+00  1.8648e-01  8.1343 4.143e-16 ***
## as.factor(group)8   9.6153e-01  2.6157e+00  1.2141e-01  7.9198 2.380e-15 ***
## as.factor(group)9   1.0017e+00  2.7228e+00  1.4393e-01  6.9592 3.421e-12 ***
## as.factor(group)10  7.8150e-01  2.1848e+00  5.8046e-01  1.3464 0.1781893    
## as.factor(group)11  1.4151e+00  4.1168e+00  4.5092e-01  3.1382 0.0016999 ** 
## as.factor(group)12  1.4212e+00  4.1420e+00  4.1230e-01  3.4470 0.0005669 ***
## as.factor(group)13  2.3621e+00  1.0613e+01  5.8108e-01  4.0650 4.804e-05 ***
## as.factor(group)14  7.6270e-01  2.1441e+00  1.8591e-01  4.1024 4.088e-05 ***
## as.factor(group)15  5.8924e-01  1.8026e+00  5.8023e-01  1.0155 0.3098597    
## as.factor(group)16  7.4042e-01  2.0968e+00  4.5100e-01  1.6417 0.1006461    
## as.factor(group)17  1.9150e+00  6.7869e+00  3.2216e-01  5.9443 2.777e-09 ***
## as.factor(group)18  2.2236e+00  9.2408e+00  2.3197e-01  9.5857 < 2.2e-16 ***
## as.factor(group)19 -1.2066e+01  5.7544e-06  8.7033e+02 -0.0139 0.9889391    
## as.factor(group)20  1.4171e+00  4.1251e+00  1.7097e-01  8.2883 < 2.2e-16 ***
## as.factor(group)21  2.4387e+00  1.1458e+01  4.5154e-01  5.4009 6.631e-08 ***
## as.factor(group)22 -1.2042e+01  5.8897e-06  2.5250e+03 -0.0048 0.9961947    
## as.factor(group)23  1.6817e+00  5.3745e+00  5.8041e-01  2.8974 0.0037628 ** 
## as.factor(group)24  3.0803e+00  2.1765e+01  7.1032e-01  4.3365 1.448e-05 ***
## as.factor(group)26  1.4848e+00  4.4139e+00  7.0992e-01  2.0915 0.0364863 *  
## as.factor(group)27  2.3819e+00  1.0826e+01  3.0805e-01  7.7323 1.056e-14 ***
## as.factor(group)28 -1.2064e+01  5.7619e-06  1.7650e+03 -0.0068 0.9945463    
## as.factor(group)29  4.9726e+00  1.4440e+02  1.0081e+00  4.9327 8.109e-07 ***
## as.factor(group)30 -1.2048e+01  5.8583e-06  1.9519e+03 -0.0062 0.9950752    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## as.factor(group)2  1.6546e+00 6.0437e-01   1.05221    2.6020
## as.factor(group)3  1.8033e+00 5.5454e-01   1.42062    2.2890
## as.factor(group)4  1.4321e+00 6.9827e-01   1.12193    1.8280
## as.factor(group)5  2.2189e+00 4.5068e-01   1.32107    3.7268
## as.factor(group)6  1.9419e+00 5.1495e-01   1.63938    2.3004
## as.factor(group)7  4.5578e+00 2.1940e-01   3.16249    6.5688
## as.factor(group)8  2.6157e+00 3.8231e-01   2.06179    3.3184
## as.factor(group)9  2.7228e+00 3.6726e-01   2.05355    3.6103
## as.factor(group)10 2.1848e+00 4.5772e-01   0.70035    6.8154
## as.factor(group)11 4.1168e+00 2.4291e-01   1.70112    9.9629
## as.factor(group)12 4.1420e+00 2.4143e-01   1.84613    9.2932
## as.factor(group)13 1.0613e+01 9.4225e-02   3.39796   33.1474
## as.factor(group)14 2.1441e+00 4.6641e-01   1.48931    3.0866
## as.factor(group)15 1.8026e+00 5.5475e-01   0.57810    5.6208
## as.factor(group)16 2.0968e+00 4.7691e-01   0.86630    5.0752
## as.factor(group)17 6.7869e+00 1.4734e-01   3.60953   12.7613
## as.factor(group)18 9.2408e+00 1.0822e-01   5.86480   14.5601
## as.factor(group)19 5.7544e-06 1.7378e+05   0.00000       Inf
## as.factor(group)20 4.1251e+00 2.4242e-01   2.95054    5.7673
## as.factor(group)21 1.1458e+01 8.7272e-02   4.72905   27.7639
## as.factor(group)22 5.8897e-06 1.6979e+05   0.00000       Inf
## as.factor(group)23 5.3745e+00 1.8606e-01   1.72304   16.7643
## as.factor(group)24 2.1765e+01 4.5946e-02   5.40913   87.5743
## as.factor(group)26 4.4139e+00 2.2656e-01   1.09785   17.7463
## as.factor(group)27 1.0826e+01 9.2373e-02   5.91893   19.8000
## as.factor(group)28 5.7619e-06 1.7355e+05   0.00000       Inf
## as.factor(group)29 1.4440e+02 6.9254e-03  20.02080 1041.4260
## as.factor(group)30 5.8583e-06 1.7070e+05   0.00000       Inf
## 
## Concordance= 0.637  (se = 0.009 )
## Likelihood ratio test= 286.81  on 28 df,   p=<2e-16
## Wald test            = 349.13  on 28 df,   p=<2e-16
## Score (logrank) test = 478.67  on 28 df,   p=<2e-16

(2.1.3) Association for hip fracture

Original format of 3 categories: Never, Past vs Current

hip.smk.age = coxph(Surv(fu_hipfx, hipfx) ~  smoke.c + age, data = men.smk)
summary(hip.smk.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke.c + age, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                     coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke.cPast    -0.035764  0.964868  0.134783 -0.2653  0.790743    
## smoke.cCurrent  0.993289  2.700101  0.309664  3.2076  0.001338 ** 
## age             0.137513  1.147417  0.011277 12.1944 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast      0.96487    1.03641   0.74087    1.2566
## smoke.cCurrent   2.70010    0.37036   1.47161    4.9541
## age              1.14742    0.87152   1.12233    1.1731
## 
## Concordance= 0.727  (se = 0.016 )
## Likelihood ratio test= 145.29  on 3 df,   p=<2e-16
## Wald test            = 152.53  on 3 df,   p=<2e-16
## Score (logrank) test = 162.11  on 3 df,   p=<2e-16
hip.smk.all1 = coxph(Surv(fu_hipfx, hipfx) ~  smoke.c + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip.smk.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke.c + age_bin + bmd_bin + 
##     fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                          coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke.cPast         -0.068273  0.934005  0.134787 -0.5065  0.612487    
## smoke.cCurrent       0.822679  2.276591  0.309869  2.6549  0.007933 ** 
## age_bin2.Age>= 75    1.141116  3.130258  0.139612  8.1735 2.996e-16 ***
## bmd_bin2.BMD<= -2.5  1.563392  4.774992  0.168082  9.3013 < 2.2e-16 ***
## fall_bin2.Falls 1+   0.324356  1.383140  0.147666  2.1966  0.028052 *  
## fx50_bin2.Fx 1+      0.266081  1.304841  0.157093  1.6938  0.090306 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast           0.93401    1.07066   0.71716    1.2164
## smoke.cCurrent        2.27659    0.43925   1.24029    4.1787
## age_bin2.Age>= 75     3.13026    0.31946   2.38091    4.1155
## bmd_bin2.BMD<= -2.5   4.77499    0.20942   3.43479    6.6381
## fall_bin2.Falls 1+    1.38314    0.72299   1.03555    1.8474
## fx50_bin2.Fx 1+       1.30484    0.76638   0.95905    1.7753
## 
## Concordance= 0.735  (se = 0.017 )
## Likelihood ratio test= 168.76  on 6 df,   p=<2e-16
## Wald test            = 204.2  on 6 df,   p=<2e-16
## Score (logrank) test = 256.01  on 6 df,   p=<2e-16
hip.smk.all2 = coxph(Surv(fu_hipfx, hipfx) ~  smoke.c + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid, data = men.smk)
summary(hip.smk.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke.c + age_bin + bmd_bin + 
##     fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + 
##     protein2 + education + BMI + cvd + hypertension + copd + 
##     diabetes + cancer + renal + parkinson + depression + rheumatoid, 
##     data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke.cPast                     -0.1003479  0.9045227  0.1395985 -0.7188
## smoke.cCurrent                   0.8093504  2.2464482  0.3149415  2.5698
## age_bin2.Age>= 75                1.0376338  2.8225304  0.1436818  7.2217
## bmd_bin2.BMD<= -2.5              1.5458572  4.6919921  0.1760006  8.7832
## fall_bin2.Falls 1+               0.2848979  1.3296263  0.1500361  1.8989
## fx50_bin2.Fx 1+                  0.2833728  1.3276000  0.1576854  1.7971
## drink_bin2.Excessive drinking   -0.2304198  0.7942002  0.1516925 -1.5190
## activity_bin2.Less active        0.1723060  1.1880413  0.1592610  1.0819
## calci_bin2.Insufficient Calcium -0.0648584  0.9372002  0.1776294 -0.3651
## protein2                        -0.0024005  0.9976024  0.0029877 -0.8035
## education                       -0.0393954  0.9613705  0.0409012 -0.9632
## BMI                             -0.0244095  0.9758860  0.0188013 -1.2983
## cvd                              0.3401319  1.4051329  0.1534947  2.2159
## hypertension                     0.4892259  1.6310531  0.1349313  3.6257
## copd                            -0.0427253  0.9581746  0.2143931 -0.1993
## diabetes                         0.1086192  1.1147378  0.2213135  0.4908
## cancer                          -0.0354437  0.9651771  0.1722312 -0.2058
## renal                           -0.3907790  0.6765297  0.2714743 -1.4395
## parkinson                        0.3909541  1.4783906  0.2275320  1.7182
## depression                       0.1732430  1.1891550  0.2999132  0.5776
## rheumatoid                       0.1117549  1.1182388  0.1345257  0.8307
##                                  Pr(>|z|)    
## smoke.cPast                     0.4722444    
## smoke.cCurrent                  0.0101745 *  
## age_bin2.Age>= 75               5.132e-13 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              0.0575826 .  
## fx50_bin2.Fx 1+                 0.0723233 .  
## drink_bin2.Excessive drinking   0.1287644    
## activity_bin2.Less active       0.2792930    
## calci_bin2.Insufficient Calcium 0.7150120    
## protein2                        0.4217106    
## education                       0.3354553    
## BMI                             0.1941880    
## cvd                             0.0266970 *  
## hypertension                    0.0002881 ***
## copd                            0.8420399    
## diabetes                        0.6235725    
## cancer                          0.8369537    
## renal                           0.1500175    
## parkinson                       0.0857533 .  
## depression                      0.5635046    
## rheumatoid                      0.4061244    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast                       0.90452    1.10556   0.68801    1.1892
## smoke.cCurrent                    2.24645    0.44515   1.21176    4.1646
## age_bin2.Age>= 75                 2.82253    0.35429   2.12979    3.7406
## bmd_bin2.BMD<= -2.5               4.69199    0.21313   3.32311    6.6247
## fall_bin2.Falls 1+                1.32963    0.75209   0.99087    1.7842
## fx50_bin2.Fx 1+                   1.32760    0.75324   0.97464    1.8084
## drink_bin2.Excessive drinking     0.79420    1.25913   0.58994    1.0692
## activity_bin2.Less active         1.18804    0.84172   0.86950    1.6233
## calci_bin2.Insufficient Calcium   0.93720    1.06701   0.66166    1.3275
## protein2                          0.99760    1.00240   0.99178    1.0035
## education                         0.96137    1.04018   0.88731    1.0416
## BMI                               0.97589    1.02471   0.94058    1.0125
## cvd                               1.40513    0.71168   1.04007    1.8983
## hypertension                      1.63105    0.61310   1.25203    2.1248
## copd                              0.95817    1.04365   0.62944    1.4586
## diabetes                          1.11474    0.89707   0.72242    1.7201
## cancer                            0.96518    1.03608   0.68866    1.3527
## renal                             0.67653    1.47813   0.39738    1.1518
## parkinson                         1.47839    0.67641   0.94648    2.3092
## depression                        1.18916    0.84093   0.66062    2.1405
## rheumatoid                        1.11824    0.89426   0.85907    1.4556
## 
## Concordance= 0.757  (se = 0.017 )
## Likelihood ratio test= 202.49  on 21 df,   p=<2e-16
## Wald test            = 237.6  on 21 df,   p=<2e-16
## Score (logrank) test = 291.98  on 21 df,   p=<2e-16

Binary format for PAR calculation

hip.smk.age = coxph(Surv(fu_hipfx, hipfx) ~  smoke_bin + age, data = men.smk)
summary(hip.smk.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_bin + age, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                coef exp(coef) se(coef)       z  Pr(>|z|)    
## smoke_bin2.Current smoking 1.014385  2.757666 0.299428  3.3877 0.0007047 ***
## age                        0.137710  1.147642 0.011253 12.2372 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                            exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking    2.7577    0.36263    1.5334    4.9592
## age                           1.1476    0.87135    1.1226    1.1732
## 
## Concordance= 0.727  (se = 0.016 )
## Likelihood ratio test= 145.22  on 2 df,   p=<2e-16
## Wald test            = 152.44  on 2 df,   p=<2e-16
## Score (logrank) test = 161.92  on 2 df,   p=<2e-16
hip.smk.all1 = coxph(Surv(fu_hipfx, hipfx) ~  smoke_bin + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip.smk.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                               coef exp(coef) se(coef)      z Pr(>|z|)    
## smoke_bin2.Current smoking 0.86289   2.36999  0.29980 2.8782  0.00400 ** 
## age_bin2.Age>= 75          1.14509   3.14272  0.13936 8.2170  < 2e-16 ***
## bmd_bin2.BMD<= -2.5        1.56407   4.77824  0.16806 9.3067  < 2e-16 ***
## fall_bin2.Falls 1+         0.32342   1.38185  0.14765 2.1905  0.02849 *  
## fx50_bin2.Fx 1+            0.26396   1.30207  0.15705 1.6808  0.09281 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                            exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking    2.3700    0.42194    1.3169    4.2652
## age_bin2.Age>= 75             3.1427    0.31820    2.3916    4.1298
## bmd_bin2.BMD<= -2.5           4.7782    0.20928    3.4373    6.6423
## fall_bin2.Falls 1+            1.3819    0.72367    1.0346    1.8456
## fx50_bin2.Fx 1+               1.3021    0.76801    0.9571    1.7714
## 
## Concordance= 0.731  (se = 0.017 )
## Likelihood ratio test= 168.5  on 5 df,   p=<2e-16
## Wald test            = 203.81  on 5 df,   p=<2e-16
## Score (logrank) test = 255.62  on 5 df,   p=<2e-16
hip.smk.all2 = coxph(Surv(fu_hipfx, hipfx) ~  smoke_bin + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid, data = men.smk)
summary(hip.smk.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke_bin2.Current smoking       0.8702020  2.3873931  0.3036858  2.8655
## age_bin2.Age>= 75                1.0443334  2.8415036  0.1432956  7.2880
## bmd_bin2.BMD<= -2.5              1.5430984  4.6790654  0.1758326  8.7760
## fall_bin2.Falls 1+               0.2841194  1.3285916  0.1500526  1.8935
## fx50_bin2.Fx 1+                  0.2790259  1.3218416  0.1575941  1.7705
## drink_bin2.Excessive drinking   -0.2464582  0.7815640  0.1499755 -1.6433
## activity_bin2.Less active        0.1703902  1.1857674  0.1592740  1.0698
## calci_bin2.Insufficient Calcium -0.0674420  0.9347819  0.1775400 -0.3799
## protein2                        -0.0023977  0.9976052  0.0029897 -0.8020
## education                       -0.0355068  0.9651161  0.0405423 -0.8758
## BMI                             -0.0254591  0.9748623  0.0187126 -1.3605
## cvd                              0.3341880  1.3968057  0.1532614  2.1805
## hypertension                     0.4855621  1.6250882  0.1348297  3.6013
## copd                            -0.0530674  0.9483160  0.2139154 -0.2481
## diabetes                         0.1093723  1.1155776  0.2212235  0.4944
## cancer                          -0.0340719  0.9665021  0.1722659 -0.1978
## renal                           -0.3930198  0.6750154  0.2715806 -1.4472
## parkinson                        0.3941973  1.4831931  0.2275817  1.7321
## depression                       0.1730032  1.1888700  0.2999022  0.5769
## rheumatoid                       0.1057541  1.1115485  0.1342510  0.7877
##                                  Pr(>|z|)    
## smoke_bin2.Current smoking      0.0041639 ** 
## age_bin2.Age>= 75               3.147e-13 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              0.0582960 .  
## fx50_bin2.Fx 1+                 0.0766380 .  
## drink_bin2.Excessive drinking   0.1003160    
## activity_bin2.Less active       0.2847127    
## calci_bin2.Insufficient Calcium 0.7040422    
## protein2                        0.4225676    
## education                       0.3811399    
## BMI                             0.1736626    
## cvd                             0.0292197 *  
## hypertension                    0.0003166 ***
## copd                            0.8040749    
## diabetes                        0.6210256    
## cancer                          0.8432121    
## renal                           0.1478529    
## parkinson                       0.0832534 .  
## depression                      0.5640303    
## rheumatoid                      0.4308522    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke_bin2.Current smoking        2.38739    0.41887   1.31652    4.3293
## age_bin2.Age>= 75                 2.84150    0.35193   2.14573    3.7629
## bmd_bin2.BMD<= -2.5               4.67907    0.21372   3.31505    6.6043
## fall_bin2.Falls 1+                1.32859    0.75268   0.99007    1.7829
## fx50_bin2.Fx 1+                   1.32184    0.75652   0.97059    1.8002
## drink_bin2.Excessive drinking     0.78156    1.27949   0.58251    1.0486
## activity_bin2.Less active         1.18577    0.84334   0.86781    1.6202
## calci_bin2.Insufficient Calcium   0.93478    1.06977   0.66007    1.3238
## protein2                          0.99761    1.00240   0.99178    1.0035
## education                         0.96512    1.03614   0.89139    1.0449
## BMI                               0.97486    1.02579   0.93976    1.0113
## cvd                               1.39681    0.71592   1.03438    1.8862
## hypertension                      1.62509    0.61535   1.24770    2.1166
## copd                              0.94832    1.05450   0.62355    1.4422
## diabetes                          1.11558    0.89640   0.72309    1.7211
## cancer                            0.96650    1.03466   0.68956    1.3547
## renal                             0.67502    1.48145   0.39641    1.1494
## parkinson                         1.48319    0.67422   0.94947    2.3169
## depression                        1.18887    0.84113   0.66048    2.1400
## rheumatoid                        1.11155    0.89965   0.85439    1.4461
## 
## Concordance= 0.756  (se = 0.017 )
## Likelihood ratio test= 201.98  on 20 df,   p=<2e-16
## Wald test            = 236.96  on 20 df,   p=<2e-16
## Score (logrank) test = 291.26  on 20 df,   p=<2e-16
Sensitivity analysis to account for a competing risk of death

Data management:

men.smk = men.smk %>% mutate(hipfx_crr = case_when(hipfx == 0 & death == 0 ~ 0,
                                                  hipfx == 1 & death == 0 ~ 1,
                                                  hipfx == 0 & death == 1 ~ 2))

Age-adjusted

cov_age   = c("smoke_bin", "age")
hipfx_cph = "Surv(fu_hipfx, hipfx)"
hipfx_crr = "Surv(fu_hipfx, hipfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(hipfx_cph, cov_age, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(hipfx_cph, cov_age) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(hipfx_crr, cov_age) %>%
      fit2df(estimate_suffix = " (Fine-Gray subdistribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 174 cases omitted due to missing values
##   Dependent: Survival                           all       HR (Cause-specific)
## 2           smoke_bin 1.No/past smoking 5786 (96.6)                         -
## 3                     2.Current smoking   206 (3.4) 2.76 (1.53-4.96, p=0.001)
## 1                 age         Mean (SD)  73.7 (5.9) 1.15 (1.12-1.17, p<0.001)
##   HR (Fine-Gray subdistribution)
## 2                              -
## 3      0.50 (0.07-3.53, p=0.485)
## 1      1.02 (0.98-1.06, p=0.405)

Multivariable-adjusted (only fracture risk factors)

cov_multi1   = c("smoke_bin", "age_bin", "bmd_bin", "fall_bin", "fx50_bin")
hipfx_cph = "Surv(fu_hipfx, hipfx)"
hipfx_crr = "Surv(fu_hipfx, hipfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(hipfx_cph, cov_multi1, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(hipfx_cph, cov_multi1) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(hipfx_crr, cov_multi1) %>%
      fit2df(estimate_suffix = " (Fine-Gray distribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 174 cases omitted due to missing values
##    Dependent: Survival                           all       HR (Cause-specific)
## 9            smoke_bin 1.No/past smoking 5786 (96.6)                         -
## 10                     2.Current smoking   206 (3.4) 2.37 (1.32-4.27, p=0.004)
## 1              age_bin         1.Age< 75 3476 (58.0)                         -
## 2                             2.Age>= 75 2516 (42.0) 3.14 (2.39-4.13, p<0.001)
## 3              bmd_bin       1.BMD> -2.5 5697 (95.1)                         -
## 4                           2.BMD<= -2.5   295 (4.9) 4.78 (3.44-6.64, p<0.001)
## 5             fall_bin        1.No falls 4725 (78.9)                         -
## 6                             2.Falls 1+ 1267 (21.1) 1.38 (1.03-1.85, p=0.028)
## 7             fx50_bin           1.No fx 4961 (82.8)                         -
## 8                                2.Fx 1+ 1031 (17.2) 1.30 (0.96-1.77, p=0.093)
##    HR (Fine-Gray distribution)
## 9                            -
## 10   0.43 (0.06-3.12, p=0.405)
## 1                            -
## 2    0.89 (0.53-1.49, p=0.652)
## 3                            -
## 4    4.75 (2.40-9.38, p<0.001)
## 5                            -
## 6    0.67 (0.34-1.34, p=0.261)
## 7                            -
## 8    1.55 (0.86-2.79, p=0.146)

Multivariable-adjusted (only fracture risk factors)

cov_multi2   = c("smoke_bin", "age_bin", "bmd_bin", "fall_bin", "fx50_bin", "drink_bin", "activity_bin", "calci_bin", "protein2", "education", "BMI", "cvd", "hypertension", "copd", "diabetes", "cancer", "renal", "parkinson", "depression", "rheumatoid")
hipfx_cph = "Surv(fu_hipfx, hipfx)"
hipfx_crr = "Surv(fu_hipfx, hipfx_crr)"

men.smk %>%
  # Summary table
  summary_factorlist(hipfx_cph, cov_multi2, 
                     column = TRUE, fit_id = TRUE) %>%
  # CPH multivariable
  ff_merge(
    men.smk %>%
      coxphmulti(hipfx_cph, cov_multi2) %>%
      fit2df(estimate_suffix = " (Cause-specific)")
  ) %>%
  # Fine and Gray competing risks regression
  ff_merge(
    men.smk %>%
      crrmulti(hipfx_crr, cov_multi2) %>%
      fit2df(estimate_suffix = " (Fine-Gray subdistribution)")
  ) %>%
  select(-fit_id, -index) %>%
  dependent_label(men.smk, "Survival")
## Dependent variable is a survival object
## 174 cases omitted due to missing values
##    Dependent: Survival                                all
## 45           smoke_bin      1.No/past smoking 5786 (96.6)
## 46                          2.Current smoking   206 (3.4)
## 3              age_bin              1.Age< 75 3476 (58.0)
## 4                                  2.Age>= 75 2516 (42.0)
## 5              bmd_bin            1.BMD> -2.5 5697 (95.1)
## 6                                2.BMD<= -2.5   295 (4.9)
## 28            fall_bin             1.No falls 4725 (78.9)
## 29                                 2.Falls 1+ 1267 (21.1)
## 30            fx50_bin                1.No fx 4961 (82.8)
## 31                                    2.Fx 1+ 1031 (17.2)
## 25           drink_bin        1.Less drinking 4042 (67.5)
## 26                       2.Excessive drinking 1950 (32.5)
## 1         activity_bin            1.Proactive 1545 (25.8)
## 2                               2.Less active 4447 (74.2)
## 8            calci_bin   1.Sufficient Calcium 1458 (24.3)
## 9                      2.Insufficient Calcium 4534 (75.7)
## 38            protein2              Mean (SD) 64.1 (27.4)
## 27           education              Mean (SD)   5.8 (1.6)
## 7                  BMI              Mean (SD)  27.3 (3.9)
## 17                 cvd                      0 4741 (79.1)
## 18                                          1 1251 (20.9)
## 33        hypertension                      0 3411 (56.9)
## 34                                          1 2581 (43.1)
## 14                copd                      0 5352 (89.3)
## 15                                          1  640 (10.7)
## 23            diabetes                      0 5339 (89.1)
## 24                                          1  653 (10.9)
## 11              cancer                      0 4900 (81.8)
## 12                                          1 1092 (18.2)
## 40               renal                      0 5439 (90.8)
## 41                                          1   553 (9.2)
## 36           parkinson                      0 5203 (86.8)
## 37                                          1  789 (13.2)
## 20          depression                      0 5781 (96.5)
## 21                                          1   211 (3.5)
## 43          rheumatoid                      0 3147 (52.5)
## 44                                          1 2845 (47.5)
## 10                <NA>                   <NA>        <NA>
## 13                <NA>                   <NA>        <NA>
## 16                <NA>                   <NA>        <NA>
## 19                <NA>                   <NA>        <NA>
## 22                <NA>                   <NA>        <NA>
## 32                <NA>                   <NA>        <NA>
## 35                <NA>                   <NA>        <NA>
## 39                <NA>                   <NA>        <NA>
## 42                <NA>                   <NA>        <NA>
##          HR (Cause-specific) HR (Fine-Gray subdistribution)
## 45                         -                              -
## 46 2.39 (1.32-4.33, p=0.004)      0.50 (0.07-3.63, p=0.491)
## 3                          -                              -
## 4  2.84 (2.15-3.76, p<0.001)      0.95 (0.56-1.63, p=0.861)
## 5                          -                              -
## 6  4.68 (3.32-6.60, p<0.001)      4.75 (2.28-9.88, p<0.001)
## 28                         -                              -
## 29 1.33 (0.99-1.78, p=0.058)      0.66 (0.33-1.34, p=0.255)
## 30                         -                              -
## 31 1.32 (0.97-1.80, p=0.077)      1.51 (0.83-2.75, p=0.181)
## 25                         -                              -
## 26 0.78 (0.58-1.05, p=0.100)      0.84 (0.48-1.45, p=0.523)
## 1                          -                              -
## 2  1.19 (0.87-1.62, p=0.285)      1.05 (0.57-1.94, p=0.873)
## 8                          -                              -
## 9  0.93 (0.66-1.32, p=0.704)      1.36 (0.67-2.76, p=0.389)
## 38 1.00 (0.99-1.00, p=0.423)      1.01 (1.00-1.02, p=0.275)
## 27 0.97 (0.89-1.04, p=0.381)      1.08 (0.93-1.26, p=0.321)
## 7  0.97 (0.94-1.01, p=0.174)      0.99 (0.93-1.06, p=0.845)
## 17                         -                              -
## 18                         -                              -
## 33                         -                              -
## 34                         -                              -
## 14                         -                              -
## 15                         -                              -
## 23                         -                              -
## 24                         -                              -
## 11                         -                              -
## 12                         -                              -
## 40                         -                              -
## 41                         -                              -
## 36                         -                              -
## 37                         -                              -
## 20                         -                              -
## 21                         -                              -
## 43                         -                              -
## 44                         -                              -
## 10 0.97 (0.69-1.35, p=0.843)      0.82 (0.41-1.64, p=0.571)
## 13 0.95 (0.62-1.44, p=0.804)      0.41 (0.13-1.31, p=0.132)
## 16 1.40 (1.03-1.89, p=0.029)      0.99 (0.52-1.89, p=0.969)
## 19 1.19 (0.66-2.14, p=0.564)      1.34 (0.41-4.36, p=0.626)
## 22 1.12 (0.72-1.72, p=0.621)      0.58 (0.22-1.52, p=0.266)
## 32 1.63 (1.25-2.12, p<0.001)      1.51 (0.91-2.50, p=0.112)
## 35 1.48 (0.95-2.32, p=0.083)      0.86 (0.42-1.75, p=0.671)
## 39 0.68 (0.40-1.15, p=0.148)      1.39 (0.65-2.96, p=0.392)
## 42 1.11 (0.85-1.45, p=0.431)      1.16 (0.69-1.95, p=0.587)

To calculate PAR

options(digits = 8)
hip.smk.par = coxph(Surv(fu_hipfx, hipfx) ~ as.factor(group), data = men.smk)
## Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
## Loglik converged before variable 15,18,21,23,26,28 ; coefficient may be
## infinite.
summary(hip.smk.par)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(group), data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                           coef   exp(coef)    se(coef)       z  Pr(>|z|)    
## as.factor(group)2   1.1421e+00  3.1332e+00  4.3272e-01  2.6392  0.008309 ** 
## as.factor(group)3   1.0598e-01  1.1118e+00  3.6266e-01  0.2922  0.770102    
## as.factor(group)4   1.5744e-01  1.1705e+00  3.3366e-01  0.4719  0.637026    
## as.factor(group)5   1.5098e+00  4.5258e+00  4.6955e-01  3.2154  0.001303 ** 
## as.factor(group)6   1.0619e+00  2.8920e+00  1.9574e-01  5.4251 5.791e-08 ***
## as.factor(group)7   2.6850e+00  1.4658e+01  2.8298e-01  9.4883 < 2.2e-16 ***
## as.factor(group)8   1.5361e+00  4.6464e+00  2.4769e-01  6.2017 5.587e-10 ***
## as.factor(group)9   1.5914e+00  4.9104e+00  2.8294e-01  5.6245 1.861e-08 ***
## as.factor(group)10  1.6234e+00  5.0702e+00  1.0109e+00  1.6059  0.108291    
## as.factor(group)11  2.6142e+00  1.3656e+01  5.9478e-01  4.3952 1.107e-05 ***
## as.factor(group)12  2.0360e+00  7.6599e+00  7.2143e-01  2.8222  0.004770 ** 
## as.factor(group)13  2.7782e+00  1.6091e+01  1.0106e+00  2.7490  0.005978 ** 
## as.factor(group)14 -3.0209e-01  7.3927e-01  7.2140e-01 -0.4188  0.675395    
## as.factor(group)15  1.3097e+00  3.7050e+00  1.0102e+00  1.2964  0.194822    
## as.factor(group)16 -1.3185e+01  1.8779e-06  1.1403e+03 -0.0116  0.990774    
## as.factor(group)17  2.9849e+00  1.9785e+01  4.7136e-01  6.3325 2.412e-10 ***
## as.factor(group)18  2.8476e+00  1.7247e+01  4.0567e-01  7.0195 2.227e-12 ***
## as.factor(group)19 -1.3236e+01  1.7859e-06  4.3690e+03 -0.0030  0.997583    
## as.factor(group)20  1.8474e+00  6.3430e+00  3.4860e-01  5.2994 1.162e-07 ***
## as.factor(group)21  2.1735e+00  8.7893e+00  1.0102e+00  2.1515  0.031435 *  
## as.factor(group)22 -1.3625e+01  1.2102e-06  1.5209e+04 -0.0009  0.999285    
## as.factor(group)23  3.0546e+00  2.1212e+01  7.2195e-01  4.2310 2.326e-05 ***
## as.factor(group)24 -1.3173e+01  1.9021e-06  4.1879e+03 -0.0031  0.997490    
## as.factor(group)26  2.5838e+00  1.3247e+01  1.0119e+00  2.5533  0.010670 *  
## as.factor(group)27  2.7888e+00  1.6262e+01  5.9678e-01  4.6731 2.966e-06 ***
## as.factor(group)28 -1.3196e+01  1.8579e-06  8.8675e+03 -0.0015  0.998813    
## as.factor(group)29  7.0362e+00  1.1370e+03  1.0446e+00  6.7360 1.628e-11 ***
## as.factor(group)30 -1.3374e+01  1.5556e-06  1.0779e+04 -0.0012  0.999010    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## as.factor(group)2  3.1332e+00 3.1916e-01   1.34170    7.3168
## as.factor(group)3  1.1118e+00 8.9944e-01   0.54617    2.2632
## as.factor(group)4  1.1705e+00 8.5433e-01   0.60865    2.2510
## as.factor(group)5  4.5258e+00 2.2096e-01   1.80308   11.3599
## as.factor(group)6  2.8920e+00 3.4578e-01   1.97050    4.2444
## as.factor(group)7  1.4658e+01 6.8223e-02   8.41786   25.5236
## as.factor(group)8  4.6464e+00 2.1522e-01   2.85945    7.5501
## as.factor(group)9  4.9104e+00 2.0365e-01   2.82023    8.5498
## as.factor(group)10 5.0702e+00 1.9723e-01   0.69915   36.7684
## as.factor(group)11 1.3656e+01 7.3227e-02   4.25648   43.8137
## as.factor(group)12 7.6599e+00 1.3055e-01   1.86268   31.5000
## as.factor(group)13 1.6091e+01 6.2148e-02   2.21984  116.6344
## as.factor(group)14 7.3927e-01 1.3527e+00   0.17978    3.0399
## as.factor(group)15 3.7050e+00 2.6991e-01   0.51156   26.8333
## as.factor(group)16 1.8779e-06 5.3252e+05   0.00000       Inf
## as.factor(group)17 1.9785e+01 5.0543e-02   7.85443   49.8387
## as.factor(group)18 1.7247e+01 5.7982e-02   7.78745   38.1958
## as.factor(group)19 1.7859e-06 5.5995e+05   0.00000       Inf
## as.factor(group)20 6.3430e+00 1.5765e-01   3.20307   12.5609
## as.factor(group)21 8.7893e+00 1.1378e-01   1.21351   63.6596
## as.factor(group)22 1.2102e-06 8.2634e+05   0.00000       Inf
## as.factor(group)23 2.1212e+01 4.7142e-02   5.15310   87.3195
## as.factor(group)24 1.9021e-06 5.2574e+05   0.00000       Inf
## as.factor(group)26 1.3247e+01 7.5487e-02   1.82292   96.2692
## as.factor(group)27 1.6262e+01 6.1492e-02   5.04891   52.3800
## as.factor(group)28 1.8579e-06 5.3826e+05   0.00000       Inf
## as.factor(group)29 1.1370e+03 8.7949e-04 146.76977 8808.5434
## as.factor(group)30 1.5556e-06 6.4285e+05   0.00000       Inf
## 
## Concordance= 0.735  (se = 0.017 )
## Likelihood ratio test= 188.4  on 28 df,   p=<2e-16
## Wald test            = 232.87  on 28 df,   p=<2e-16
## Score (logrank) test = 686.98  on 28 df,   p=<2e-16
par = read.csv("C:\\Thach\\Research projects\\PAR for lifestyle factors\\par_smoking.csv")
library(tidyverse)
library(ggplot2)

## Any fracture
m.anyfx = par %>%
  filter(lifestyle == 10 & sex == 0 & fx == 1) %>%
  mutate(group = factor(as.factor(group), levels = rev(unique(group)))
        ,color = as.factor(ifelse(group %in% c(1,9,12,14,15,18,20,21,23,24,25,27,28,29,30,31),1,0)))

ggplot(data = m.anyfx, aes(x = group, y = par, fill = color)) + 
  geom_bar(stat = "identity", width = 0.9) + 
  scale_fill_manual(values = c("0" = "gray", "1" = "darkblue")) +
  coord_flip() + 
  theme_minimal() + theme(legend.position = "none")

## Hip fracture
m.hipfx = par %>%
  filter(lifestyle == 10 & sex == 0 & fx == 2) %>%
  mutate(group = factor(as.factor(group), levels = rev(unique(group)))
        ,color = as.factor(ifelse(group %in% c(1,9,12,14,15,18,20,21,23,24,25,27,28,29,30,31),1,0)))

ggplot(data = m.hipfx, aes(x = group, y = par, fill = color)) + 
  geom_bar(stat = "identity", width = 0.9) + 
  scale_fill_manual(values = c("0" = "gray", "1" = "darkblue")) +
  coord_flip() + 
  theme_minimal() + theme(legend.position = "none")
## Warning: Removed 4 rows containing missing values (`position_stack()`).

(2.2) Classification 2: Current/Past vs. None

Data management

men.smk = men.smk %>% mutate(smoke2_bin = case_when(smoke == "Never"~ "1.No/past smoking",
                                           smoke == "Current" | smoke == "Past" ~ "2.Current smoking"))
                                             
men.smk = men.smk %>% mutate(group2 = case_when(age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 1,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 2,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 3,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 4,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 5,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 6,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 7,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 8,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 9,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 10,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 11,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 12,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 13,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 14,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 15,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 16,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "1.No/past smoking" ~ 17,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 18,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 19,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 20,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 21,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 22,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 23,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 24,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 25,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 26,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "1.No/past smoking" ~ 27,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smoke2_bin == "2.Current smoking" ~ 28,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 29,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 30,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 31,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smoke2_bin == "2.Current smoking" ~ 32))

(2.2.1) Prevalence

table1(~ age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin + fx50_bin + smoke2_bin + drink_bin + activity_bin + as.factor(group2) | anyfx, data = men.smk, render.continuous = c(. = "Mean(SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin
## + : Terms to the right of '|' in formula 'x' define table columns and are
## expected to be factors with meaningful labels.
0
(N=4908)
1
(N=1084)
Overall
(N=5992)
age
Mean(SD) 73.5(5.86) 74.5(5.88) 73.7(5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 74.0 [70.0, 78.0] 73.0 [69.0, 78.0]
age_bin
1.Age< 75 2909 (59.3%) 567 (52.3%) 3476 (58.0%)
2.Age>= 75 1999 (40.7%) 517 (47.7%) 2516 (42.0%)
fnbmd
Mean(SD) 0.794(0.127) 0.739(0.122) 0.784(0.128)
Median [Q1, Q3] 0.783 [0.707, 0.870] 0.728 [0.652, 0.812] 0.774 [0.696, 0.860]
Tscore
Mean(SD) -1.02(0.930) -1.43(0.887) -1.09(0.935)
Median [Q1, Q3] -1.10 [-1.66, -0.466] -1.50 [-2.06, -0.894] -1.17 [-1.73, -0.539]
bmd_bin
1.BMD> -2.5 4721 (96.2%) 976 (90.0%) 5697 (95.1%)
2.BMD<= -2.5 187 (3.8%) 108 (10.0%) 295 (4.9%)
fall_bin
1.No falls 3924 (80.0%) 801 (73.9%) 4725 (78.9%)
2.Falls 1+ 984 (20.0%) 283 (26.1%) 1267 (21.1%)
fx50_bin
1.No fx 4141 (84.4%) 820 (75.6%) 4961 (82.8%)
2.Fx 1+ 767 (15.6%) 264 (24.4%) 1031 (17.2%)
smoke2_bin
1.No/past smoking 1837 (37.4%) 412 (38.0%) 2249 (37.5%)
2.Current smoking 3071 (62.6%) 672 (62.0%) 3743 (62.5%)
drink_bin
1.Less drinking 3330 (67.8%) 712 (65.7%) 4042 (67.5%)
2.Excessive drinking 1578 (32.2%) 372 (34.3%) 1950 (32.5%)
activity_bin
1.Proactive 1253 (25.5%) 292 (26.9%) 1545 (25.8%)
2.Less active 3655 (74.5%) 792 (73.1%) 4447 (74.2%)
as.factor(group2)
1 773 (15.7%) 114 (10.5%) 887 (14.8%)
2 1276 (26.0%) 208 (19.2%) 1484 (24.8%)
3 102 (2.1%) 31 (2.9%) 133 (2.2%)
4 133 (2.7%) 25 (2.3%) 158 (2.6%)
5 13 (0.3%) 7 (0.6%) 20 (0.3%)
6 476 (9.7%) 107 (9.9%) 583 (9.7%)
7 34 (0.7%) 12 (1.1%) 46 (0.8%)
8 135 (2.8%) 45 (4.2%) 180 (3.0%)
9 78 (1.6%) 26 (2.4%) 104 (1.7%)
10 740 (15.1%) 145 (13.4%) 885 (14.8%)
11 2 (0.0%) 1 (0.1%) 3 (0.1%)
12 3 (0.1%) 2 (0.2%) 5 (0.1%)
13 32 (0.7%) 11 (1.0%) 43 (0.7%)
14 24 (0.5%) 9 (0.8%) 33 (0.6%)
15 253 (5.2%) 60 (5.5%) 313 (5.2%)
16 208 (4.2%) 61 (5.6%) 269 (4.5%)
17 8 (0.2%) 5 (0.5%) 13 (0.2%)
18 8 (0.2%) 7 (0.6%) 15 (0.3%)
19 39 (0.8%) 20 (1.8%) 59 (1.0%)
20 43 (0.9%) 17 (1.6%) 60 (1.0%)
21 213 (4.3%) 49 (4.5%) 262 (4.4%)
22 126 (2.6%) 32 (3.0%) 158 (2.6%)
23 1 (0.0%) 0 (0%) 1 (0.0%)
24 4 (0.1%) 6 (0.6%) 10 (0.2%)
25 5 (0.1%) 4 (0.4%) 9 (0.2%)
26 78 (1.6%) 25 (2.3%) 103 (1.7%)
27 4 (0.1%) 4 (0.4%) 8 (0.1%)
28 10 (0.2%) 5 (0.5%) 15 (0.3%)
29 11 (0.2%) 14 (1.3%) 25 (0.4%)
30 63 (1.3%) 22 (2.0%) 85 (1.4%)
31 2 (0.0%) 3 (0.3%) 5 (0.1%)
32 11 (0.2%) 7 (0.6%) 18 (0.3%)

(2.2.2) Association for any fracture

any2.smk.age = coxph(Surv(fu_anyfx, anyfx) ~  smoke2_bin + age, data = men.smk)
summary(any2.smk.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke2_bin + age, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                  coef exp(coef)  se(coef)       z Pr(>|z|)    
## smoke2_bin2.Current smoking 0.1087108 1.1148398 0.0627327  1.7329  0.08311 .  
## age                         0.0730360 1.0757693 0.0053748 13.5887  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                             exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking    1.1148    0.89699   0.98586    1.2607
## age                            1.0758    0.92957   1.06450    1.0872
## 
## Concordance= 0.615  (se = 0.009 )
## Likelihood ratio test= 176.93  on 2 df,   p=<2e-16
## Wald test            = 185.38  on 2 df,   p=<2e-16
## Score (logrank) test = 188.95  on 2 df,   p=<2e-16
any2.smk.all1 = coxph(Surv(fu_anyfx, anyfx) ~  smoke2_bin + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any2.smk.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke2_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                 coef exp(coef) se(coef)      z  Pr(>|z|)    
## smoke2_bin2.Current smoking 0.079488  1.082733 0.062757 1.2666    0.2053    
## age_bin2.Age>= 75           0.602075  1.825903 0.062851 9.5794 < 2.2e-16 ***
## bmd_bin2.BMD<= -2.5         0.950327  2.586555 0.102918 9.2338 < 2.2e-16 ***
## fall_bin2.Falls 1+          0.329733  1.390596 0.069808 4.7234 2.319e-06 ***
## fx50_bin2.Fx 1+             0.470980  1.601563 0.071486 6.5884 4.445e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                             exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking    1.0827    0.92359   0.95742    1.2244
## age_bin2.Age>= 75              1.8259    0.54767   1.61428    2.0653
## bmd_bin2.BMD<= -2.5            2.5866    0.38661   2.11406    3.1647
## fall_bin2.Falls 1+             1.3906    0.71912   1.21277    1.5945
## fx50_bin2.Fx 1+                1.6016    0.62439   1.39218    1.8424
## 
## Concordance= 0.637  (se = 0.009 )
## Likelihood ratio test= 258.25  on 5 df,   p=<2e-16
## Wald test            = 299.24  on 5 df,   p=<2e-16
## Score (logrank) test = 318.51  on 5 df,   p=<2e-16
any2.smk.all2 = coxph(Surv(fu_anyfx, anyfx) ~  smoke2_bin + age_bin + bmd_bin + fall_bin + fx50_bin + drink4 + drink_bin + physical4 + activity_bin + calcium2 + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(any2.smk.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke2_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink4 + drink_bin + physical4 + 
##     activity_bin + calcium2 + calci_bin + protein2 + education + 
##     BMI + cvd + hypertension + copd + diabetes + cancer + renal + 
##     parkinson + depression + rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                        coef   exp(coef)    se(coef)       z
## smoke2_bin2.Current smoking      0.04123680  1.04209885  0.06518567  0.6326
## age_bin2.Age>= 75                0.39135516  1.47898369  0.06777266  5.7745
## bmd_bin2.BMD<= -2.5              0.92912480  2.53229195  0.10562367  8.7966
## fall_bin2.Falls 1+               0.30321273  1.35420251  0.07100833  4.2701
## fx50_bin2.Fx 1+                  0.45981029  1.58377350  0.07177577  6.4062
## drink4Low                       -0.10134706  0.90361937  0.09617339 -1.0538
## drink4Moderate                  -0.23431962  0.79110892  0.13082499 -1.7911
## drink4No                        -0.01959307  0.98059762  0.07244860 -0.2704
## drink_bin2.Excessive drinking            NA          NA  0.00000000      NA
## physical4Low                    -0.06928500  0.93306072  0.09792801 -0.7075
## physical4Moderate               -0.04187566  0.95898901  0.11926548 -0.3511
## physical4No                     -0.00090664  0.99909377  0.09043806 -0.0100
## activity_bin2.Less active                NA          NA  0.00000000      NA
## calcium2                        -0.00013052  0.99986949  0.00015140 -0.8621
## calci_bin2.Insufficient Calcium -0.12485705  0.88262306  0.11519514 -1.0839
## protein2                        -0.00240856  0.99759434  0.00159859 -1.5067
## education                        0.00896632  1.00900664  0.01945063  0.4610
## BMI                             -0.00700430  0.99302017  0.00853147 -0.8210
## cvd                              0.09144803  1.09575982  0.07662271  1.1935
## hypertension                     0.07605203  1.07901871  0.06351385  1.1974
## copd                             0.10267154  1.10812738  0.09658648  1.0630
## diabetes                         0.13589319  1.14555953  0.10207621  1.3313
## cancer                           0.01735082  1.01750222  0.07996238  0.2170
## renal                            0.05364690  1.05511198  0.12749641  0.4208
## parkinson                       -0.11376414  0.89246843  0.11960656 -0.9512
## depression                       0.13109674  1.14007806  0.14240416  0.9206
## rheumatoid                      -0.03328686  0.96726105  0.06284896 -0.5296
## death                            0.60369415  1.82886243  0.07183722  8.4036
##                                  Pr(>|z|)    
## smoke2_bin2.Current smoking       0.52699    
## age_bin2.Age>= 75               7.717e-09 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              1.954e-05 ***
## fx50_bin2.Fx 1+                 1.492e-10 ***
## drink4Low                         0.29198    
## drink4Moderate                    0.07328 .  
## drink4No                          0.78682    
## drink_bin2.Excessive drinking          NA    
## physical4Low                      0.47925    
## physical4Moderate                 0.72550    
## physical4No                       0.99200    
## activity_bin2.Less active              NA    
## calcium2                          0.38865    
## calci_bin2.Insufficient Calcium   0.27842    
## protein2                          0.13189    
## education                         0.64481    
## BMI                               0.41165    
## cvd                               0.23268    
## hypertension                      0.23115    
## copd                              0.28778    
## diabetes                          0.18309    
## cancer                            0.82822    
## renal                             0.67392    
## parkinson                         0.34153    
## depression                        0.35726    
## rheumatoid                        0.59637    
## death                           < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking       1.04210    0.95960   0.91711    1.1841
## age_bin2.Age>= 75                 1.47898    0.67614   1.29502    1.6891
## bmd_bin2.BMD<= -2.5               2.53229    0.39490   2.05876    3.1147
## fall_bin2.Falls 1+                1.35420    0.73844   1.17826    1.5564
## fx50_bin2.Fx 1+                   1.58377    0.63140   1.37593    1.8230
## drink4Low                         0.90362    1.10666   0.74838    1.0911
## drink4Moderate                    0.79111    1.26405   0.61218    1.0223
## drink4No                          0.98060    1.01979   0.85079    1.1302
## drink_bin2.Excessive drinking          NA         NA        NA        NA
## physical4Low                      0.93306    1.07174   0.77011    1.1305
## physical4Moderate                 0.95899    1.04276   0.75909    1.2115
## physical4No                       0.99909    1.00091   0.83681    1.1929
## activity_bin2.Less active              NA         NA        NA        NA
## calcium2                          0.99987    1.00013   0.99957    1.0002
## calci_bin2.Insufficient Calcium   0.88262    1.13299   0.70424    1.1062
## protein2                          0.99759    1.00241   0.99447    1.0007
## education                         1.00901    0.99107   0.97126    1.0482
## BMI                               0.99302    1.00703   0.97655    1.0098
## cvd                               1.09576    0.91261   0.94296    1.2733
## hypertension                      1.07902    0.92677   0.95272    1.2221
## copd                              1.10813    0.90242   0.91701    1.3391
## diabetes                          1.14556    0.87294   0.93784    1.3993
## cancer                            1.01750    0.98280   0.86990    1.1901
## renal                             1.05511    0.94777   0.82181    1.3546
## parkinson                         0.89247    1.12049   0.70597    1.1282
## depression                        1.14008    0.87713   0.86242    1.5071
## rheumatoid                        0.96726    1.03385   0.85516    1.0941
## death                             1.82886    0.54679   1.58867    2.1054
## 
## Concordance= 0.661  (se = 0.009 )
## Likelihood ratio test= 361.08  on 26 df,   p=<2e-16
## Wald test            = 388.34  on 26 df,   p=<2e-16
## Score (logrank) test = 415.22  on 26 df,   p=<2e-16

To obtain HR for PAR calculation

options(digits = 8)
any2.smk.par = coxph(Surv(fu_anyfx, anyfx) ~ as.factor(group), data = men.smk)
## Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
## Loglik converged before variable 18,21,26,28 ; coefficient may be infinite.
summary(any2.smk.par)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(group), data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                           coef   exp(coef)    se(coef)       z  Pr(>|z|)    
## as.factor(group)2   5.0358e-01  1.6546e+00  2.3097e-01  2.1803 0.0292352 *  
## as.factor(group)3   5.8961e-01  1.8033e+00  1.2169e-01  4.8451 1.266e-06 ***
## as.factor(group)4   3.5915e-01  1.4321e+00  1.2454e-01  2.8838 0.0039292 ** 
## as.factor(group)5   7.9699e-01  2.2189e+00  2.6457e-01  3.0124 0.0025918 ** 
## as.factor(group)6   6.6369e-01  1.9419e+00  8.6418e-02  7.6801 1.590e-14 ***
## as.factor(group)7   1.5168e+00  4.5578e+00  1.8648e-01  8.1343 4.143e-16 ***
## as.factor(group)8   9.6153e-01  2.6157e+00  1.2141e-01  7.9198 2.380e-15 ***
## as.factor(group)9   1.0017e+00  2.7228e+00  1.4393e-01  6.9592 3.421e-12 ***
## as.factor(group)10  7.8150e-01  2.1848e+00  5.8046e-01  1.3464 0.1781893    
## as.factor(group)11  1.4151e+00  4.1168e+00  4.5092e-01  3.1382 0.0016999 ** 
## as.factor(group)12  1.4212e+00  4.1420e+00  4.1230e-01  3.4470 0.0005669 ***
## as.factor(group)13  2.3621e+00  1.0613e+01  5.8108e-01  4.0650 4.804e-05 ***
## as.factor(group)14  7.6270e-01  2.1441e+00  1.8591e-01  4.1024 4.088e-05 ***
## as.factor(group)15  5.8924e-01  1.8026e+00  5.8023e-01  1.0155 0.3098597    
## as.factor(group)16  7.4042e-01  2.0968e+00  4.5100e-01  1.6417 0.1006461    
## as.factor(group)17  1.9150e+00  6.7869e+00  3.2216e-01  5.9443 2.777e-09 ***
## as.factor(group)18  2.2236e+00  9.2408e+00  2.3197e-01  9.5857 < 2.2e-16 ***
## as.factor(group)19 -1.2066e+01  5.7544e-06  8.7033e+02 -0.0139 0.9889391    
## as.factor(group)20  1.4171e+00  4.1251e+00  1.7097e-01  8.2883 < 2.2e-16 ***
## as.factor(group)21  2.4387e+00  1.1458e+01  4.5154e-01  5.4009 6.631e-08 ***
## as.factor(group)22 -1.2042e+01  5.8897e-06  2.5250e+03 -0.0048 0.9961947    
## as.factor(group)23  1.6817e+00  5.3745e+00  5.8041e-01  2.8974 0.0037628 ** 
## as.factor(group)24  3.0803e+00  2.1765e+01  7.1032e-01  4.3365 1.448e-05 ***
## as.factor(group)26  1.4848e+00  4.4139e+00  7.0992e-01  2.0915 0.0364863 *  
## as.factor(group)27  2.3819e+00  1.0826e+01  3.0805e-01  7.7323 1.056e-14 ***
## as.factor(group)28 -1.2064e+01  5.7619e-06  1.7650e+03 -0.0068 0.9945463    
## as.factor(group)29  4.9726e+00  1.4440e+02  1.0081e+00  4.9327 8.109e-07 ***
## as.factor(group)30 -1.2048e+01  5.8583e-06  1.9519e+03 -0.0062 0.9950752    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## as.factor(group)2  1.6546e+00 6.0437e-01   1.05221    2.6020
## as.factor(group)3  1.8033e+00 5.5454e-01   1.42062    2.2890
## as.factor(group)4  1.4321e+00 6.9827e-01   1.12193    1.8280
## as.factor(group)5  2.2189e+00 4.5068e-01   1.32107    3.7268
## as.factor(group)6  1.9419e+00 5.1495e-01   1.63938    2.3004
## as.factor(group)7  4.5578e+00 2.1940e-01   3.16249    6.5688
## as.factor(group)8  2.6157e+00 3.8231e-01   2.06179    3.3184
## as.factor(group)9  2.7228e+00 3.6726e-01   2.05355    3.6103
## as.factor(group)10 2.1848e+00 4.5772e-01   0.70035    6.8154
## as.factor(group)11 4.1168e+00 2.4291e-01   1.70112    9.9629
## as.factor(group)12 4.1420e+00 2.4143e-01   1.84613    9.2932
## as.factor(group)13 1.0613e+01 9.4225e-02   3.39796   33.1474
## as.factor(group)14 2.1441e+00 4.6641e-01   1.48931    3.0866
## as.factor(group)15 1.8026e+00 5.5475e-01   0.57810    5.6208
## as.factor(group)16 2.0968e+00 4.7691e-01   0.86630    5.0752
## as.factor(group)17 6.7869e+00 1.4734e-01   3.60953   12.7613
## as.factor(group)18 9.2408e+00 1.0822e-01   5.86480   14.5601
## as.factor(group)19 5.7544e-06 1.7378e+05   0.00000       Inf
## as.factor(group)20 4.1251e+00 2.4242e-01   2.95054    5.7673
## as.factor(group)21 1.1458e+01 8.7272e-02   4.72905   27.7639
## as.factor(group)22 5.8897e-06 1.6979e+05   0.00000       Inf
## as.factor(group)23 5.3745e+00 1.8606e-01   1.72304   16.7643
## as.factor(group)24 2.1765e+01 4.5946e-02   5.40913   87.5743
## as.factor(group)26 4.4139e+00 2.2656e-01   1.09785   17.7463
## as.factor(group)27 1.0826e+01 9.2373e-02   5.91893   19.8000
## as.factor(group)28 5.7619e-06 1.7355e+05   0.00000       Inf
## as.factor(group)29 1.4440e+02 6.9254e-03  20.02080 1041.4260
## as.factor(group)30 5.8583e-06 1.7070e+05   0.00000       Inf
## 
## Concordance= 0.637  (se = 0.009 )
## Likelihood ratio test= 286.81  on 28 df,   p=<2e-16
## Wald test            = 349.13  on 28 df,   p=<2e-16
## Score (logrank) test = 478.67  on 28 df,   p=<2e-16

(2.2.3) Association for hip fracture

hip2.smk.age = coxph(Surv(fu_hipfx, hipfx) ~  smoke2_bin + age, data = men.smk)
summary(hip2.smk.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke2_bin + age, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                 coef exp(coef) se(coef)       z Pr(>|z|)    
## smoke2_bin2.Current smoking 0.018386  1.018556 0.132324  0.1389   0.8895    
## age                         0.134226  1.143651 0.011230 11.9522   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                             exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking    1.0186    0.98178   0.78587    1.3201
## age                            1.1437    0.87439   1.11875    1.1691
## 
## Concordance= 0.72  (se = 0.016 )
## Likelihood ratio test= 136.55  on 2 df,   p=<2e-16
## Wald test            = 143.46  on 2 df,   p=<2e-16
## Score (logrank) test = 152.84  on 2 df,   p=<2e-16
hip2.smk.all1 = coxph(Surv(fu_hipfx, hipfx) ~  smoke2_bin + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip2.smk.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke2_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                  coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke2_bin2.Current smoking -0.018219  0.981946  0.132325 -0.1377   0.89049    
## age_bin2.Age>= 75            1.104707  3.018341  0.138454  7.9789 1.476e-15 ***
## bmd_bin2.BMD<= -2.5          1.575669  4.833975  0.168079  9.3746 < 2.2e-16 ***
## fall_bin2.Falls 1+           0.326256  1.385770  0.147682  2.2092   0.02716 *  
## fx50_bin2.Fx 1+              0.249391  1.283243  0.157112  1.5873   0.11243    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                             exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking   0.98195    1.01839   0.75762    1.2727
## age_bin2.Age>= 75             3.01834    0.33131   2.30100    3.9593
## bmd_bin2.BMD<= -2.5           4.83398    0.20687   3.47724    6.7201
## fall_bin2.Falls 1+            1.38577    0.72162   1.03749    1.8510
## fx50_bin2.Fx 1+               1.28324    0.77928   0.94314    1.7460
## 
## Concordance= 0.726  (se = 0.017 )
## Likelihood ratio test= 161.99  on 5 df,   p=<2e-16
## Wald test            = 198.17  on 5 df,   p=<2e-16
## Score (logrank) test = 249.28  on 5 df,   p=<2e-16
hip2.smk.all2 = coxph(Surv(fu_hipfx, hipfx) ~  smoke2_bin + age_bin + bmd_bin + fall_bin + fx50_bin +  drink4 + drink_bin + physical4 + activity_bin + calcium2 + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(hip2.smk.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke2_bin + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink4 + drink_bin + physical4 + 
##     activity_bin + calcium2 + calci_bin + protein2 + education + 
##     BMI + cvd + hypertension + copd + diabetes + cancer + renal + 
##     parkinson + depression + rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                        coef   exp(coef)    se(coef)       z
## smoke2_bin2.Current smoking     -0.05987512  0.94188215  0.13830957 -0.4329
## age_bin2.Age>= 75                0.75079849  2.11869109  0.14814666  5.0679
## bmd_bin2.BMD<= -2.5              1.45639433  4.29046160  0.17626798  8.2624
## fall_bin2.Falls 1+               0.28737207  1.33292006  0.15024817  1.9126
## fx50_bin2.Fx 1+                  0.24588167  1.27874825  0.15803510  1.5559
## drink4Low                        0.12047641  1.12803413  0.21920550  0.5496
## drink4Moderate                   0.23999662  1.27124486  0.26947837  0.8906
## drink4No                         0.32749362  1.38748619  0.16325579  2.0060
## drink_bin2.Excessive drinking            NA          NA  0.00000000      NA
## physical4Low                    -0.07188955  0.93063368  0.21195529 -0.3392
## physical4Moderate               -0.47186920  0.62383511  0.30060432 -1.5697
## physical4No                      0.00124075  1.00124153  0.19243252  0.0064
## activity_bin2.Less active                NA          NA  0.00000000      NA
## calcium2                        -0.00024788  0.99975215  0.00032267 -0.7682
## calci_bin2.Insufficient Calcium -0.16749582  0.84578015  0.24805001 -0.6753
## protein2                        -0.00059458  0.99940560  0.00343410 -0.1731
## education                       -0.03181628  0.96868454  0.04125872 -0.7711
## BMI                             -0.03037786  0.97007891  0.01849086 -1.6429
## cvd                              0.25402041  1.28919811  0.15363758  1.6534
## hypertension                     0.41796570  1.51886857  0.13516257  3.0923
## copd                            -0.08124107  0.92197141  0.21450307 -0.3787
## diabetes                         0.01512104  1.01523594  0.22249524  0.0680
## cancer                          -0.05572664  0.94579765  0.17234253 -0.3233
## renal                           -0.34970740  0.70489431  0.26773253 -1.3062
## parkinson                        0.35519467  1.42645832  0.22406128  1.5853
## depression                       0.07351039  1.07627971  0.30023065  0.2448
## rheumatoid                       0.06892847  1.07135957  0.13481996  0.5113
## death                            0.92549656  2.52312084  0.16747975  5.5260
##                                  Pr(>|z|)    
## smoke2_bin2.Current smoking      0.665083    
## age_bin2.Age>= 75               4.021e-07 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+               0.055793 .  
## fx50_bin2.Fx 1+                  0.119740    
## drink4Low                        0.582590    
## drink4Moderate                   0.373145    
## drink4No                         0.044855 *  
## drink_bin2.Excessive drinking          NA    
## physical4Low                     0.734479    
## physical4Moderate                0.116477    
## physical4No                      0.994855    
## activity_bin2.Less active              NA    
## calcium2                         0.442349    
## calci_bin2.Insufficient Calcium  0.499517    
## protein2                         0.862541    
## education                        0.440624    
## BMI                              0.100412    
## cvd                              0.098255 .  
## hypertension                     0.001986 ** 
## copd                             0.704880    
## diabetes                         0.945817    
## cancer                           0.746432    
## renal                            0.191491    
## parkinson                        0.112908    
## depression                       0.806575    
## rheumatoid                       0.609167    
## death                           3.276e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke2_bin2.Current smoking       0.94188    1.06170   0.71824    1.2352
## age_bin2.Age>= 75                 2.11869    0.47199   1.58477    2.8325
## bmd_bin2.BMD<= -2.5               4.29046    0.23308   3.03714    6.0610
## fall_bin2.Falls 1+                1.33292    0.75023   0.99292    1.7894
## fx50_bin2.Fx 1+                   1.27875    0.78201   0.93813    1.7430
## drink4Low                         1.12803    0.88650   0.73406    1.7334
## drink4Moderate                    1.27124    0.78663   0.74963    2.1558
## drink4No                          1.38749    0.72073   1.00755    1.9107
## drink_bin2.Excessive drinking          NA         NA        NA        NA
## physical4Low                      0.93063    1.07454   0.61427    1.4099
## physical4Moderate                 0.62384    1.60299   0.34609    1.1245
## physical4No                       1.00124    0.99876   0.68666    1.4599
## activity_bin2.Less active              NA         NA        NA        NA
## calcium2                          0.99975    1.00025   0.99912    1.0004
## calci_bin2.Insufficient Calcium   0.84578    1.18234   0.52014    1.3753
## protein2                          0.99941    1.00059   0.99270    1.0062
## education                         0.96868    1.03233   0.89343    1.0503
## BMI                               0.97008    1.03084   0.93555    1.0059
## cvd                               1.28920    0.77568   0.95399    1.7422
## hypertension                      1.51887    0.65838   1.16539    1.9796
## copd                              0.92197    1.08463   0.60553    1.4038
## diabetes                          1.01524    0.98499   0.65642    1.5702
## cancer                            0.94580    1.05731   0.67468    1.3259
## renal                             0.70489    1.41865   0.41709    1.1913
## parkinson                         1.42646    0.70104   0.91947    2.2130
## depression                        1.07628    0.92913   0.59754    1.9386
## rheumatoid                        1.07136    0.93339   0.82258    1.3954
## death                             2.52312    0.39633   1.81710    3.5035
## 
## Concordance= 0.781  (se = 0.015 )
## Likelihood ratio test= 233.46  on 26 df,   p=<2e-16
## Wald test            = 254.12  on 26 df,   p=<2e-16
## Score (logrank) test = 316.51  on 26 df,   p=<2e-16

To calculate PAR

options(digits = 8)
hip2.smk.par = coxph(Surv(fu_hipfx, hipfx) ~ as.factor(group2), data = men.smk)
## Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
## Loglik converged before variable 11,13,22,26 ; coefficient may be infinite.
summary(hip2.smk.par)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(group2), data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                            coef   exp(coef)    se(coef)       z  Pr(>|z|)    
## as.factor(group2)2  -7.7915e-02  9.2504e-01  2.7342e-01 -0.2850 0.7756729    
## as.factor(group2)3   1.6073e-01  1.1744e+00  5.4174e-01  0.2967 0.7667010    
## as.factor(group2)4   4.9648e-02  1.0509e+00  5.4175e-01  0.0916 0.9269810    
## as.factor(group2)5   7.9035e-01  2.2042e+00  1.0215e+00  0.7737 0.4391206    
## as.factor(group2)6   9.9764e-01  2.7119e+00  2.8749e-01  3.4702 0.0005200 ***
## as.factor(group2)7   2.3607e+00  1.0599e+01  4.3274e-01  5.4553 4.890e-08 ***
## as.factor(group2)8   1.5843e+00  4.8758e+00  3.4019e-01  4.6571 3.206e-06 ***
## as.factor(group2)9   1.6531e+00  5.2229e+00  3.9415e-01  4.1940 2.741e-05 ***
## as.factor(group2)10  9.0597e-01  2.4743e+00  2.7333e-01  3.3146 0.0009179 ***
## as.factor(group2)11  2.5584e+00  1.2915e+01  1.0216e+00  2.5044 0.0122642 *  
## as.factor(group2)12 -1.4787e+01  3.7845e-07  5.2386e+03 -0.0028 0.9977478    
## as.factor(group2)13  1.7527e+00  5.7703e+00  4.9362e-01  3.5507 0.0003842 ***
## as.factor(group2)14 -1.4800e+01  3.7372e-07  1.7026e+03 -0.0087 0.9930643    
## as.factor(group2)15  1.1513e-01  1.1220e+00  4.1053e-01  0.2804 0.7791413    
## as.factor(group2)16 -2.1736e-01  8.0464e-01  4.9349e-01 -0.4405 0.6596048    
## as.factor(group2)17  2.8939e+00  1.8064e+01  7.3998e-01  3.9108 9.200e-05 ***
## as.factor(group2)18  1.6992e+00  5.4693e+00  1.0222e+00  1.6622 0.0964716 .  
## as.factor(group2)19  2.6789e+00  1.4569e+01  3.8052e-01  7.0402 1.920e-12 ***
## as.factor(group2)20  2.1502e+00  8.5869e+00  4.6050e-01  4.6694 3.021e-06 ***
## as.factor(group2)21  1.2761e+00  3.5826e+00  3.5806e-01  3.5640 0.0003653 ***
## as.factor(group2)22  1.2910e+00  3.6366e+00  4.1196e-01  3.1339 0.0017248 ** 
## as.factor(group2)23 -1.4730e+01  4.0055e-07  1.1805e+04 -0.0012 0.9990044    
## as.factor(group2)24  2.2775e+00  9.7527e+00  7.3738e-01  3.0887 0.0020105 ** 
## as.factor(group2)25  2.3069e+00  1.0044e+01  7.3729e-01  3.1289 0.0017544 ** 
## as.factor(group2)26  2.9981e-01  1.3496e+00  6.1390e-01  0.4884 0.6252901    
## as.factor(group2)27 -1.4763e+01  3.8781e-07  5.1373e+03 -0.0029 0.9977072    
## as.factor(group2)28  2.7946e+00  1.6356e+01  6.1490e-01  4.5448 5.499e-06 ***
## as.factor(group2)29  3.2261e+00  2.5182e+01  4.3361e-01  7.4401 1.006e-13 ***
## as.factor(group2)30  1.2969e+00  3.6580e+00  5.4269e-01  2.3898 0.0168578 *  
## as.factor(group2)31  3.1152e+00  2.2539e+01  7.3778e-01  4.2224 2.417e-05 ***
## as.factor(group2)32  3.2909e+00  2.6868e+01  6.1894e-01  5.3170 1.055e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                      exp(coef) exp(-coef) lower .95 upper .95
## as.factor(group2)2  9.2504e-01 1.0810e+00   0.54129    1.5809
## as.factor(group2)3  1.1744e+00 8.5152e-01   0.40614    3.3958
## as.factor(group2)4  1.0509e+00 9.5156e-01   0.36344    3.0388
## as.factor(group2)5  2.2042e+00 4.5369e-01   0.29765   16.3224
## as.factor(group2)6  2.7119e+00 3.6875e-01   1.54369    4.7641
## as.factor(group2)7  1.0599e+01 9.4351e-02   4.53836   24.7516
## as.factor(group2)8  4.8758e+00 2.0509e-01   2.50313    9.4977
## as.factor(group2)9  5.2229e+00 1.9146e-01   2.41219   11.3087
## as.factor(group2)10 2.4743e+00 4.0415e-01   1.44810    4.2278
## as.factor(group2)11 1.2915e+01 7.7427e-02   1.74407   95.6432
## as.factor(group2)12 3.7845e-07 2.6423e+06   0.00000       Inf
## as.factor(group2)13 5.7703e+00 1.7330e-01   2.19291   15.1834
## as.factor(group2)14 3.7372e-07 2.6758e+06   0.00000       Inf
## as.factor(group2)15 1.1220e+00 8.9125e-01   0.50183    2.5087
## as.factor(group2)16 8.0464e-01 1.2428e+00   0.30588    2.1167
## as.factor(group2)17 1.8064e+01 5.5359e-02   4.23580   77.0340
## as.factor(group2)18 5.4693e+00 1.8284e-01   0.73758   40.5562
## as.factor(group2)19 1.4569e+01 6.8638e-02   6.91096   30.7139
## as.factor(group2)20 8.5869e+00 1.1646e-01   3.48225   21.1744
## as.factor(group2)21 3.5826e+00 2.7912e-01   1.77592    7.2274
## as.factor(group2)22 3.6366e+00 2.7498e-01   1.62194    8.1537
## as.factor(group2)23 4.0055e-07 2.4966e+06   0.00000       Inf
## as.factor(group2)24 9.7527e+00 1.0254e-01   2.29860   41.3798
## as.factor(group2)25 1.0044e+01 9.9566e-02   2.36759   42.6059
## as.factor(group2)26 1.3496e+00 7.4096e-01   0.40518    4.4953
## as.factor(group2)27 3.8781e-07 2.5786e+06   0.00000       Inf
## as.factor(group2)28 1.6356e+01 6.1140e-02   4.90085   54.5854
## as.factor(group2)29 2.5182e+01 3.9711e-02  10.76452   58.9087
## as.factor(group2)30 3.6580e+00 2.7337e-01   1.26272   10.5971
## as.factor(group2)31 2.2539e+01 4.4369e-02   5.30795   95.7025
## as.factor(group2)32 2.6868e+01 3.7220e-02   7.98704   90.3796
## 
## Concordance= 0.734  (se = 0.017 )
## Likelihood ratio test= 184.09  on 31 df,   p=<2e-16
## Wald test            = 221.66  on 31 df,   p=<2e-16
## Score (logrank) test = 342.27  on 31 df,   p=<2e-16

(3) Number of pack-years:

(3.1) Descriptive analysis

hipfx = subset(men.smk, hipfx == 1)
hipfx$site = 2
men.smk$site[men.smk$anyfx == 0] = 0
men.smk$site[men.smk$anyfx == 1] = 1

smk.box = rbind(men.smk, hipfx)
var_lab(smk.box$site) = "Fracture status"
val_lab(smk.box$site) = num_lab(" 0 Event-free
                                  1 Any fracture
                                  2 Hip fracture")
table(smk.box$site)
## 
##   Event-free Any fracture Hip fracture 
##         4908         1084          237
smk.box$smk_excess = ifelse(smk.box$smoke_packyrs >= 20, 1, 0)
smk.box$smk_30excess = ifelse(smk.box$smoke_packyrs >= 30, 1, 0)

smk.box = smk.box %>% mutate(quin.packyrs = case_when(smoke_packyrs == 0 ~ 1,
                                                      smoke_packyrs > 0 & smoke_packyrs<= 9.75 ~ 2,
                                                      smoke_packyrs > 9.75 & smoke_packyrs<= 22.5 ~ 3,
                                                      smoke_packyrs > 22.5 & smoke_packyrs<= 42 ~ 4,
                                                      smoke_packyrs > 42 ~ 5))

table1(~ age + as.factor(age_bin) + race + fnbmd + Tscore + as.factor(bmd_bin) + as.factor(no_falls) + as.factor(fall_bin) + as.factor(fx50) + as.factor(fx50_bin) + as.factor(smoke) + as.factor(smoke_bin) +  smoke_status + smoke_packyrs + smk_excess + smk_30excess + quin.packyrs + smoke_perddlife + smoke_perdd + smk_dur + smoke_age1st + smoke_agestop + as.factor(smoke_100life) + drink4 + as.factor(drink_bin) + physical4 + as.factor(activity_bin) + calcium2 + as.factor(calci_bin) + protein2 + as.factor(education) + BMI + as.factor(cvd) + as.factor(hypertension) + as.factor(copd) + as.factor(diabetes) + as.factor(cancer) + as.factor(renal) + as.factor(parkinson) + as.factor(depression) + as.factor(rheumatoid) + as.factor(death) | site, data = smk.box, render.continuous = c(. = "Mean(SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + as.factor(age_bin) + race + fnbmd + Tscore + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
Event-free
(N=4908)
Any fracture
(N=1084)
Hip fracture
(N=237)
Overall
(N=6229)
age
Mean(SD) 73.5(5.86) 74.5(5.88) 76.4(6.09) 73.8(5.90)
Median [Q1, Q3] 73.0 [69.0, 78.0] 74.0 [70.0, 78.0] 76.0 [72.0, 80.0] 73.0 [69.0, 78.0]
as.factor(age_bin)
1.Age< 75 2909 (59.3%) 567 (52.3%) 92 (38.8%) 3568 (57.3%)
2.Age>= 75 1999 (40.7%) 517 (47.7%) 145 (61.2%) 2661 (42.7%)
race
1:WHITE 4368 (89.0%) 1016 (93.7%) 227 (95.8%) 5611 (90.1%)
2:AFRICAN AMERICAN 226 (4.6%) 18 (1.7%) 3 (1.3%) 247 (4.0%)
3:ASIAN 166 (3.4%) 26 (2.4%) 4 (1.7%) 196 (3.1%)
4:NATIVE HAWIIAN OR OTHER PACIFIC ISLANDER 6 (0.1%) 1 (0.1%) 0 (0%) 7 (0.1%)
5:AMERICAN INDIAN OR ALASKAN NATIVE 6 (0.1%) 1 (0.1%) 0 (0%) 7 (0.1%)
6:MULTI RACIAL 58 (1.2%) 3 (0.3%) 1 (0.4%) 62 (1.0%)
7:UNKNOWN 78 (1.6%) 19 (1.8%) 2 (0.8%) 99 (1.6%)
fnbmd
Mean(SD) 0.794(0.127) 0.739(0.122) 0.689(0.115) 0.781(0.129)
Median [Q1, Q3] 0.783 [0.707, 0.870] 0.728 [0.652, 0.812] 0.671 [0.605, 0.752] 0.770 [0.692, 0.857]
Tscore
Mean(SD) -1.02(0.930) -1.43(0.887) -1.79(0.843) -1.12(0.941)
Median [Q1, Q3] -1.10 [-1.66, -0.466] -1.50 [-2.06, -0.894] -1.92 [-2.40, -1.33] -1.20 [-1.77, -0.561]
as.factor(bmd_bin)
1.BMD> -2.5 4721 (96.2%) 976 (90.0%) 191 (80.6%) 5888 (94.5%)
2.BMD<= -2.5 187 (3.8%) 108 (10.0%) 46 (19.4%) 341 (5.5%)
as.factor(no_falls)
0 3924 (80.0%) 801 (73.9%) 173 (73.0%) 4898 (78.6%)
1 984 (20.0%) 283 (26.1%) 64 (27.0%) 1331 (21.4%)
as.factor(fall_bin)
1.No falls 3924 (80.0%) 801 (73.9%) 173 (73.0%) 4898 (78.6%)
2.Falls 1+ 984 (20.0%) 283 (26.1%) 64 (27.0%) 1331 (21.4%)
as.factor(fx50)
0 4141 (84.4%) 820 (75.6%) 183 (77.2%) 5144 (82.6%)
1 595 (12.1%) 184 (17.0%) 38 (16.0%) 817 (13.1%)
2 133 (2.7%) 59 (5.4%) 9 (3.8%) 201 (3.2%)
3 31 (0.6%) 12 (1.1%) 4 (1.7%) 47 (0.8%)
4 7 (0.1%) 6 (0.6%) 2 (0.8%) 15 (0.2%)
5 0 (0%) 2 (0.2%) 1 (0.4%) 3 (0.0%)
6 1 (0.0%) 1 (0.1%) 0 (0%) 2 (0.0%)
as.factor(fx50_bin)
1.No fx 4141 (84.4%) 820 (75.6%) 183 (77.2%) 5144 (82.6%)
2.Fx 1+ 767 (15.6%) 264 (24.4%) 54 (22.8%) 1085 (17.4%)
as.factor(smoke)
Current 162 (3.3%) 44 (4.1%) 12 (5.1%) 218 (3.5%)
Never 1837 (37.4%) 412 (38.0%) 98 (41.4%) 2347 (37.7%)
Past 2909 (59.3%) 628 (57.9%) 127 (53.6%) 3664 (58.8%)
as.factor(smoke_bin)
1.No/past smoking 4746 (96.7%) 1040 (95.9%) 225 (94.9%) 6011 (96.5%)
2.Current smoking 162 (3.3%) 44 (4.1%) 12 (5.1%) 218 (3.5%)
smoke_status
1 (0.0%) 0 (0%) 0 (0%) 1 (0.0%)
0:NO 1836 (37.4%) 412 (38.0%) 98 (41.4%) 2346 (37.7%)
1:PAST 2909 (59.3%) 628 (57.9%) 127 (53.6%) 3664 (58.8%)
2:CURRENT 162 (3.3%) 44 (4.1%) 12 (5.1%) 218 (3.5%)
smoke_packyrs
Mean(SD) 18.1(24.6) 17.7(24.6) 17.6(25.3) 18.0(24.7)
Median [Q1, Q3] 7.40 [0, 29.0] 5.65 [0, 29.0] 3.00 [0, 29.3] 7.00 [0, 29.0]
smk_excess
Mean(SD) 0.343(0.475) 0.339(0.473) 0.342(0.475) 0.342(0.475)
Median [Q1, Q3] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
smk_30excess
Mean(SD) 0.247(0.431) 0.245(0.431) 0.249(0.433) 0.247(0.431)
Median [Q1, Q3] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 0]
quin.packyrs
Mean(SD) 2.55(1.50) 2.52(1.49) 2.47(1.54) 2.54(1.50)
Median [Q1, Q3] 2.00 [1.00, 4.00] 2.00 [1.00, 4.00] 2.00 [1.00, 4.00] 2.00 [1.00, 4.00]
smoke_perddlife
Mean(SD) 12.6(13.9) 12.1(13.6) 11.5(13.6) 12.4(13.8)
Median [Q1, Q3] 10.0 [0, 20.0] 10.0 [0, 20.0] 8.00 [0, 20.0] 10.0 [0, 20.0]
smoke_perdd
Mean(SD) 0.540(3.45) 0.705(3.96) 0.819(3.86) 0.579(3.56)
Median [Q1, Q3] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 0]
smk_dur
Mean(SD) 16.7(17.6) 16.6(18.0) 16.3(18.7) 16.7(17.7)
Median [Q1, Q3] 12.0 [0, 30.0] 11.0 [0, 30.0] 9.00 [0, 29.0] 12.0 [0, 30.0]
smoke_age1st
Mean(SD) 11.4(9.55) 11.6(9.89) 10.8(9.47) 11.4(9.60)
Median [Q1, Q3] 15.0 [0, 18.0] 16.0 [0, 19.0] 15.0 [0, 18.0] 15.0 [0, 18.0]
smoke_agestop
Mean(SD) 25.8(23.8) 25.3(24.0) 23.4(24.4) 25.6(23.9)
Median [Q1, Q3] 30.0 [0, 45.0] 27.0 [0, 45.0] 23.0 [0, 45.0] 29.0 [0, 45.0]
as.factor(smoke_100life)
0: No 1836 (37.4%) 412 (38.0%) 98 (41.4%) 2346 (37.7%)
1: Yes 3072 (62.6%) 672 (62.0%) 139 (58.6%) 3883 (62.3%)
drink4
High 1578 (32.2%) 372 (34.3%) 62 (26.2%) 2012 (32.3%)
Low 726 (14.8%) 155 (14.3%) 32 (13.5%) 913 (14.7%)
Moderate 393 (8.0%) 70 (6.5%) 18 (7.6%) 481 (7.7%)
No 2211 (45.0%) 487 (44.9%) 125 (52.7%) 2823 (45.3%)
as.factor(drink_bin)
1.Less drinking 3330 (67.8%) 712 (65.7%) 175 (73.8%) 4217 (67.7%)
2.Excessive drinking 1578 (32.2%) 372 (34.3%) 62 (26.2%) 2012 (32.3%)
physical4
High 695 (14.2%) 171 (15.8%) 37 (15.6%) 903 (14.5%)
Low 1361 (27.7%) 281 (25.9%) 59 (24.9%) 1701 (27.3%)
Moderate 558 (11.4%) 121 (11.2%) 16 (6.8%) 695 (11.2%)
No 2294 (46.7%) 511 (47.1%) 125 (52.7%) 2930 (47.0%)
as.factor(activity_bin)
1.Proactive 1253 (25.5%) 292 (26.9%) 53 (22.4%) 1598 (25.7%)
2.Less active 3655 (74.5%) 792 (73.1%) 184 (77.6%) 4631 (74.3%)
calcium2
Mean(SD) 795(392) 784(388) 779(387) 792(391)
Median [Q1, Q3] 730 [523, 991] 720 [515, 993] 738 [500, 994] 729 [522, 991]
as.factor(calci_bin)
1.Sufficient Calcium 1194 (24.3%) 264 (24.4%) 57 (24.1%) 1515 (24.3%)
2.Insufficient Calcium 3714 (75.7%) 820 (75.6%) 180 (75.9%) 4714 (75.7%)
protein2
Mean(SD) 64.4(27.6) 62.6(26.1) 62.2(27.9) 64.0(27.4)
Median [Q1, Q3] 60.2 [45.8, 78.7] 59.5 [45.2, 76.7] 58.2 [45.3, 76.9] 60.1 [45.7, 78.1]
as.factor(education)
1 13 (0.3%) 3 (0.3%) 0 (0%) 16 (0.3%)
2 82 (1.7%) 15 (1.4%) 4 (1.7%) 101 (1.6%)
3 243 (5.0%) 35 (3.2%) 13 (5.5%) 291 (4.7%)
4 860 (17.5%) 176 (16.2%) 44 (18.6%) 1080 (17.3%)
5 1132 (23.1%) 245 (22.6%) 48 (20.3%) 1425 (22.9%)
6 874 (17.8%) 220 (20.3%) 51 (21.5%) 1145 (18.4%)
7 507 (10.3%) 126 (11.6%) 30 (12.7%) 663 (10.6%)
8 1197 (24.4%) 264 (24.4%) 47 (19.8%) 1508 (24.2%)
BMI
Mean(SD) 27.4(3.95) 27.1(3.88) 26.7(3.73) 27.3(3.94)
Median [Q1, Q3] 26.9 [24.9, 29.5] 26.6 [24.4, 29.3] 26.1 [23.9, 28.7] 26.9 [24.7, 29.5]
as.factor(cvd)
0 3889 (79.2%) 852 (78.6%) 175 (73.8%) 4916 (78.9%)
1 1019 (20.8%) 232 (21.4%) 62 (26.2%) 1313 (21.1%)
as.factor(hypertension)
0 2804 (57.1%) 607 (56.0%) 113 (47.7%) 3524 (56.6%)
1 2104 (42.9%) 477 (44.0%) 124 (52.3%) 2705 (43.4%)
as.factor(copd)
0 4393 (89.5%) 959 (88.5%) 212 (89.5%) 5564 (89.3%)
1 515 (10.5%) 125 (11.5%) 25 (10.5%) 665 (10.7%)
as.factor(diabetes)
0 4370 (89.0%) 969 (89.4%) 213 (89.9%) 5552 (89.1%)
1 538 (11.0%) 115 (10.6%) 24 (10.1%) 677 (10.9%)
as.factor(cancer)
0 4011 (81.7%) 889 (82.0%) 195 (82.3%) 5095 (81.8%)
1 897 (18.3%) 195 (18.0%) 42 (17.7%) 1134 (18.2%)
as.factor(renal)
0 4472 (91.1%) 967 (89.2%) 213 (89.9%) 5652 (90.7%)
1 436 (8.9%) 117 (10.8%) 24 (10.1%) 577 (9.3%)
as.factor(parkinson)
0 4253 (86.7%) 950 (87.6%) 201 (84.8%) 5404 (86.8%)
1 655 (13.3%) 134 (12.4%) 36 (15.2%) 825 (13.2%)
as.factor(depression)
0 4750 (96.8%) 1031 (95.1%) 225 (94.9%) 6006 (96.4%)
1 158 (3.2%) 53 (4.9%) 12 (5.1%) 223 (3.6%)
as.factor(rheumatoid)
0 2573 (52.4%) 574 (53.0%) 117 (49.4%) 3264 (52.4%)
1 2335 (47.6%) 510 (47.0%) 120 (50.6%) 2965 (47.6%)
as.factor(death)
0 1990 (40.5%) 391 (36.1%) 63 (26.6%) 2444 (39.2%)
1 2918 (59.5%) 693 (63.9%) 174 (73.4%) 3785 (60.8%)

Boxplots

# Number of pack-years:
p1 = ggplot(data = smk.box, aes(y = smoke_packyrs, x = as.factor(site), fill = as.factor(site))) + geom_boxplot() + 
  geom_jitter(alpha=0.2) + theme_bw() + theme(legend.position="none") + 
  labs(title = "Number of pack-years by fracture status", x = "Fracture status", y = "Number of pack-years") + theme(axis.text.x = element_text(angle = 45, hjust = 1))
p1

# Number of cigarettes smoked per day during lifetime:
p2 = ggplot(data = smk.box, aes(y = smoke_perddlife, x = as.factor(site), fill = as.factor(site))) + geom_boxplot() + 
  geom_jitter(alpha=0.2) + theme_bw() + theme(legend.position="none") + 
  labs(title = "Number of cigarettes smoked per day during lifetime by fracture status", x = "Fracture status", y = "Number of cigarettes smoked per day") + theme(axis.text.x = element_text(angle = 45, hjust = 1))
p2

# Number of cigarettes currently smoked per day:
p3 = ggplot(data = smk.box, aes(y = smoke_perdd, x = as.factor(site), fill = as.factor(site))) + geom_boxplot() + 
  geom_jitter(alpha=0.2) + theme_bw() + theme(legend.position="none") + 
  labs(title = "Number of cigarettes currently smoked per day by fracture status", x = "Fracture status", y = "Number of cigarettes currently smoked per day") + theme(axis.text.x = element_text(angle = 45, hjust = 1))
p3

# Duration of smoking:
p4 = ggplot(data = smk.box, aes(y = smk_dur, x = as.factor(site), fill = as.factor(site))) + geom_boxplot() + 
  geom_jitter(alpha=0.2) + theme_bw() + theme(legend.position="none") + 
  labs(title = "Duration of smoking by fracture status", x = "Fracture status", y = "Duration of smoking") + theme(axis.text.x = element_text(angle = 45, hjust = 1))
p4

(3.2) Excessive smoking

men.smk$smk_excess = ifelse(men.smk$smoke_packyrs >= 20, 1, 0)
men.smk$smk_30excess = ifelse(men.smk$smoke_packyrs >= 30, 1, 0)
table(men.smk$smk_excess, men.smk$smk_30excess)
##    
##        0    1
##   0 3940    0
##   1  573 1479

(3.2.1) Single factor

Association for any fracture
# Prevalence:
table1(~ age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin + fx50_bin + smoke_packyrs + as.factor(smk_excess) + drink_bin + activity_bin | anyfx, data = men.smk, render.continuous = c(. = "Mean (SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin
## + : Terms to the right of '|' in formula 'x' define table columns and are
## expected to be factors with meaningful labels.
0
(N=4908)
1
(N=1084)
Overall
(N=5992)
age
Mean (SD) 73.5 (5.86) 74.5 (5.88) 73.7 (5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 74.0 [70.0, 78.0] 73.0 [69.0, 78.0]
age_bin
1.Age< 75 2909 (59.3%) 567 (52.3%) 3476 (58.0%)
2.Age>= 75 1999 (40.7%) 517 (47.7%) 2516 (42.0%)
fnbmd
Mean (SD) 0.794 (0.127) 0.739 (0.122) 0.784 (0.128)
Median [Q1, Q3] 0.783 [0.707, 0.870] 0.728 [0.652, 0.812] 0.774 [0.696, 0.860]
Tscore
Mean (SD) -1.02 (0.930) -1.43 (0.887) -1.09 (0.935)
Median [Q1, Q3] -1.10 [-1.66, -0.466] -1.50 [-2.06, -0.894] -1.17 [-1.73, -0.539]
bmd_bin
1.BMD> -2.5 4721 (96.2%) 976 (90.0%) 5697 (95.1%)
2.BMD<= -2.5 187 (3.8%) 108 (10.0%) 295 (4.9%)
fall_bin
1.No falls 3924 (80.0%) 801 (73.9%) 4725 (78.9%)
2.Falls 1+ 984 (20.0%) 283 (26.1%) 1267 (21.1%)
fx50_bin
1.No fx 4141 (84.4%) 820 (75.6%) 4961 (82.8%)
2.Fx 1+ 767 (15.6%) 264 (24.4%) 1031 (17.2%)
smoke_packyrs
Mean (SD) 18.1 (24.6) 17.7 (24.6) 18.1 (24.6)
Median [Q1, Q3] 7.40 [0, 29.0] 5.65 [0, 29.0] 7.00 [0, 29.0]
as.factor(smk_excess)
0 3223 (65.7%) 717 (66.1%) 3940 (65.8%)
1 1685 (34.3%) 367 (33.9%) 2052 (34.2%)
drink_bin
1.Less drinking 3330 (67.8%) 712 (65.7%) 4042 (67.5%)
2.Excessive drinking 1578 (32.2%) 372 (34.3%) 1950 (32.5%)
activity_bin
1.Proactive 1253 (25.5%) 292 (26.9%) 1545 (25.8%)
2.Less active 3655 (74.5%) 792 (73.1%) 4447 (74.2%)
# Association with No.pack-years:
any.packyr.age = coxph(Surv(fu_anyfx, anyfx) ~  smoke_packyrs + age, data = men.smk)
summary(any.packyr.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_packyrs + age, 
##     data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                    coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke_packyrs 0.0038050 1.0038122 0.0012554  3.0308  0.002439 ** 
## age           0.0736938 1.0764771 0.0053959 13.6573 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs    1.0038    0.99620    1.0013    1.0063
## age              1.0765    0.92896    1.0652    1.0879
## 
## Concordance= 0.616  (se = 0.009 )
## Likelihood ratio test= 182.59  on 2 df,   p=<2e-16
## Wald test            = 190.11  on 2 df,   p=<2e-16
## Score (logrank) test = 193.96  on 2 df,   p=<2e-16
any.packyr.all1 = coxph(Surv(fu_anyfx, anyfx) ~  smoke_packyrs + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any.packyr.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_packyrs + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                          coef exp(coef)  se(coef)      z  Pr(>|z|)    
## smoke_packyrs       0.0031249 1.0031298 0.0012544 2.4912   0.01273 *  
## age_bin2.Age>= 75   0.6044216 1.8301934 0.0627962 9.6251 < 2.2e-16 ***
## bmd_bin2.BMD<= -2.5 0.9532970 2.5942488 0.1029092 9.2635 < 2.2e-16 ***
## fall_bin2.Falls 1+  0.3311431 1.3925590 0.0698033 4.7439 2.096e-06 ***
## fx50_bin2.Fx 1+     0.4701525 1.6002382 0.0714737 6.5780 4.769e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs          1.0031    0.99688    1.0007    1.0056
## age_bin2.Age>= 75      1.8302    0.54639    1.6182    2.0699
## bmd_bin2.BMD<= -2.5    2.5942    0.38547    2.1204    3.1740
## fall_bin2.Falls 1+     1.3926    0.71810    1.2145    1.5967
## fx50_bin2.Fx 1+        1.6002    0.62491    1.3911    1.8409
## 
## Concordance= 0.639  (se = 0.009 )
## Likelihood ratio test= 262.57  on 5 df,   p=<2e-16
## Wald test            = 302.94  on 5 df,   p=<2e-16
## Score (logrank) test = 322.46  on 5 df,   p=<2e-16
any.packyr.all2 = coxph(Surv(fu_anyfx, anyfx) ~  smoke_packyrs + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(any.packyr.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smoke_packyrs + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke_packyrs                    0.0014724  1.0014735  0.0013353  1.1027
## age_bin2.Age>= 75                0.3932977  1.4818595  0.0676967  5.8097
## bmd_bin2.BMD<= -2.5              0.9444981  2.5715224  0.1052744  8.9718
## fall_bin2.Falls 1+               0.3073235  1.3597808  0.0709683  4.3304
## fx50_bin2.Fx 1+                  0.4631354  1.5890486  0.0717118  6.4583
## drink_bin2.Excessive drinking    0.0563734  1.0579927  0.0655826  0.8596
## activity_bin2.Less active       -0.0065639  0.9934576  0.0701420 -0.0936
## calci_bin2.Insufficient Calcium -0.0639958  0.9380090  0.0821203 -0.7793
## protein2                        -0.0032663  0.9967390  0.0013670 -2.3895
## education                        0.0063819  1.0064023  0.0193712  0.3295
## BMI                             -0.0073404  0.9926865  0.0085404 -0.8595
## cvd                              0.0928716  1.0973209  0.0766508  1.2116
## hypertension                     0.0843253  1.0879828  0.0634152  1.3297
## copd                             0.0965469  1.1013612  0.0976122  0.9891
## diabetes                         0.1526573  1.1649257  0.1015822  1.5028
## cancer                           0.0196669  1.0198615  0.0799395  0.2460
## renal                            0.0573823  1.0590606  0.1275867  0.4498
## parkinson                       -0.1107990  0.8951186  0.1196246 -0.9262
## depression                       0.1339828  1.1433732  0.1424048  0.9409
## rheumatoid                      -0.0314913  0.9689994  0.0627927 -0.5015
## death                            0.5980168  1.8185088  0.0721182  8.2922
##                                  Pr(>|z|)    
## smoke_packyrs                     0.27017    
## age_bin2.Age>= 75               6.258e-09 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              1.488e-05 ***
## fx50_bin2.Fx 1+                 1.059e-10 ***
## drink_bin2.Excessive drinking     0.39002    
## activity_bin2.Less active         0.92544    
## calci_bin2.Insufficient Calcium   0.43581    
## protein2                          0.01687 *  
## education                         0.74181    
## BMI                               0.39007    
## cvd                               0.22566    
## hypertension                      0.18361    
## copd                              0.32262    
## diabetes                          0.13289    
## cancer                            0.80567    
## renal                             0.65289    
## parkinson                         0.35433    
## depression                        0.34678    
## rheumatoid                        0.61601    
## death                           < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs                     1.00147    0.99853   0.99886   1.00410
## age_bin2.Age>= 75                 1.48186    0.67483   1.29773   1.69212
## bmd_bin2.BMD<= -2.5               2.57152    0.38887   2.09209   3.16082
## fall_bin2.Falls 1+                1.35978    0.73541   1.18321   1.56271
## fx50_bin2.Fx 1+                   1.58905    0.62931   1.38069   1.82885
## drink_bin2.Excessive drinking     1.05799    0.94519   0.93038   1.20311
## activity_bin2.Less active         0.99346    1.00659   0.86585   1.13987
## calci_bin2.Insufficient Calcium   0.93801    1.06609   0.79856   1.10181
## protein2                          0.99674    1.00327   0.99407   0.99941
## education                         1.00640    0.99364   0.96891   1.04535
## BMI                               0.99269    1.00737   0.97621   1.00944
## cvd                               1.09732    0.91131   0.94425   1.27520
## hypertension                      1.08798    0.91913   0.96082   1.23197
## copd                              1.10136    0.90797   0.90958   1.33357
## diabetes                          1.16493    0.85842   0.95462   1.42156
## cancer                            1.01986    0.98053   0.87196   1.19285
## renal                             1.05906    0.94423   0.82474   1.35995
## parkinson                         0.89512    1.11717   0.70804   1.13163
## depression                        1.14337    0.87461   0.86491   1.51148
## rheumatoid                        0.96900    1.03199   0.85679   1.09590
## death                             1.81851    0.54990   1.57880   2.09461
## 
## Concordance= 0.659  (se = 0.009 )
## Likelihood ratio test= 356.89  on 21 df,   p=<2e-16
## Wald test            = 384.41  on 21 df,   p=<2e-16
## Score (logrank) test = 411.31  on 21 df,   p=<2e-16
# Association with excessive smoking:
any.excess.age = coxph(Surv(fu_anyfx, anyfx) ~  smk_excess + age, data = men.smk)
summary(any.excess.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smk_excess + age, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                 coef exp(coef)  se(coef)       z Pr(>|z|)    
## smk_excess 0.1562445 1.1691120 0.0644094  2.4258  0.01527 *  
## age        0.0732774 1.0760289 0.0053867 13.6034  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##            exp(coef) exp(-coef) lower .95 upper .95
## smk_excess    1.1691    0.85535    1.0305    1.3264
## age           1.0760    0.92934    1.0647    1.0874
## 
## Concordance= 0.617  (se = 0.009 )
## Likelihood ratio test= 179.68  on 2 df,   p=<2e-16
## Wald test            = 187.34  on 2 df,   p=<2e-16
## Score (logrank) test = 191.2  on 2 df,   p=<2e-16
any.excess.all1 = coxph(Surv(fu_anyfx, anyfx) ~  smk_excess + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any.excess.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smk_excess + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                         coef exp(coef) se(coef)      z  Pr(>|z|)    
## smk_excess          0.133244  1.142528 0.064312 2.0718   0.03828 *  
## age_bin2.Age>= 75   0.600906  1.823770 0.062753 9.5757 < 2.2e-16 ***
## bmd_bin2.BMD<= -2.5 0.952881  2.593169 0.102918 9.2587 < 2.2e-16 ***
## fall_bin2.Falls 1+  0.332672  1.394690 0.069801 4.7660 1.879e-06 ***
## fx50_bin2.Fx 1+     0.472964  1.604744 0.071462 6.6184 3.632e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smk_excess             1.1425    0.87525    1.0072    1.2960
## age_bin2.Age>= 75      1.8238    0.54831    1.6127    2.0625
## bmd_bin2.BMD<= -2.5    2.5932    0.38563    2.1195    3.1727
## fall_bin2.Falls 1+     1.3947    0.71701    1.2164    1.5992
## fx50_bin2.Fx 1+        1.6047    0.62315    1.3950    1.8460
## 
## Concordance= 0.638  (se = 0.009 )
## Likelihood ratio test= 260.87  on 5 df,   p=<2e-16
## Wald test            = 301.45  on 5 df,   p=<2e-16
## Score (logrank) test = 320.82  on 5 df,   p=<2e-16
any.excess.all2 = coxph(Surv(fu_anyfx, anyfx) ~  smk_excess + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(any.excess.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ smk_excess + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                       coef  exp(coef)   se(coef)       z
## smk_excess                       0.0643305  1.0664447  0.0674112  0.9543
## age_bin2.Age>= 75                0.3904544  1.4776521  0.0675341  5.7816
## bmd_bin2.BMD<= -2.5              0.9447589  2.5721932  0.1052801  8.9738
## fall_bin2.Falls 1+               0.3075845  1.3601357  0.0709783  4.3335
## fx50_bin2.Fx 1+                  0.4642935  1.5908898  0.0717035  6.4752
## drink_bin2.Excessive drinking    0.0574792  1.0591632  0.0656069  0.8761
## activity_bin2.Less active       -0.0056893  0.9943269  0.0701205 -0.0811
## calci_bin2.Insufficient Calcium -0.0632424  0.9387159  0.0820965 -0.7703
## protein2                        -0.0032432  0.9967620  0.0013661 -2.3741
## education                        0.0057227  1.0057391  0.0193400  0.2959
## BMI                             -0.0073061  0.9927206  0.0085494 -0.8546
## cvd                              0.0940105  1.0985713  0.0766272  1.2269
## hypertension                     0.0837284  1.0873336  0.0634229  1.3202
## copd                             0.1018768  1.1072470  0.0970972  1.0492
## diabetes                         0.1551040  1.1677794  0.1015096  1.5280
## cancer                           0.0200417  1.0202439  0.0799342  0.2507
## renal                            0.0577378  1.0594371  0.1275399  0.4527
## parkinson                       -0.1111080  0.8948421  0.1195798 -0.9292
## depression                       0.1329853  1.1422332  0.1424219  0.9337
## rheumatoid                      -0.0317660  0.9687333  0.0628071 -0.5058
## death                            0.6006898  1.8233761  0.0719519  8.3485
##                                  Pr(>|z|)    
## smk_excess                        0.33993    
## age_bin2.Age>= 75               7.400e-09 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              1.468e-05 ***
## fx50_bin2.Fx 1+                 9.470e-11 ***
## drink_bin2.Excessive drinking     0.38097    
## activity_bin2.Less active         0.93533    
## calci_bin2.Insufficient Calcium   0.44110    
## protein2                          0.01759 *  
## education                         0.76731    
## BMI                               0.39279    
## cvd                               0.21988    
## hypertension                      0.18678    
## copd                              0.29407    
## diabetes                          0.12652    
## cancer                            0.80203    
## renal                             0.65076    
## parkinson                         0.35281    
## depression                        0.35044    
## rheumatoid                        0.61302    
## death                           < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smk_excess                        1.06644    0.93770   0.93445   1.21708
## age_bin2.Age>= 75                 1.47765    0.67675   1.29446   1.68678
## bmd_bin2.BMD<= -2.5               2.57219    0.38877   2.09261   3.16168
## fall_bin2.Falls 1+                1.36014    0.73522   1.18349   1.56314
## fx50_bin2.Fx 1+                   1.59089    0.62858   1.38231   1.83094
## drink_bin2.Excessive drinking     1.05916    0.94414   0.93136   1.20450
## activity_bin2.Less active         0.99433    1.00571   0.86665   1.14082
## calci_bin2.Insufficient Calcium   0.93872    1.06529   0.79920   1.10259
## protein2                          0.99676    1.00325   0.99410   0.99943
## education                         1.00574    0.99429   0.96833   1.04459
## BMI                               0.99272    1.00733   0.97622   1.00950
## cvd                               1.09857    0.91027   0.94537   1.27660
## hypertension                      1.08733    0.91968   0.96023   1.23126
## copd                              1.10725    0.90314   0.91537   1.33935
## diabetes                          1.16778    0.85633   0.95710   1.42484
## cancer                            1.02024    0.98016   0.87230   1.19328
## renal                             1.05944    0.94390   0.82511   1.36031
## parkinson                         0.89484    1.11752   0.70788   1.13118
## depression                        1.14223    0.87548   0.86402   1.51003
## rheumatoid                        0.96873    1.03228   0.85653   1.09563
## death                             1.82338    0.54843   1.58355   2.09953
## 
## Concordance= 0.658  (se = 0.009 )
## Likelihood ratio test= 356.6  on 21 df,   p=<2e-16
## Wald test            = 384.17  on 21 df,   p=<2e-16
## Score (logrank) test = 411.03  on 21 df,   p=<2e-16
EXploratory analysis with quintiles of cigarette packyears:
men.smk = men.smk %>% mutate(quin.packyrs = case_when(smoke_packyrs == 0 ~ 1,
                                                      smoke_packyrs > 0 & smoke_packyrs<= 9.75 ~ 2,
                                                      smoke_packyrs > 9.75 & smoke_packyrs<= 22.5 ~ 3,
                                                      smoke_packyrs > 22.5 & smoke_packyrs<= 42 ~ 4,
                                                      smoke_packyrs > 42 ~ 5))
table(men.smk$quin.packyrs)
## 
##    1    2    3    4    5 
## 2272  935  943  926  916
# Any fracture:
km_quin = survfit(Surv(fu_anyfx, anyfx) ~ as.factor(quin.packyrs), data = men.smk)
autoplot(km_quin)

any.quin.age = coxph(Surv(fu_anyfx, anyfx) ~  as.factor(quin.packyrs) + age, data = men.smk)
summary(any.quin.age)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(quin.packyrs) + 
##     age, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                               coef exp(coef)  se(coef)       z  Pr(>|z|)    
## as.factor(quin.packyrs)2 0.0876029 1.0915546 0.0890597  0.9836  0.325292    
## as.factor(quin.packyrs)3 0.0042472 1.0042562 0.0928972  0.0457  0.963534    
## as.factor(quin.packyrs)4 0.1021626 1.1075635 0.0924205  1.1054  0.268982    
## as.factor(quin.packyrs)5 0.2709893 1.3112611 0.0930155  2.9134  0.003575 ** 
## age                      0.0734825 1.0762497 0.0053976 13.6140 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                          exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2    1.0916    0.91612   0.91672    1.2997
## as.factor(quin.packyrs)3    1.0043    0.99576   0.83709    1.2048
## as.factor(quin.packyrs)4    1.1076    0.90288   0.92406    1.3275
## as.factor(quin.packyrs)5    1.3113    0.76262   1.09273    1.5735
## age                         1.0762    0.92915   1.06492    1.0877
## 
## Concordance= 0.617  (se = 0.009 )
## Likelihood ratio test= 182.97  on 5 df,   p=<2e-16
## Wald test            = 190.55  on 5 df,   p=<2e-16
## Score (logrank) test = 194.51  on 5 df,   p=<2e-16
any.quin.all1 = coxph(Surv(fu_anyfx, anyfx) ~  as.factor(quin.packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(any.quin.all1)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(quin.packyrs) + 
##     age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                               coef exp(coef)  se(coef)       z  Pr(>|z|)    
## as.factor(quin.packyrs)2  0.058016  1.059732  0.089193  0.6505    0.5154    
## as.factor(quin.packyrs)3 -0.021282  0.978943  0.092970 -0.2289    0.8189    
## as.factor(quin.packyrs)4  0.086258  1.090087  0.092327  0.9343    0.3502    
## as.factor(quin.packyrs)5  0.212106  1.236279  0.092951  2.2819    0.0225 *  
## age_bin2.Age>= 75         0.602637  1.826929  0.062838  9.5903 < 2.2e-16 ***
## bmd_bin2.BMD<= -2.5       0.949908  2.585471  0.102922  9.2294 < 2.2e-16 ***
## fall_bin2.Falls 1+        0.332044  1.393814  0.069846  4.7540 1.995e-06 ***
## fx50_bin2.Fx 1+           0.470388  1.600615  0.071519  6.5771 4.798e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                          exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2   1.05973    0.94363   0.88976    1.2622
## as.factor(quin.packyrs)3   0.97894    1.02151   0.81587    1.1746
## as.factor(quin.packyrs)4   1.09009    0.91736   0.90965    1.3063
## as.factor(quin.packyrs)5   1.23628    0.80888   1.03038    1.4833
## age_bin2.Age>= 75          1.82693    0.54737   1.61523    2.0664
## bmd_bin2.BMD<= -2.5        2.58547    0.38678   2.11316    3.1633
## fall_bin2.Falls 1+         1.39381    0.71746   1.21549    1.5983
## fx50_bin2.Fx 1+            1.60062    0.62476   1.39126    1.8415
## 
## Concordance= 0.638  (se = 0.009 )
## Likelihood ratio test= 262.76  on 8 df,   p=<2e-16
## Wald test            = 302.94  on 8 df,   p=<2e-16
## Score (logrank) test = 322.58  on 8 df,   p=<2e-16
any.quin.all2 = coxph(Surv(fu_anyfx, anyfx) ~  as.factor(quin.packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(any.quin.all2)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(quin.packyrs) + 
##     age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                                       coef  exp(coef)   se(coef)       z
## as.factor(quin.packyrs)2         0.0610249  1.0629254  0.0896012  0.6811
## as.factor(quin.packyrs)3        -0.0474907  0.9536193  0.0941722 -0.5043
## as.factor(quin.packyrs)4         0.0399628  1.0407720  0.0944648  0.4230
## as.factor(quin.packyrs)5         0.0958893  1.1006373  0.0981833  0.9766
## age_bin2.Age>= 75                0.3906955  1.4780084  0.0677667  5.7653
## bmd_bin2.BMD<= -2.5              0.9427803  2.5671089  0.1053341  8.9504
## fall_bin2.Falls 1+               0.3081181  1.3608617  0.0710082  4.3392
## fx50_bin2.Fx 1+                  0.4628684  1.5886243  0.0717840  6.4481
## drink_bin2.Excessive drinking    0.0604816  1.0623480  0.0660143  0.9162
## activity_bin2.Less active       -0.0073629  0.9926642  0.0701762 -0.1049
## calci_bin2.Insufficient Calcium -0.0613045  0.9405368  0.0820946 -0.7468
## protein2                        -0.0032693  0.9967360  0.0013671 -2.3915
## education                        0.0058054  1.0058223  0.0194313  0.2988
## BMI                             -0.0071030  0.9929221  0.0085600 -0.8298
## cvd                              0.0925418  1.0969590  0.0766792  1.2069
## hypertension                     0.0840385  1.0876707  0.0634861  1.3237
## copd                             0.1001812  1.1053712  0.0976131  1.0263
## diabetes                         0.1550746  1.1677450  0.1015824  1.5266
## cancer                           0.0197949  1.0199921  0.0799457  0.2476
## renal                            0.0545193  1.0560329  0.1275933  0.4273
## parkinson                       -0.1108593  0.8950647  0.1196176 -0.9268
## depression                       0.1344636  1.1439230  0.1424222  0.9441
## rheumatoid                      -0.0310043  0.9694714  0.0628419 -0.4934
## death                            0.6000047  1.8221273  0.0721708  8.3137
##                                  Pr(>|z|)    
## as.factor(quin.packyrs)2          0.49583    
## as.factor(quin.packyrs)3          0.61405    
## as.factor(quin.packyrs)4          0.67226    
## as.factor(quin.packyrs)5          0.32875    
## age_bin2.Age>= 75               8.151e-09 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              1.430e-05 ***
## fx50_bin2.Fx 1+                 1.133e-10 ***
## drink_bin2.Excessive drinking     0.35957    
## activity_bin2.Less active         0.91644    
## calci_bin2.Insufficient Calcium   0.45521    
## protein2                          0.01678 *  
## education                         0.76512    
## BMI                               0.40666    
## cvd                               0.22748    
## hypertension                      0.18559    
## copd                              0.30475    
## diabetes                          0.12686    
## cancer                            0.80444    
## renal                             0.66917    
## parkinson                         0.35404    
## depression                        0.34511    
## rheumatoid                        0.62175    
## death                           < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2          1.06293    0.94080   0.89173   1.26699
## as.factor(quin.packyrs)3          0.95362    1.04864   0.79289   1.14692
## as.factor(quin.packyrs)4          1.04077    0.96083   0.86486   1.25246
## as.factor(quin.packyrs)5          1.10064    0.90856   0.90797   1.33419
## age_bin2.Age>= 75                 1.47801    0.67659   1.29418   1.68795
## bmd_bin2.BMD<= -2.5               2.56711    0.38954   2.08826   3.15577
## fall_bin2.Falls 1+                1.36086    0.73483   1.18405   1.56407
## fx50_bin2.Fx 1+                   1.58862    0.62948   1.38013   1.82862
## drink_bin2.Excessive drinking     1.06235    0.94131   0.93342   1.20909
## activity_bin2.Less active         0.99266    1.00739   0.86510   1.13903
## calci_bin2.Insufficient Calcium   0.94054    1.06322   0.80075   1.10473
## protein2                          0.99674    1.00327   0.99407   0.99941
## education                         1.00582    0.99421   0.96824   1.04487
## BMI                               0.99292    1.00713   0.97640   1.00972
## cvd                               1.09696    0.91161   0.94389   1.27485
## hypertension                      1.08767    0.91940   0.96041   1.23179
## copd                              1.10537    0.90467   0.91289   1.33843
## diabetes                          1.16775    0.85635   0.95693   1.42500
## cancer                            1.01999    0.98040   0.87206   1.19302
## renal                             1.05603    0.94694   0.82237   1.35608
## parkinson                         0.89506    1.11724   0.70800   1.13155
## depression                        1.14392    0.87418   0.86530   1.51226
## rheumatoid                        0.96947    1.03149   0.85712   1.09654
## death                             1.82213    0.54881   1.58178   2.09899
## 
## Concordance= 0.659  (se = 0.009 )
## Likelihood ratio test= 357.78  on 24 df,   p=<2e-16
## Wald test            = 385.3  on 24 df,   p=<2e-16
## Score (logrank) test = 412.24  on 24 df,   p=<2e-16
# Hip fracture:
hip_km_quin = survfit(Surv(fu_hipfx, hipfx) ~ as.factor(quin.packyrs), data = men.smk)
autoplot(hip_km_quin)

hip.quin.age = coxph(Surv(fu_hipfx, hipfx) ~  as.factor(quin.packyrs) + age, data = men.smk)
summary(hip.quin.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(quin.packyrs) + 
##     age, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                               coef exp(coef)  se(coef)       z Pr(>|z|)    
## as.factor(quin.packyrs)2  0.017392  1.017544  0.187380  0.0928  0.92605    
## as.factor(quin.packyrs)3 -0.390401  0.676786  0.223967 -1.7431  0.08131 .  
## as.factor(quin.packyrs)4  0.066723  1.068999  0.199719  0.3341  0.73832    
## as.factor(quin.packyrs)5  0.371516  1.449931  0.190161  1.9537  0.05074 .  
## age                       0.135814  1.145469  0.011344 11.9722  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                          exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2   1.01754    0.98276   0.70478    1.4691
## as.factor(quin.packyrs)3   0.67679    1.47757   0.43632    1.0498
## as.factor(quin.packyrs)4   1.06900    0.93545   0.72273    1.5812
## as.factor(quin.packyrs)5   1.44993    0.68969   0.99881    2.1048
## age                        1.14547    0.87300   1.12028    1.1712
## 
## Concordance= 0.728  (se = 0.016 )
## Likelihood ratio test= 145.75  on 5 df,   p=<2e-16
## Wald test            = 150.29  on 5 df,   p=<2e-16
## Score (logrank) test = 160.51  on 5 df,   p=<2e-16
hip.quin.all1 = coxph(Surv(fu_hipfx, hipfx) ~  as.factor(quin.packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip.quin.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(quin.packyrs) + 
##     age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                               coef exp(coef)  se(coef)       z  Pr(>|z|)    
## as.factor(quin.packyrs)2 -0.010548  0.989507  0.187625 -0.0562   0.95517    
## as.factor(quin.packyrs)3 -0.404335  0.667420  0.224038 -1.8048   0.07111 .  
## as.factor(quin.packyrs)4  0.016334  1.016468  0.199265  0.0820   0.93467    
## as.factor(quin.packyrs)5  0.274243  1.315534  0.189902  1.4441   0.14870    
## age_bin2.Age>= 75         1.110522  3.035942  0.138323  8.0285  9.87e-16 ***
## bmd_bin2.BMD<= -2.5       1.569289  4.803232  0.167816  9.3512 < 2.2e-16 ***
## fall_bin2.Falls 1+        0.331826  1.393510  0.147716  2.2464   0.02468 *  
## fx50_bin2.Fx 1+           0.252012  1.286612  0.157004  1.6051   0.10846    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                          exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2   0.98951    1.01060   0.68503    1.4293
## as.factor(quin.packyrs)3   0.66742    1.49831   0.43023    1.0354
## as.factor(quin.packyrs)4   1.01647    0.98380   0.68783    1.5021
## as.factor(quin.packyrs)5   1.31553    0.76015   0.90669    1.9087
## age_bin2.Age>= 75          3.03594    0.32939   2.31501    3.9814
## bmd_bin2.BMD<= -2.5        4.80323    0.20819   3.45691    6.6739
## fall_bin2.Falls 1+         1.39351    0.71761   1.04322    1.8614
## fx50_bin2.Fx 1+            1.28661    0.77724   0.94581    1.7502
## 
## Concordance= 0.737  (se = 0.017 )
## Likelihood ratio test= 169.3  on 8 df,   p=<2e-16
## Wald test            = 203.15  on 8 df,   p=<2e-16
## Score (logrank) test = 255.08  on 8 df,   p=<2e-16
hip.quin.all2 = coxph(Surv(fu_hipfx, hipfx) ~  as.factor(quin.packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(hip.quin.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(quin.packyrs) + 
##     age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                       coef  exp(coef)   se(coef)       z
## as.factor(quin.packyrs)2        -0.0077329  0.9922969  0.1889085 -0.0409
## as.factor(quin.packyrs)3        -0.4257446  0.6532832  0.2268768 -1.8765
## as.factor(quin.packyrs)4        -0.0171095  0.9830360  0.2037235 -0.0840
## as.factor(quin.packyrs)5         0.1340713  1.1434743  0.2020525  0.6635
## age_bin2.Age>= 75                0.7532487  2.1238888  0.1483915  5.0761
## bmd_bin2.BMD<= -2.5              1.4764803  4.3775109  0.1753594  8.4197
## fall_bin2.Falls 1+               0.2965626  1.3452268  0.1500106  1.9769
## fx50_bin2.Fx 1+                  0.2464051  1.2794178  0.1575451  1.5640
## drink_bin2.Excessive drinking   -0.2742804  0.7601189  0.1522204 -1.8019
## activity_bin2.Less active        0.1519000  1.1640438  0.1593264  0.9534
## calci_bin2.Insufficient Calcium -0.0476843  0.9534348  0.1783006 -0.2674
## protein2                        -0.0024239  0.9975790  0.0029674 -0.8169
## education                       -0.0319701  0.9685355  0.0410879 -0.7781
## BMI                             -0.0302729  0.9701807  0.0184090 -1.6445
## cvd                              0.2484717  1.2820646  0.1538211  1.6153
## hypertension                     0.4457491  1.5616596  0.1349507  3.3031
## copd                            -0.1092333  0.8965212  0.2172074 -0.5029
## diabetes                         0.0325410  1.0330762  0.2221281  0.1465
## cancer                          -0.0640654  0.9379436  0.1722674 -0.3719
## renal                           -0.3398806  0.7118553  0.2681345 -1.2676
## parkinson                        0.3518289  1.4216653  0.2245056  1.5671
## depression                       0.0997464  1.1048907  0.2999141  0.3326
## rheumatoid                       0.0777146  1.0808142  0.1346409  0.5772
## death                            0.9137172  2.4935744  0.1681286  5.4346
##                                  Pr(>|z|)    
## as.factor(quin.packyrs)2        0.9673481    
## as.factor(quin.packyrs)3        0.0605805 .  
## as.factor(quin.packyrs)4        0.9330691    
## as.factor(quin.packyrs)5        0.5069804    
## age_bin2.Age>= 75               3.853e-07 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+              0.0480479 *  
## fx50_bin2.Fx 1+                 0.1178108    
## drink_bin2.Excessive drinking   0.0715668 .  
## activity_bin2.Less active       0.3403933    
## calci_bin2.Insufficient Calcium 0.7891323    
## protein2                        0.4140140    
## education                       0.4365155    
## BMI                             0.1000808    
## cvd                             0.1062393    
## hypertension                    0.0009564 ***
## copd                            0.6150355    
## diabetes                        0.8835294    
## cancer                          0.7099709    
## renal                           0.2049497    
## parkinson                       0.1170849    
## depression                      0.7394489    
## rheumatoid                      0.5638049    
## death                           5.491e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## as.factor(quin.packyrs)2          0.99230    1.00776   0.68524    1.4369
## as.factor(quin.packyrs)3          0.65328    1.53073   0.41878    1.0191
## as.factor(quin.packyrs)4          0.98304    1.01726   0.65942    1.4655
## as.factor(quin.packyrs)5          1.14347    0.87453   0.76955    1.6991
## age_bin2.Age>= 75                 2.12389    0.47083   1.58789    2.8408
## bmd_bin2.BMD<= -2.5               4.37751    0.22844   3.10428    6.1730
## fall_bin2.Falls 1+                1.34523    0.74337   1.00255    1.8050
## fx50_bin2.Fx 1+                   1.27942    0.78161   0.93953    1.7423
## drink_bin2.Excessive drinking     0.76012    1.31558   0.56404    1.0244
## activity_bin2.Less active         1.16404    0.85907   0.85183    1.5907
## calci_bin2.Insufficient Calcium   0.95343    1.04884   0.67224    1.3523
## protein2                          0.99758    1.00243   0.99179    1.0034
## education                         0.96854    1.03249   0.89360    1.0498
## BMI                               0.97018    1.03074   0.93580    1.0058
## cvd                               1.28206    0.77999   0.94837    1.7332
## hypertension                      1.56166    0.64034   1.19872    2.0345
## copd                              0.89652    1.11542   0.58570    1.3723
## diabetes                          1.03308    0.96798   0.66843    1.5966
## cancer                            0.93794    1.06616   0.66918    1.3147
## renal                             0.71186    1.40478   0.42088    1.2040
## parkinson                         1.42167    0.70340   0.91558    2.2075
## depression                        1.10489    0.90507   0.61381    1.9889
## rheumatoid                        1.08081    0.92523   0.83013    1.4072
## death                             2.49357    0.40103   1.79354    3.4668
## 
## Concordance= 0.78  (se = 0.015 )
## Likelihood ratio test= 234.18  on 24 df,   p=<2e-16
## Wald test            = 255.52  on 24 df,   p=<2e-16
## Score (logrank) test = 316.72  on 24 df,   p=<2e-16
Association for hip fracture
# Prevalence:
table1(~ age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin + fx50_bin + smoke_packyrs + as.factor(smk_excess) + drink_bin + activity_bin | hipfx, data = men.smk, render.continuous = c(. = "Mean (SD)", . = "Median [Q1, Q3]"))
## Warning in table1.formula(~age + age_bin + fnbmd + Tscore + bmd_bin + fall_bin
## + : Terms to the right of '|' in formula 'x' define table columns and are
## expected to be factors with meaningful labels.
0
(N=5755)
1
(N=237)
Overall
(N=5992)
age
Mean (SD) 73.5 (5.84) 76.4 (6.09) 73.7 (5.87)
Median [Q1, Q3] 73.0 [69.0, 78.0] 76.0 [72.0, 80.0] 73.0 [69.0, 78.0]
age_bin
1.Age< 75 3384 (58.8%) 92 (38.8%) 3476 (58.0%)
2.Age>= 75 2371 (41.2%) 145 (61.2%) 2516 (42.0%)
fnbmd
Mean (SD) 0.788 (0.127) 0.689 (0.115) 0.784 (0.128)
Median [Q1, Q3] 0.778 [0.701, 0.863] 0.671 [0.605, 0.752] 0.774 [0.696, 0.860]
Tscore
Mean (SD) -1.06 (0.928) -1.79 (0.843) -1.09 (0.935)
Median [Q1, Q3] -1.14 [-1.70, -0.519] -1.92 [-2.40, -1.33] -1.17 [-1.73, -0.539]
bmd_bin
1.BMD> -2.5 5506 (95.7%) 191 (80.6%) 5697 (95.1%)
2.BMD<= -2.5 249 (4.3%) 46 (19.4%) 295 (4.9%)
fall_bin
1.No falls 4552 (79.1%) 173 (73.0%) 4725 (78.9%)
2.Falls 1+ 1203 (20.9%) 64 (27.0%) 1267 (21.1%)
fx50_bin
1.No fx 4778 (83.0%) 183 (77.2%) 4961 (82.8%)
2.Fx 1+ 977 (17.0%) 54 (22.8%) 1031 (17.2%)
smoke_packyrs
Mean (SD) 18.1 (24.6) 17.6 (25.3) 18.1 (24.6)
Median [Q1, Q3] 7.05 [0, 29.0] 3.00 [0, 29.3] 7.00 [0, 29.0]
as.factor(smk_excess)
0 3784 (65.8%) 156 (65.8%) 3940 (65.8%)
1 1971 (34.2%) 81 (34.2%) 2052 (34.2%)
drink_bin
1.Less drinking 3867 (67.2%) 175 (73.8%) 4042 (67.5%)
2.Excessive drinking 1888 (32.8%) 62 (26.2%) 1950 (32.5%)
activity_bin
1.Proactive 1492 (25.9%) 53 (22.4%) 1545 (25.8%)
2.Less active 4263 (74.1%) 184 (77.6%) 4447 (74.2%)
# Association with No.pack-years:
hip.packyr.age = coxph(Surv(fu_hipfx, hipfx) ~  smoke_packyrs + age, data = men.smk)
summary(hip.packyr.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_packyrs + age, 
##     data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                    coef exp(coef)  se(coef)       z Pr(>|z|)    
## smoke_packyrs 0.0052532 1.0052670 0.0026812  1.9593  0.05008 .  
## age           0.1363256 1.1460550 0.0112991 12.0652  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs    1.0053    0.99476     1.000    1.0106
## age              1.1461    0.87256     1.121    1.1717
## 
## Concordance= 0.723  (se = 0.016 )
## Likelihood ratio test= 140.09  on 2 df,   p=<2e-16
## Wald test            = 145.98  on 2 df,   p=<2e-16
## Score (logrank) test = 155.31  on 2 df,   p=<2e-16
hip.packyr.all1 = coxph(Surv(fu_hipfx, hipfx) ~  smoke_packyrs + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip.packyr.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_packyrs + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                          coef exp(coef)  se(coef)      z  Pr(>|z|)    
## smoke_packyrs       0.0042320 1.0042410 0.0026998 1.5675   0.11699    
## age_bin2.Age>= 75   1.1191695 3.0623100 0.1383152 8.0914 5.896e-16 ***
## bmd_bin2.BMD<= -2.5 1.5801484 4.8556765 0.1679869 9.4064 < 2.2e-16 ***
## fall_bin2.Falls 1+  0.3272941 1.3872094 0.1476993 2.2159   0.02669 *  
## fx50_bin2.Fx 1+     0.2479865 1.2814427 0.1570552 1.5790   0.11434    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs          1.0042    0.99578   0.99894    1.0096
## age_bin2.Age>= 75      3.0623    0.32655   2.33515    4.0159
## bmd_bin2.BMD<= -2.5    4.8557    0.20594   3.49349    6.7490
## fall_bin2.Falls 1+     1.3872    0.72087   1.03853    1.8530
## fx50_bin2.Fx 1+        1.2814    0.78037   0.94192    1.7434
## 
## Concordance= 0.726  (se = 0.018 )
## Likelihood ratio test= 164.28  on 5 df,   p=<2e-16
## Wald test            = 199.39  on 5 df,   p=<2e-16
## Score (logrank) test = 250.91  on 5 df,   p=<2e-16
hip.packyr.all2 = coxph(Surv(fu_hipfx, hipfx) ~  smoke_packyrs + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(hip.packyr.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smoke_packyrs + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke_packyrs                    0.0025955  1.0025989  0.0028672  0.9052
## age_bin2.Age>= 75                0.7686095  2.1567652  0.1480240  5.1925
## bmd_bin2.BMD<= -2.5              1.4824707  4.4038126  0.1750178  8.4704
## fall_bin2.Falls 1+               0.2879961  1.3337522  0.1500882  1.9188
## fx50_bin2.Fx 1+                  0.2418719  1.2736310  0.1574717  1.5360
## drink_bin2.Excessive drinking   -0.3017210  0.7395444  0.1512295 -1.9951
## activity_bin2.Less active        0.1525109  1.1647552  0.1592326  0.9578
## calci_bin2.Insufficient Calcium -0.0539710  0.9474595  0.1783150 -0.3027
## protein2                        -0.0022535  0.9977490  0.0029624 -0.7607
## education                       -0.0272649  0.9731034  0.0409533 -0.6658
## BMI                             -0.0306834  0.9697826  0.0183208 -1.6748
## cvd                              0.2535132  1.2885445  0.1536105  1.6504
## hypertension                     0.4319385  1.5402404  0.1346891  3.2069
## copd                            -0.1049585  0.9003619  0.2166311 -0.4845
## diabetes                         0.0394556  1.0402443  0.2217127  0.1780
## cancer                          -0.0615283  0.9403263  0.1722850 -0.3571
## renal                           -0.3425194  0.7099793  0.2679567 -1.2783
## parkinson                        0.3548854  1.4260172  0.2243360  1.5819
## depression                       0.0932486  1.0977346  0.2997711  0.3111
## rheumatoid                       0.0708944  1.0734678  0.1344589  0.5273
## death                            0.9130339  2.4918712  0.1678226  5.4405
##                                  Pr(>|z|)    
## smoke_packyrs                    0.365341    
## age_bin2.Age>= 75               2.075e-07 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+               0.055004 .  
## fx50_bin2.Fx 1+                  0.124546    
## drink_bin2.Excessive drinking    0.046030 *  
## activity_bin2.Less active        0.338170    
## calci_bin2.Insufficient Calcium  0.762140    
## protein2                         0.446838    
## education                        0.505567    
## BMI                              0.093976 .  
## cvd                              0.098868 .  
## hypertension                     0.001342 ** 
## copd                             0.628029    
## diabetes                         0.858756    
## cancer                           0.720994    
## renal                            0.201156    
## parkinson                        0.113664    
## depression                       0.755750    
## rheumatoid                       0.598015    
## death                           5.314e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke_packyrs                     1.00260    0.99741   0.99698    1.0082
## age_bin2.Age>= 75                 2.15677    0.46366   1.61363    2.8827
## bmd_bin2.BMD<= -2.5               4.40381    0.22708   3.12502    6.2059
## fall_bin2.Falls 1+                1.33375    0.74976   0.99385    1.7899
## fx50_bin2.Fx 1+                   1.27363    0.78516   0.93541    1.7341
## drink_bin2.Excessive drinking     0.73954    1.35218   0.54984    0.9947
## activity_bin2.Less active         1.16476    0.85855   0.85250    1.5914
## calci_bin2.Insufficient Calcium   0.94746    1.05545   0.66800    1.3438
## protein2                          0.99775    1.00226   0.99197    1.0036
## education                         0.97310    1.02764   0.89805    1.0544
## BMI                               0.96978    1.03116   0.93558    1.0052
## cvd                               1.28854    0.77607   0.95356    1.7412
## hypertension                      1.54024    0.64925   1.18288    2.0056
## copd                              0.90036    1.11066   0.58887    1.3766
## diabetes                          1.04024    0.96131   0.67362    1.6064
## cancer                            0.94033    1.06346   0.67086    1.3180
## renal                             0.70998    1.40849   0.41991    1.2004
## parkinson                         1.42602    0.70125   0.91869    2.2135
## depression                        1.09773    0.91097   0.61000    1.9754
## rheumatoid                        1.07347    0.93156   0.82478    1.3971
## death                             2.49187    0.40130   1.79339    3.4624
## 
## Concordance= 0.776  (se = 0.015 )
## Likelihood ratio test= 229.49  on 21 df,   p=<2e-16
## Wald test            = 251.27  on 21 df,   p=<2e-16
## Score (logrank) test = 312.9  on 21 df,   p=<2e-16
# Association with excess smoking:
hip.excess.age = coxph(Surv(fu_hipfx, hipfx) ~  smk_excess + age, data = men.smk)
summary(hip.excess.age)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smk_excess + age, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##               coef exp(coef) se(coef)       z Pr(>|z|)    
## smk_excess 0.25025   1.28435  0.13783  1.8156  0.06943 .  
## age        0.13617   1.14588  0.01131 12.0398  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##            exp(coef) exp(-coef) lower .95 upper .95
## smk_excess    1.2843    0.77861    0.9803    1.6827
## age           1.1459    0.87269    1.1208    1.1716
## 
## Concordance= 0.722  (se = 0.016 )
## Likelihood ratio test= 139.74  on 2 df,   p=<2e-16
## Wald test            = 145.25  on 2 df,   p=<2e-16
## Score (logrank) test = 154.95  on 2 df,   p=<2e-16
hip.excess.all1 = coxph(Surv(fu_hipfx, hipfx) ~  smk_excess + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk)
summary(hip.excess.all1)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smk_excess + age_bin + 
##     bmd_bin + fall_bin + fx50_bin, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                        coef exp(coef) se(coef)      z  Pr(>|z|)    
## smk_excess          0.19240   1.21215  0.13738 1.4005   0.16136    
## age_bin2.Age>= 75   1.11510   3.04987  0.13820 8.0689 7.093e-16 ***
## bmd_bin2.BMD<= -2.5 1.57844   4.84737  0.16801 9.3951 < 2.2e-16 ***
## fall_bin2.Falls 1+  0.32943   1.39018  0.14771 2.2303   0.02573 *  
## fx50_bin2.Fx 1+     0.24917   1.28296  0.15709 1.5862   0.11270    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## smk_excess             1.2122    0.82498   0.92602    1.5867
## age_bin2.Age>= 75      3.0499    0.32788   2.32620    3.9987
## bmd_bin2.BMD<= -2.5    4.8474    0.20630   3.48738    6.7377
## fall_bin2.Falls 1+     1.3902    0.71933   1.04074    1.8570
## fx50_bin2.Fx 1+        1.2830    0.77945   0.94297    1.7455
## 
## Concordance= 0.729  (se = 0.017 )
## Likelihood ratio test= 163.89  on 5 df,   p=<2e-16
## Wald test            = 199.24  on 5 df,   p=<2e-16
## Score (logrank) test = 250.6  on 5 df,   p=<2e-16
hip.excess.all2 = coxph(Surv(fu_hipfx, hipfx) ~  smk_excess + age_bin + bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + calci_bin + protein2 + education + BMI + cvd + hypertension + copd + diabetes + cancer + renal + parkinson + depression + rheumatoid + death, data = men.smk)
summary(hip.excess.all2)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ smk_excess + age_bin + 
##     bmd_bin + fall_bin + fx50_bin + drink_bin + activity_bin + 
##     calci_bin + protein2 + education + BMI + cvd + hypertension + 
##     copd + diabetes + cancer + renal + parkinson + depression + 
##     rheumatoid + death, data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                                       coef  exp(coef)   se(coef)       z
## smk_excess                       0.1258583  1.1341215  0.1439466  0.8743
## age_bin2.Age>= 75                0.7642097  2.1472968  0.1475123  5.1807
## bmd_bin2.BMD<= -2.5              1.4815682  4.3998401  0.1750314  8.4646
## fall_bin2.Falls 1+               0.2879610  1.3337052  0.1501200  1.9182
## fx50_bin2.Fx 1+                  0.2423852  1.2742850  0.1574776  1.5392
## drink_bin2.Excessive drinking   -0.3010834  0.7400161  0.1512290 -1.9909
## activity_bin2.Less active        0.1547754  1.1673957  0.1591672  0.9724
## calci_bin2.Insufficient Calcium -0.0535837  0.9478266  0.1782880 -0.3005
## protein2                        -0.0022177  0.9977847  0.0029595 -0.7494
## education                       -0.0277586  0.9726231  0.0409180 -0.6784
## BMI                             -0.0308416  0.9696291  0.0183385 -1.6818
## cvd                              0.2547328  1.2901169  0.1535478  1.6590
## hypertension                     0.4304534  1.5379547  0.1347311  3.1949
## copd                            -0.0985056  0.9061906  0.2155987 -0.4569
## diabetes                         0.0423579  1.0432678  0.2215286  0.1912
## cancer                          -0.0584386  0.9432362  0.1722641 -0.3392
## renal                           -0.3424385  0.7100368  0.2679153 -1.2782
## parkinson                        0.3537174  1.4243527  0.2242661  1.5772
## depression                       0.0897282  1.0938769  0.2998600  0.2992
## rheumatoid                       0.0697488  1.0722388  0.1345492  0.5184
## death                            0.9157343  2.4986094  0.1676026  5.4637
##                                  Pr(>|z|)    
## smk_excess                       0.381933    
## age_bin2.Age>= 75               2.211e-07 ***
## bmd_bin2.BMD<= -2.5             < 2.2e-16 ***
## fall_bin2.Falls 1+               0.055085 .  
## fx50_bin2.Fx 1+                  0.123762    
## drink_bin2.Excessive drinking    0.046491 *  
## activity_bin2.Less active        0.330848    
## calci_bin2.Insufficient Calcium  0.763761    
## protein2                         0.453634    
## education                        0.497521    
## BMI                              0.092609 .  
## cvd                              0.097120 .  
## hypertension                     0.001399 ** 
## copd                             0.647748    
## diabetes                         0.848363    
## cancer                           0.734430    
## renal                            0.201193    
## parkinson                        0.114744    
## depression                       0.764762    
## rheumatoid                       0.604187    
## death                           4.663e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smk_excess                        1.13412    0.88174   0.85533   1.50379
## age_bin2.Age>= 75                 2.14730    0.46570   1.60816   2.86718
## bmd_bin2.BMD<= -2.5               4.39984    0.22728   3.12212   6.20046
## fall_bin2.Falls 1+                1.33371    0.74979   0.99375   1.78996
## fx50_bin2.Fx 1+                   1.27428    0.78475   0.93588   1.73505
## drink_bin2.Excessive drinking     0.74002    1.35132   0.55019   0.99533
## activity_bin2.Less active         1.16740    0.85661   0.85454   1.59478
## calci_bin2.Insufficient Calcium   0.94783    1.05505   0.66830   1.34427
## protein2                          0.99778    1.00222   0.99201   1.00359
## education                         0.97262    1.02815   0.89767   1.05384
## BMI                               0.96963    1.03132   0.93540   1.00511
## cvd                               1.29012    0.77512   0.95484   1.74313
## hypertension                      1.53795    0.65021   1.18103   2.00275
## copd                              0.90619    1.10352   0.59388   1.38273
## diabetes                          1.04327    0.95853   0.67582   1.61050
## cancer                            0.94324    1.06018   0.67296   1.32206
## renal                             0.71004    1.40838   0.41998   1.20041
## parkinson                         1.42435    0.70207   0.91774   2.21062
## depression                        1.09388    0.91418   0.60775   1.96884
## rheumatoid                        1.07224    0.93263   0.82369   1.39579
## death                             2.49861    0.40022   1.79901   3.47026
## 
## Concordance= 0.776  (se = 0.015 )
## Likelihood ratio test= 229.45  on 21 df,   p=<2e-16
## Wald test            = 251.46  on 21 df,   p=<2e-16
## Score (logrank) test = 312.98  on 21 df,   p=<2e-16

Exploratory - Patterns of association between No. pack-years and fracture risk

library(smoothHR)
## Loading required package: splines
# Any fracture
fit = coxph(Surv(fu_anyfx, anyfx) ~  pspline(smoke_packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk, x = TRUE)
hr1 = smoothHR(data = men.smk, coxfit = fit)
plot(hr1, predictor = "smoke_packyrs", xlim = c(0, 150), ref.label = "Ref")

# Hip fracture
fit2 = coxph(Surv(fu_hipfx, hipfx) ~  pspline(smoke_packyrs) + age_bin + bmd_bin + fall_bin + fx50_bin, data = men.smk, x = TRUE)
hr2 = smoothHR(data = men.smk, coxfit = fit2)
## Warning: a global p-value of  0.046582968 was obtained when testing the proportional hazards assumption
plot(hr2, predictor = "smoke_packyrs", xlim = c(0, 150), ref.label = "Ref")

(3.2.2) Combination of risk factors

Data management

men.smk = men.smk %>% mutate(ex.group = case_when(age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 1,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 2,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 3,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 4,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 5,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 6,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 7,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 8,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 9,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 10,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 11,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 12,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 13,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 14,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 15,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 16,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 0 ~ 17,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 18,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 19,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 20,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 21,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 22,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 23,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 24,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 25,
                                       age_bin == "1.Age< 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 26,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 0 ~ 27,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "1.No fx" & smk_excess == 1 ~ 28,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "1.No falls" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 29,
                                       age_bin == "2.Age>= 75" & bmd_bin == "1.BMD> -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 30,
                                       age_bin == "1.Age< 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 31,
                                       age_bin == "2.Age>= 75" & bmd_bin == "2.BMD<= -2.5" & fall_bin == "2.Falls 1+" & fx50_bin == "2.Fx 1+" & smk_excess == 1 ~ 32))
Association for any fracture
table1(~ as.factor(ex.group) | anyfx, data = men.smk)
## Warning in table1.formula(~as.factor(ex.group) | anyfx, data = men.smk): Terms
## to the right of '|' in formula 'x' define table columns and are expected to be
## factors with meaningful labels.
0
(N=4908)
1
(N=1084)
Overall
(N=5992)
as.factor(ex.group)
1 1361 (27.7%) 202 (18.6%) 1563 (26.1%)
2 688 (14.0%) 120 (11.1%) 808 (13.5%)
3 196 (4.0%) 53 (4.9%) 249 (4.2%)
4 254 (5.2%) 53 (4.9%) 307 (5.1%)
5 22 (0.4%) 11 (1.0%) 33 (0.6%)
6 798 (16.3%) 178 (16.4%) 976 (16.3%)
7 52 (1.1%) 19 (1.8%) 71 (1.2%)
8 222 (4.5%) 73 (6.7%) 295 (4.9%)
9 140 (2.9%) 42 (3.9%) 182 (3.0%)
10 418 (8.5%) 74 (6.8%) 492 (8.2%)
11 5 (0.1%) 3 (0.3%) 8 (0.1%)
12 4 (0.1%) 4 (0.4%) 8 (0.1%)
13 23 (0.5%) 7 (0.6%) 30 (0.5%)
14 57 (1.2%) 20 (1.8%) 77 (1.3%)
15 132 (2.7%) 32 (3.0%) 164 (2.7%)
16 114 (2.3%) 39 (3.6%) 153 (2.6%)
17 14 (0.3%) 7 (0.6%) 21 (0.4%)
18 12 (0.2%) 15 (1.4%) 27 (0.5%)
19 21 (0.4%) 13 (1.2%) 34 (0.6%)
20 73 (1.5%) 27 (2.5%) 100 (1.7%)
21 126 (2.6%) 21 (1.9%) 147 (2.5%)
22 64 (1.3%) 16 (1.5%) 80 (1.3%)
23 2 (0.0%) 1 (0.1%) 3 (0.1%)
24 1 (0.0%) 4 (0.4%) 5 (0.1%)
25 4 (0.1%) 2 (0.2%) 6 (0.1%)
26 45 (0.9%) 14 (1.3%) 59 (1.0%)
27 11 (0.2%) 9 (0.8%) 20 (0.3%)
28 4 (0.1%) 3 (0.3%) 7 (0.1%)
29 7 (0.1%) 6 (0.6%) 13 (0.2%)
30 33 (0.7%) 12 (1.1%) 45 (0.8%)
31 1 (0.0%) 2 (0.2%) 3 (0.1%)
32 4 (0.1%) 2 (0.2%) 6 (0.1%)
options(digits = 8)
any.exgrp = coxph(Surv(fu_anyfx, anyfx) ~  as.factor(ex.group), data = men.smk)
summary(any.exgrp)
## Call:
## coxph(formula = Surv(fu_anyfx, anyfx) ~ as.factor(ex.group), 
##     data = men.smk)
## 
##   n= 5992, number of events= 1084 
## 
##                           coef exp(coef) se(coef)      z  Pr(>|z|)    
## as.factor(ex.group)2   0.29944   1.34910  0.11532 2.5965 0.0094168 ** 
## as.factor(ex.group)3   0.52198   1.68536  0.15434 3.3820 0.0007196 ***
## as.factor(ex.group)4   0.34999   1.41905  0.15434 2.2676 0.0233539 *  
## as.factor(ex.group)5   1.08449   2.95792  0.30964 3.5024 0.0004611 ***
## as.factor(ex.group)6   0.78265   2.18725  0.10351 7.5613 3.990e-14 ***
## as.factor(ex.group)7   1.35156   3.86345  0.24034 5.6234 1.872e-08 ***
## as.factor(ex.group)8   1.15994   3.18973  0.13723 8.4523 < 2.2e-16 ***
## as.factor(ex.group)9   1.05838   2.88169  0.17006 6.2235 4.862e-10 ***
## as.factor(ex.group)10  0.65059   1.91668  0.13667 4.7601 1.935e-06 ***
## as.factor(ex.group)11  1.10640   3.02347  0.58163 1.9022 0.0571392 .  
## as.factor(ex.group)12  1.47589   4.37494  0.50495 2.9228 0.0034684 ** 
## as.factor(ex.group)13  0.91495   2.49666  0.38457 2.3792 0.0173515 *  
## as.factor(ex.group)14  0.81047   2.24896  0.23442 3.4573 0.0005456 ***
## as.factor(ex.group)15  0.61916   1.85737  0.19034 3.2529 0.0011422 ** 
## as.factor(ex.group)16  0.92605   2.52451  0.17503 5.2908 1.218e-07 ***
## as.factor(ex.group)17  1.84167   6.30703  0.38506 4.7827 1.729e-06 ***
## as.factor(ex.group)18  2.35189  10.50543  0.26872 8.7523 < 2.2e-16 ***
## as.factor(ex.group)19  1.97998   7.24258  0.28707 6.8973 5.301e-12 ***
## as.factor(ex.group)20  1.52066   4.57525  0.20575 7.3908 1.459e-13 ***
## as.factor(ex.group)21  0.84509   2.32819  0.23005 3.6735 0.0002392 ***
## as.factor(ex.group)22  1.12929   3.09347  0.26030 4.3384 1.435e-05 ***
## as.factor(ex.group)23  0.97116   2.64102  1.00258 0.9687 0.3327108    
## as.factor(ex.group)24  2.91044  18.36482  0.50559 5.7565 8.588e-09 ***
## as.factor(ex.group)25  1.54272   4.67729  0.71065 2.1709 0.0299422 *  
## as.factor(ex.group)26  0.96160   2.61588  0.27643 3.4786 0.0005040 ***
## as.factor(ex.group)27  2.55562  12.87934  0.34173 7.4785 7.517e-14 ***
## as.factor(ex.group)28  2.28400   9.81583  0.58236 3.9220 8.783e-05 ***
## as.factor(ex.group)29  2.33269  10.30563  0.41488 5.6226 1.881e-08 ***
## as.factor(ex.group)30  1.42252   4.14758  0.29758 4.7803 1.751e-06 ***
## as.factor(ex.group)31  2.67306  14.48429  0.71134 3.7578 0.0001714 ***
## as.factor(ex.group)32  2.11178   8.26294  0.71118 2.9694 0.0029839 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                       exp(coef) exp(-coef) lower .95 upper .95
## as.factor(ex.group)2     1.3491   0.741236   1.07617    1.6912
## as.factor(ex.group)3     1.6854   0.593347   1.24543    2.2807
## as.factor(ex.group)4     1.4191   0.704694   1.04863    1.9203
## as.factor(ex.group)5     2.9579   0.338076   1.61220    5.4269
## as.factor(ex.group)6     2.1873   0.457195   1.78564    2.6792
## as.factor(ex.group)7     3.8634   0.258836   2.41209    6.1881
## as.factor(ex.group)8     3.1897   0.313506   2.43748    4.1741
## as.factor(ex.group)9     2.8817   0.347019   2.06486    4.0216
## as.factor(ex.group)10    1.9167   0.521736   1.46626    2.5055
## as.factor(ex.group)11    3.0235   0.330746   0.96699    9.4535
## as.factor(ex.group)12    4.3749   0.228575   1.62614   11.7703
## as.factor(ex.group)13    2.4967   0.400535   1.17494    5.3052
## as.factor(ex.group)14    2.2490   0.444650   1.42050    3.5606
## as.factor(ex.group)15    1.8574   0.538394   1.27903    2.6972
## as.factor(ex.group)16    2.5245   0.396117   1.79140    3.5576
## as.factor(ex.group)17    6.3070   0.158553   2.96523   13.4151
## as.factor(ex.group)18   10.5054   0.095189   6.20414   17.7888
## as.factor(ex.group)19    7.2426   0.138072   4.12612   12.7129
## as.factor(ex.group)20    4.5753   0.218567   3.05690    6.8478
## as.factor(ex.group)21    2.3282   0.429518   1.48320    3.6546
## as.factor(ex.group)22    3.0935   0.323262   1.85728    5.1524
## as.factor(ex.group)23    2.6410   0.378642   0.37015   18.8437
## as.factor(ex.group)24   18.3648   0.054452   6.81752   49.4706
## as.factor(ex.group)25    4.6773   0.213799   1.16168   18.8322
## as.factor(ex.group)26    2.6159   0.382280   1.52167    4.4969
## as.factor(ex.group)27   12.8793   0.077644   6.59194   25.1637
## as.factor(ex.group)28    9.8158   0.101876   3.13489   30.7349
## as.factor(ex.group)29   10.3056   0.097034   4.57013   23.2392
## as.factor(ex.group)30    4.1476   0.241105   2.31469    7.4318
## as.factor(ex.group)31   14.4843   0.069040   3.59255   58.3972
## as.factor(ex.group)32    8.2629   0.121022   2.05009   33.3040
## 
## Concordance= 0.643  (se = 0.009 )
## Likelihood ratio test= 286.23  on 31 df,   p=<2e-16
## Wald test            = 338.05  on 31 df,   p=<2e-16
## Score (logrank) test = 412.94  on 31 df,   p=<2e-16
Association for hip fracture
table1(~ as.factor(ex.group) | hipfx, data = men.smk)
## Warning in table1.formula(~as.factor(ex.group) | hipfx, data = men.smk): Terms
## to the right of '|' in formula 'x' define table columns and are expected to be
## factors with meaningful labels.
0
(N=5755)
1
(N=237)
Overall
(N=5992)
as.factor(ex.group)
1 1530 (26.6%) 33 (13.9%) 1563 (26.1%)
2 786 (13.7%) 22 (9.3%) 808 (13.5%)
3 241 (4.2%) 8 (3.4%) 249 (4.2%)
4 299 (5.2%) 8 (3.4%) 307 (5.1%)
5 31 (0.5%) 2 (0.8%) 33 (0.6%)
6 938 (16.3%) 38 (16.0%) 976 (16.3%)
7 62 (1.1%) 9 (3.8%) 71 (1.2%)
8 274 (4.8%) 21 (8.9%) 295 (4.9%)
9 170 (3.0%) 12 (5.1%) 182 (3.0%)
10 471 (8.2%) 21 (8.9%) 492 (8.2%)
11 6 (0.1%) 2 (0.8%) 8 (0.1%)
12 6 (0.1%) 2 (0.8%) 8 (0.1%)
13 26 (0.5%) 4 (1.7%) 30 (0.5%)
14 75 (1.3%) 2 (0.8%) 77 (1.3%)
15 160 (2.8%) 4 (1.7%) 164 (2.7%)
16 152 (2.6%) 1 (0.4%) 153 (2.6%)
17 18 (0.3%) 3 (1.3%) 21 (0.4%)
18 23 (0.4%) 4 (1.7%) 27 (0.5%)
19 26 (0.5%) 8 (3.4%) 34 (0.6%)
20 92 (1.6%) 8 (3.4%) 100 (1.7%)
21 142 (2.5%) 5 (2.1%) 147 (2.5%)
22 75 (1.3%) 5 (2.1%) 80 (1.3%)
23 2 (0.0%) 1 (0.4%) 3 (0.1%)
24 4 (0.1%) 1 (0.4%) 5 (0.1%)
25 6 (0.1%) 0 (0%) 6 (0.1%)
26 58 (1.0%) 1 (0.4%) 59 (1.0%)
27 17 (0.3%) 3 (1.3%) 20 (0.3%)
28 5 (0.1%) 2 (0.8%) 7 (0.1%)
29 9 (0.2%) 4 (1.7%) 13 (0.2%)
30 43 (0.7%) 2 (0.8%) 45 (0.8%)
31 2 (0.0%) 1 (0.4%) 3 (0.1%)
32 6 (0.1%) 0 (0%) 6 (0.1%)
options(digits = 8)
hip.exgrp = coxph(Surv(fu_hipfx, hipfx) ~  as.factor(ex.group), data = men.smk)
## Warning in coxph.fit(X, Y, istrat, offset, init, control, weights = weights, :
## Loglik converged before variable 24,31 ; coefficient may be infinite.
summary(hip.exgrp)
## Call:
## coxph(formula = Surv(fu_hipfx, hipfx) ~ as.factor(ex.group), 
##     data = men.smk)
## 
##   n= 5992, number of events= 237 
## 
##                              coef   exp(coef)    se(coef)       z  Pr(>|z|)    
## as.factor(ex.group)2   4.2016e-01  1.5222e+00  2.7537e-01  1.5258 0.1270585    
## as.factor(ex.group)3   4.2415e-01  1.5283e+00  3.9409e-01  1.0763 0.2817991    
## as.factor(ex.group)4   2.6181e-01  1.2993e+00  3.9410e-01  0.6643 0.5064774    
## as.factor(ex.group)5   1.1510e+00  3.1614e+00  7.2825e-01  1.5805 0.1139879    
## as.factor(ex.group)6   1.0719e+00  2.9210e+00  2.3935e-01  4.4785 7.519e-06 ***
## as.factor(ex.group)7   2.4055e+00  1.1084e+01  3.7708e-01  6.3792 1.781e-10 ***
## as.factor(ex.group)8   1.7300e+00  5.6405e+00  2.8070e-01  6.1630 7.138e-10 ***
## as.factor(ex.group)9   1.6044e+00  4.9750e+00  3.3831e-01  4.7424 2.112e-06 ***
## as.factor(ex.group)10  1.2740e+00  3.5752e+00  2.8105e-01  4.5331 5.812e-06 ***
## as.factor(ex.group)11  2.5136e+00  1.2349e+01  7.2824e-01  3.4516 0.0005573 ***
## as.factor(ex.group)12  2.5713e+00  1.3083e+01  7.2827e-01  3.5307 0.0004144 ***
## as.factor(ex.group)13  2.1735e+00  8.7893e+00  5.2973e-01  4.1031 4.076e-05 ***
## as.factor(ex.group)14  1.8471e-01  1.2029e+00  7.2822e-01  0.2536 0.7997685    
## as.factor(ex.group)15  3.3795e-01  1.4021e+00  5.2952e-01  0.6382 0.5233333    
## as.factor(ex.group)16 -9.9012e-01  3.7153e-01  1.0151e+00 -0.9754 0.3293670    
## as.factor(ex.group)17  2.7600e+00  1.5800e+01  6.0431e-01  4.5671 4.944e-06 ***
## as.factor(ex.group)18  2.6843e+00  1.4648e+01  5.3093e-01  5.0559 4.284e-07 ***
## as.factor(ex.group)19  3.2925e+00  2.6909e+01  3.9663e-01  8.3012 < 2.2e-16 ***
## as.factor(ex.group)20  2.0477e+00  7.7498e+00  3.9579e-01  5.1736 2.297e-07 ***
## as.factor(ex.group)21  1.2725e+00  3.5698e+00  4.8158e-01  2.6423 0.0082340 ** 
## as.factor(ex.group)22  1.8087e+00  6.1022e+00  4.8142e-01  3.7570 0.0001720 ***
## as.factor(ex.group)23  2.8866e+00  1.7933e+01  1.0157e+00  2.8420 0.0044831 ** 
## as.factor(ex.group)24  2.6492e+00  1.4143e+01  1.0156e+00  2.6086 0.0090919 ** 
## as.factor(ex.group)25 -1.2588e+01  3.4141e-06  1.7981e+03 -0.0070 0.9944144    
## as.factor(ex.group)26  7.3530e-02  1.0763e+00  1.0151e+00  0.0724 0.9422558    
## as.factor(ex.group)27  3.1220e+00  2.2691e+01  6.0480e-01  5.1620 2.443e-07 ***
## as.factor(ex.group)28  3.6452e+00  3.8290e+01  7.3137e-01  4.9841 6.227e-07 ***
## as.factor(ex.group)29  3.6261e+00  3.7566e+01  5.3075e-01  6.8321 8.369e-12 ***
## as.factor(ex.group)30  1.5060e+00  4.5085e+00  7.2902e-01  2.0657 0.0388524 *  
## as.factor(ex.group)31  3.4366e+00  3.1081e+01  1.0155e+00  3.3841 0.0007141 ***
## as.factor(ex.group)32 -1.2491e+01  3.7611e-06  2.5773e+03 -0.0048 0.9961330    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                        exp(coef) exp(-coef) lower .95 upper .95
## as.factor(ex.group)2  1.5222e+00 6.5694e-01   0.88732    2.6114
## as.factor(ex.group)3  1.5283e+00 6.5433e-01   0.70593    3.3087
## as.factor(ex.group)4  1.2993e+00 7.6965e-01   0.60013    2.8130
## as.factor(ex.group)5  3.1614e+00 3.1632e-01   0.75856   13.1754
## as.factor(ex.group)6  2.9210e+00 3.4235e-01   1.82723    4.6694
## as.factor(ex.group)7  1.1084e+01 9.0224e-02   5.29306   23.2088
## as.factor(ex.group)8  5.6405e+00 1.7729e-01   3.25375    9.7781
## as.factor(ex.group)9  4.9750e+00 2.0101e-01   2.56340    9.6553
## as.factor(ex.group)10 3.5752e+00 2.7970e-01   2.06098    6.2020
## as.factor(ex.group)11 1.2349e+01 8.0979e-02   2.96312   51.4644
## as.factor(ex.group)12 1.3083e+01 7.6435e-02   3.13907   54.5272
## as.factor(ex.group)13 8.7893e+00 1.1378e-01   3.11207   24.8231
## as.factor(ex.group)14 1.2029e+00 8.3134e-01   0.28864    5.0128
## as.factor(ex.group)15 1.4021e+00 7.1323e-01   0.49664    3.9582
## as.factor(ex.group)16 3.7153e-01 2.6915e+00   0.05081    2.7168
## as.factor(ex.group)17 1.5800e+01 6.3293e-02   4.83339   51.6459
## as.factor(ex.group)18 1.4648e+01 6.8269e-02   5.17429   41.4671
## as.factor(ex.group)19 2.6909e+01 3.7162e-02  12.36769   58.5473
## as.factor(ex.group)20 7.7498e+00 1.2904e-01   3.56773   16.8342
## as.factor(ex.group)21 3.5698e+00 2.8013e-01   1.38904    9.1741
## as.factor(ex.group)22 6.1022e+00 1.6387e-01   2.37524   15.6773
## as.factor(ex.group)23 1.7933e+01 5.5763e-02   2.44952  131.2867
## as.factor(ex.group)24 1.4143e+01 7.0706e-02   1.93232  103.5163
## as.factor(ex.group)25 3.4141e-06 2.9290e+05   0.00000       Inf
## as.factor(ex.group)26 1.0763e+00 9.2911e-01   0.14719    7.8704
## as.factor(ex.group)27 2.2691e+01 4.4070e-02   6.93510   74.2440
## as.factor(ex.group)28 3.8290e+01 2.6116e-02   9.13154  160.5587
## as.factor(ex.group)29 3.7566e+01 2.6620e-02  13.27469  106.3083
## as.factor(ex.group)30 4.5085e+00 2.2180e-01   1.08017   18.8180
## as.factor(ex.group)31 3.1081e+01 3.2174e-02   4.24707  227.4640
## as.factor(ex.group)32 3.7611e-06 2.6588e+05   0.00000       Inf
## 
## Concordance= 0.737  (se = 0.017 )
## Likelihood ratio test= 185.88  on 31 df,   p=<2e-16
## Wald test            = 223.68  on 31 df,   p=<2e-16
## Score (logrank) test = 350.86  on 31 df,   p=<2e-16

Export data in csv format

write.csv(men.smk, "C:\\Thach\\Research projects\\PAR for lifestyle factors\\smoking_final.csv", row.names = FALSE)

(4) Additional analysis: Post-fracture mortality risk

Data management

men.anyfx$fu = men.anyfx$time2end - men.anyfx$time2any
men.hipfx$fu = men.hipfx$time2end - men.hipfx$time2any

(4.1) Following any fracture

men.anyfx$smoke.c = factor(men.anyfx$smoke, levels = c("Never", "Past", "Current"))
men.anyfx$fnbmd.sd = men.anyfx$fnbmd / 0.10

pany.age = coxph(Surv(fu, death) ~  smoke.c + age, data = men.anyfx)
summary(pany.age)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                     coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke.cPast    0.1250210 1.1331722 0.0801782  1.5593 0.1189280    
## smoke.cCurrent 0.6407731 1.8979476 0.1869827  3.4269 0.0006105 ***
## age            0.0949590 1.0996138 0.0066602 14.2576 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast       1.1332    0.88248   0.96839    1.3260
## smoke.cCurrent    1.8979    0.52688   1.31560    2.7381
## age               1.0996    0.90941   1.08535    1.1141
## 
## Concordance= 0.641  (se = 0.012 )
## Likelihood ratio test= 197.05  on 3 df,   p=<2e-16
## Wald test            = 205.12  on 3 df,   p=<2e-16
## Score (logrank) test = 210.71  on 3 df,   p=<2e-16
pany.multi1 = coxph(Surv(fu, death) ~  smoke.c + age + fnbmd.sd + cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
summary(pany.multi1)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age + fnbmd.sd + 
##     cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                      coef  exp(coef)   se(coef)       z  Pr(>|z|)    
## smoke.cPast     0.1314561  1.1404878  0.0808410  1.6261 0.1039268    
## smoke.cCurrent  0.6731738  1.9604495  0.1882506  3.5759 0.0003490 ***
## age             0.0923883  1.0967907  0.0069735 13.2484 < 2.2e-16 ***
## fnbmd.sd       -0.0941156  0.9101776  0.0323780 -2.9068 0.0036518 ** 
## cvd             0.1394747  1.1496697  0.0900416  1.5490 0.1213809    
## diabetes        0.3136288  1.3683817  0.1207121  2.5982 0.0093726 ** 
## renal          -0.5895430  0.5545807  0.1393249 -4.2314 2.322e-05 ***
## copd            0.3675655  1.4442143  0.1112217  3.3048 0.0009504 ***
## cancer          0.0192445  1.0194309  0.0966124  0.1992 0.8421117    
## depression      0.2634095  1.3013595  0.1733104  1.5199 0.1285433    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast      1.14049    0.87682   0.97337   1.33630
## smoke.cCurrent   1.96045    0.51009   1.35555   2.83527
## age              1.09679    0.91175   1.08190   1.11188
## fnbmd.sd         0.91018    1.09869   0.85421   0.96981
## cvd              1.14967    0.86982   0.96367   1.37157
## diabetes         1.36838    0.73079   1.08008   1.73363
## renal            0.55458    1.80316   0.42206   0.72872
## copd             1.44421    0.69242   1.16134   1.79599
## cancer           1.01943    0.98094   0.84357   1.23195
## depression       1.30136    0.76843   0.92656   1.82776
## 
## Concordance= 0.659  (se = 0.011 )
## Likelihood ratio test= 244.84  on 10 df,   p=<2e-16
## Wald test            = 243.92  on 10 df,   p=<2e-16
## Score (logrank) test = 254.16  on 10 df,   p=<2e-16
pany.multi2 = coxph(Surv(fu, death) ~  smoke.c + age + fnbmd.sd + BMI + drink_bin + physical_bin + calci_bin + protein2 + cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
summary(pany.multi2)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age + fnbmd.sd + 
##     BMI + drink_bin + physical_bin + calci_bin + protein2 + cvd + 
##     diabetes + renal + copd + cancer + depression, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke.cPast                      0.1161753  1.1231928  0.0830216  1.3993
## smoke.cCurrent                   0.6850054  1.9837825  0.1922742  3.5626
## age                              0.0925601  1.0969790  0.0070580 13.1143
## fnbmd.sd                        -0.1071279  0.8984108  0.0347817 -3.0800
## BMI                              0.0163228  1.0164568  0.0110481  1.4774
## drink_bin2.Excessive drinking    0.0562688  1.0578820  0.0841257  0.6689
## physical_bin2.Less active        0.0589665  1.0607397  0.0793367  0.7432
## calci_bin2.Insufficient Calcium -0.0654520  0.9366440  0.1064066 -0.6151
## protein2                        -0.0017090  0.9982924  0.0018165 -0.9408
## cvd                              0.1253799  1.1335790  0.0907256  1.3820
## diabetes                         0.2909403  1.3376848  0.1226505  2.3721
## renal                           -0.6091720  0.5438010  0.1399476 -4.3529
## copd                             0.3692164  1.4466006  0.1120072  3.2964
## cancer                          -0.0032143  0.9967909  0.0974182 -0.0330
## depression                       0.2618845  1.2993764  0.1738727  1.5062
##                                  Pr(>|z|)    
## smoke.cPast                     0.1617115    
## smoke.cCurrent                  0.0003671 ***
## age                             < 2.2e-16 ***
## fnbmd.sd                        0.0020700 ** 
## BMI                             0.1395607    
## drink_bin2.Excessive drinking   0.5035812    
## physical_bin2.Less active       0.4573344    
## calci_bin2.Insufficient Calcium 0.5384809    
## protein2                        0.3467961    
## cvd                             0.1669813    
## diabetes                        0.0176869 *  
## renal                           1.344e-05 ***
## copd                            0.0009795 ***
## cancer                          0.9736787    
## depression                      0.1320196    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast                       1.12319    0.89032   0.95452   1.32167
## smoke.cCurrent                    1.98378    0.50409   1.36091   2.89173
## age                               1.09698    0.91159   1.08191   1.11226
## fnbmd.sd                          0.89841    1.11308   0.83921   0.96179
## BMI                               1.01646    0.98381   0.99468   1.03871
## drink_bin2.Excessive drinking     1.05788    0.94529   0.89708   1.24751
## physical_bin2.Less active         1.06074    0.94274   0.90798   1.23920
## calci_bin2.Insufficient Calcium   0.93664    1.06764   0.76033   1.15385
## protein2                          0.99829    1.00171   0.99474   1.00185
## cvd                               1.13358    0.88216   0.94891   1.35418
## diabetes                          1.33768    0.74756   1.05185   1.70120
## renal                             0.54380    1.83891   0.41335   0.71542
## copd                              1.44660    0.69128   1.16147   1.80173
## cancer                            0.99679    1.00322   0.82353   1.20650
## depression                        1.29938    0.76960   0.92413   1.82699
## 
## Concordance= 0.66  (se = 0.011 )
## Likelihood ratio test= 248.8  on 15 df,   p=<2e-16
## Wald test            = 246.74  on 15 df,   p=<2e-16
## Score (logrank) test = 256.98  on 15 df,   p=<2e-16

(4.2) Following hip fracture

men.hipfx$smoke.c = factor(men.hipfx$smoke, levels = c("Never", "Past", "Current"))
men.hipfx$fnbmd.sd = men.hipfx$fnbmd / 0.10

phip.age = coxph(Surv(fu, death) ~  smoke.c + age, data = men.anyfx)
summary(phip.age)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                     coef exp(coef)  se(coef)       z  Pr(>|z|)    
## smoke.cPast    0.1250210 1.1331722 0.0801782  1.5593 0.1189280    
## smoke.cCurrent 0.6407731 1.8979476 0.1869827  3.4269 0.0006105 ***
## age            0.0949590 1.0996138 0.0066602 14.2576 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast       1.1332    0.88248   0.96839    1.3260
## smoke.cCurrent    1.8979    0.52688   1.31560    2.7381
## age               1.0996    0.90941   1.08535    1.1141
## 
## Concordance= 0.641  (se = 0.012 )
## Likelihood ratio test= 197.05  on 3 df,   p=<2e-16
## Wald test            = 205.12  on 3 df,   p=<2e-16
## Score (logrank) test = 210.71  on 3 df,   p=<2e-16
phip.multi1 = coxph(Surv(fu, death) ~  smoke.c + age + fnbmd.sd + cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
summary(phip.multi1)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age + fnbmd.sd + 
##     cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                      coef  exp(coef)   se(coef)       z  Pr(>|z|)    
## smoke.cPast     0.1314561  1.1404878  0.0808410  1.6261 0.1039268    
## smoke.cCurrent  0.6731738  1.9604495  0.1882506  3.5759 0.0003490 ***
## age             0.0923883  1.0967907  0.0069735 13.2484 < 2.2e-16 ***
## fnbmd.sd       -0.0941156  0.9101776  0.0323780 -2.9068 0.0036518 ** 
## cvd             0.1394747  1.1496697  0.0900416  1.5490 0.1213809    
## diabetes        0.3136288  1.3683817  0.1207121  2.5982 0.0093726 ** 
## renal          -0.5895430  0.5545807  0.1393249 -4.2314 2.322e-05 ***
## copd            0.3675655  1.4442143  0.1112217  3.3048 0.0009504 ***
## cancer          0.0192445  1.0194309  0.0966124  0.1992 0.8421117    
## depression      0.2634095  1.3013595  0.1733104  1.5199 0.1285433    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast      1.14049    0.87682   0.97337   1.33630
## smoke.cCurrent   1.96045    0.51009   1.35555   2.83527
## age              1.09679    0.91175   1.08190   1.11188
## fnbmd.sd         0.91018    1.09869   0.85421   0.96981
## cvd              1.14967    0.86982   0.96367   1.37157
## diabetes         1.36838    0.73079   1.08008   1.73363
## renal            0.55458    1.80316   0.42206   0.72872
## copd             1.44421    0.69242   1.16134   1.79599
## cancer           1.01943    0.98094   0.84357   1.23195
## depression       1.30136    0.76843   0.92656   1.82776
## 
## Concordance= 0.659  (se = 0.011 )
## Likelihood ratio test= 244.84  on 10 df,   p=<2e-16
## Wald test            = 243.92  on 10 df,   p=<2e-16
## Score (logrank) test = 254.16  on 10 df,   p=<2e-16
phip.multi2 = coxph(Surv(fu, death) ~  smoke.c + age + fnbmd.sd + BMI + drink_bin + physical_bin + calci_bin + protein2 + cvd + diabetes + renal + copd + cancer + depression, data = men.anyfx)
summary(phip.multi2)
## Call:
## coxph(formula = Surv(fu, death) ~ smoke.c + age + fnbmd.sd + 
##     BMI + drink_bin + physical_bin + calci_bin + protein2 + cvd + 
##     diabetes + renal + copd + cancer + depression, data = men.anyfx)
## 
##   n= 1084, number of events= 693 
## 
##                                       coef  exp(coef)   se(coef)       z
## smoke.cPast                      0.1161753  1.1231928  0.0830216  1.3993
## smoke.cCurrent                   0.6850054  1.9837825  0.1922742  3.5626
## age                              0.0925601  1.0969790  0.0070580 13.1143
## fnbmd.sd                        -0.1071279  0.8984108  0.0347817 -3.0800
## BMI                              0.0163228  1.0164568  0.0110481  1.4774
## drink_bin2.Excessive drinking    0.0562688  1.0578820  0.0841257  0.6689
## physical_bin2.Less active        0.0589665  1.0607397  0.0793367  0.7432
## calci_bin2.Insufficient Calcium -0.0654520  0.9366440  0.1064066 -0.6151
## protein2                        -0.0017090  0.9982924  0.0018165 -0.9408
## cvd                              0.1253799  1.1335790  0.0907256  1.3820
## diabetes                         0.2909403  1.3376848  0.1226505  2.3721
## renal                           -0.6091720  0.5438010  0.1399476 -4.3529
## copd                             0.3692164  1.4466006  0.1120072  3.2964
## cancer                          -0.0032143  0.9967909  0.0974182 -0.0330
## depression                       0.2618845  1.2993764  0.1738727  1.5062
##                                  Pr(>|z|)    
## smoke.cPast                     0.1617115    
## smoke.cCurrent                  0.0003671 ***
## age                             < 2.2e-16 ***
## fnbmd.sd                        0.0020700 ** 
## BMI                             0.1395607    
## drink_bin2.Excessive drinking   0.5035812    
## physical_bin2.Less active       0.4573344    
## calci_bin2.Insufficient Calcium 0.5384809    
## protein2                        0.3467961    
## cvd                             0.1669813    
## diabetes                        0.0176869 *  
## renal                           1.344e-05 ***
## copd                            0.0009795 ***
## cancer                          0.9736787    
## depression                      0.1320196    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                 exp(coef) exp(-coef) lower .95 upper .95
## smoke.cPast                       1.12319    0.89032   0.95452   1.32167
## smoke.cCurrent                    1.98378    0.50409   1.36091   2.89173
## age                               1.09698    0.91159   1.08191   1.11226
## fnbmd.sd                          0.89841    1.11308   0.83921   0.96179
## BMI                               1.01646    0.98381   0.99468   1.03871
## drink_bin2.Excessive drinking     1.05788    0.94529   0.89708   1.24751
## physical_bin2.Less active         1.06074    0.94274   0.90798   1.23920
## calci_bin2.Insufficient Calcium   0.93664    1.06764   0.76033   1.15385
## protein2                          0.99829    1.00171   0.99474   1.00185
## cvd                               1.13358    0.88216   0.94891   1.35418
## diabetes                          1.33768    0.74756   1.05185   1.70120
## renal                             0.54380    1.83891   0.41335   0.71542
## copd                              1.44660    0.69128   1.16147   1.80173
## cancer                            0.99679    1.00322   0.82353   1.20650
## depression                        1.29938    0.76960   0.92413   1.82699
## 
## Concordance= 0.66  (se = 0.011 )
## Likelihood ratio test= 248.8  on 15 df,   p=<2e-16
## Wald test            = 246.74  on 15 df,   p=<2e-16
## Score (logrank) test = 256.98  on 15 df,   p=<2e-16