Quick note: all of these models omit year, age, and sex. This is because the data are matched on age, sex, and enrollment start/end dates. Including the strata accounts for these factors while also properly clustering the errors.
The odds are increased following one or more symptom (OR = 7.44), for those living in MSAs (OR = 1.43), but there is a multiplicative decrease in odds for ALS for those with symptoms living in an MSA (OR = 0.84). The odds are still increased (OR = \(0.84 * 7.44 = 6.25\)) but less than for those who do not live in MSAs.
n_symptoms_adjusted |> broom::tidy(exponentiate =TRUE, conf.int =TRUE) |>filter(!stringr::str_detect(term, "msa"), stringr::str_detect(term, "as.factor")) |>mutate(variable =1:8 ) |>ggplot(aes(x = variable, y = estimate,ymin = conf.low,ymax = conf.high)) +geom_point() +geom_linerange() +labs(x ="Number of Symptoms", y ="ORs Compared to Having No Symptoms\n(95% CI)") +theme_bw()
Excluding Recent “Exposures”
Require the exposure to have occurred at least \(i\) days before the ALS diagnosis or data exit date where \(i\) ranges from 0 days to 5 years.
Since this difference is only defined for people who had a symptom, retain any people who are symptom free if they’re possibly still included in the data (e.g., if the time between the enrollment date and the end date is less than \(i\) days).
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `across(is_logical, as.numeric)`.
Caused by warning:
! Use of bare predicate functions was deprecated in tidyselect 1.1.0.
ℹ Please use wrap predicates in `where()` instead.
# Was:
data %>% select(is_logical)
# Now:
data %>% select(where(is_logical))
Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
ℹ Please use `all_of()` or `any_of()` instead.
# Was:
data %>% select(glance_vars)
# Now:
data %>% select(all_of(glance_vars))
See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
Characteristic
30 Day Delay
60 Day Delay
90 Day Delay
180 Day Delay
365 Day Delay
OR1
95% CI1
OR1
95% CI1
OR1
95% CI1
OR1
95% CI1
OR1
95% CI1
p-value
rate_outpatient_visits
1.02
1.02, 1.03
1.03
1.02, 1.03
1.03
1.03, 1.03
1.03
1.03, 1.03
1.03
1.03, 1.03
<0.001
intensity_outpatient_visits_dx
1.14
1.09, 1.18
1.14
1.10, 1.19
1.14
1.10, 1.19
1.13
1.08, 1.17
1.11
1.06, 1.16
<0.001
rate_inpatient_stays
0.78
0.74, 0.83
0.78
0.73, 0.83
0.78
0.73, 0.83
0.78
0.73, 0.83
0.79
0.73, 0.85
<0.001
intensity_inpatient_stays_los
1.00
0.99, 1.00
1.00
0.99, 1.00
1.00
0.99, 1.00
1.00
0.99, 1.00
1.00
0.99, 1.01
>0.9
elix_CHF
0.63
0.59, 0.68
0.64
0.59, 0.69
0.63
0.58, 0.68
0.63
0.58, 0.68
0.64
0.59, 0.70
<0.001
elix_Valvular
0.97
0.92, 1.03
0.97
0.91, 1.02
0.97
0.92, 1.03
0.97
0.91, 1.03
0.98
0.92, 1.04
0.5
elix_PHTN
0.98
0.89, 1.09
0.98
0.89, 1.09
0.99
0.90, 1.10
1.01
0.91, 1.12
0.98
0.88, 1.10
0.8
elix_PVD
0.92
0.87, 0.98
0.94
0.88, 0.99
0.94
0.88, 1.0
0.92
0.87, 0.98
0.91
0.86, 0.98
0.008
elix_HTN
0.99
0.95, 1.03
1.00
0.95, 1.04
1.00
0.96, 1.05
1.01
0.97, 1.06
1.01
0.96, 1.07
0.6
elix_HTNcx
0.91
0.85, 0.97
0.91
0.86, 0.97
0.91
0.85, 0.97
0.91
0.85, 0.97
0.91
0.84, 0.97
0.007
elix_Paralysis
2.99
2.77, 3.23
2.95
2.72, 3.19
2.94
2.72, 3.19
2.93
2.70, 3.18
2.89
2.65, 3.16
<0.001
elix_NeuroOther
5.28
5.05, 5.53
5.33
5.09, 5.58
5.33
5.09, 5.59
5.26
5.00, 5.52
5.09
4.83, 5.37
<0.001
elix_Pulmonary
0.96
0.91, 1.00
0.95
0.91, 1.00
0.96
0.91, 1.00
0.97
0.93, 1.02
0.99
0.94, 1.04
0.8
elix_DM
0.87
0.82, 0.92
0.88
0.83, 0.93
0.89
0.84, 0.94
0.89
0.84, 0.95
0.91
0.86, 0.97
0.004
elix_DMcx
0.79
0.73, 0.86
0.79
0.73, 0.85
0.78
0.72, 0.85
0.78
0.72, 0.85
0.77
0.70, 0.84
<0.001
elix_Hypothyroid
1.11
1.05, 1.16
1.10
1.05, 1.16
1.09
1.04, 1.15
1.09
1.03, 1.15
1.10
1.04, 1.16
0.001
elix_Renal
0.58
0.53, 0.64
0.58
0.53, 0.63
0.58
0.53, 0.63
0.59
0.53, 0.65
0.58
0.53, 0.65
<0.001
elix_Liver
0.93
0.86, 1.01
0.93
0.86, 1.01
0.94
0.86, 1.02
0.92
0.85, 1.01
0.95
0.86, 1.04
0.2
elix_PUD
1.01
0.80, 1.27
1.01
0.80, 1.27
0.96
0.76, 1.21
1.00
0.79, 1.27
0.99
0.77, 1.27
>0.9
elix_HIV
1.01
0.70, 1.45
1.02
0.71, 1.48
1.07
0.74, 1.55
1.04
0.72, 1.52
1.07
0.72, 1.58
0.7
elix_Lymphoma
1.24
1.08, 1.42
1.18
1.03, 1.36
1.19
1.03, 1.38
1.21
1.04, 1.40
1.18
1.01, 1.38
0.033
elix_Mets
0.33
0.29, 0.38
0.34
0.30, 0.39
0.34
0.30, 0.39
0.35
0.31, 0.41
0.39
0.34, 0.45
<0.001
elix_Tumor
0.86
0.81, 0.91
0.86
0.81, 0.92
0.88
0.82, 0.93
0.89
0.83, 0.95
0.89
0.83, 0.95
<0.001
elix_Rheumatic
1.25
1.17, 1.33
1.26
1.18, 1.35
1.26
1.19, 1.35
1.26
1.18, 1.35
1.27
1.19, 1.36
<0.001
elix_Coagulopathy
0.85
0.78, 0.93
0.85
0.78, 0.93
0.85
0.78, 0.93
0.86
0.78, 0.94
0.84
0.76, 0.92
<0.001
elix_Obesity
0.83
0.79, 0.89
0.85
0.80, 0.90
0.86
0.80, 0.91
0.86
0.81, 0.92
0.87
0.81, 0.93
<0.001
elix_WeightLoss
1.65
1.55, 1.76
1.62
1.52, 1.73
1.63
1.52, 1.74
1.58
1.48, 1.70
1.54
1.43, 1.66
<0.001
elix_FluidsLytes
0.79
0.75, 0.84
0.80
0.76, 0.85
0.80
0.75, 0.85
0.81
0.76, 0.86
0.81
0.76, 0.86
<0.001
elix_BloodLoss
0.70
0.61, 0.79
0.69
0.61, 0.79
0.70
0.62, 0.80
0.72
0.63, 0.82
0.73
0.63, 0.83
<0.001
elix_Anemia
1.05
1.00, 1.11
1.06
1.00, 1.11
1.06
1.00, 1.11
1.05
1.00, 1.11
1.06
1.00, 1.12
0.057
elix_Alcohol
0.83
0.73, 0.93
0.83
0.74, 0.94
0.84
0.74, 0.95
0.85
0.75, 0.97
0.85
0.74, 0.97
0.016
elix_Drugs
0.82
0.71, 0.94
0.82
0.71, 0.95
0.82
0.71, 0.95
0.82
0.71, 0.96
0.81
0.69, 0.95
0.008
elix_Psychoses
0.82
0.77, 0.87
0.82
0.76, 0.87
0.82
0.77, 0.88
0.83
0.78, 0.89
0.84
0.78, 0.90
<0.001
elix_Depression
0.98
0.92, 1.03
0.98
0.93, 1.04
0.98
0.93, 1.03
0.97
0.92, 1.03
0.98
0.93, 1.05
0.6
any_sx
4.49
3.97, 5.07
4.20
3.71, 4.75
3.98
3.51, 4.50
3.56
3.14, 4.04
3.08
2.70, 3.51
<0.001
lives_in_msa
1.42
1.27, 1.60
1.42
1.27, 1.59
1.42
1.26, 1.59
1.41
1.26, 1.58
1.40
1.25, 1.58
<0.001
any_sx * lives_in_msa
0.83
0.73, 0.95
0.83
0.73, 0.95
0.83
0.73, 0.95
0.84
0.73, 0.96
0.85
0.74, 0.97
0.017
No. Obs.
113,827
112,410
111,062
107,147
98,850
N events
18,342
17,615
17,016
15,574
13,418
c-index
0.795
0.794
0.793
0.789
0.778
R²
0.150
0.146
0.142
0.133
0.117
1 OR = Odds Ratio, CI = Confidence Interval
And then with all the lags up to 5 years:
lags <-round(seq(0, 2, by =1/12) *365)results <-vector("list", length(lags))j <-1p <- progress::progress_bar$new(total =length(lags), format ="[:bar] :percent in :elapsed with :eta remaining")for (i in lags) { results[[j]] <-clogit( any_fml_fulladj, model_data |>filter(is.na(first_symptom_date) | (first_symptom_date < (end_date - i))) |>filter(first_date < (end_date - i)) ) |> broom::tidy(exponentiate =TRUE, conf.int =TRUE) |>mutate(i = i) |>select(i, term, estimate, conf.low, conf.high) j <- j +1 p$tick()}results |>bind_rows() |>filter( stringr::str_detect(term, "Neuro") ) |>ggplot(aes(x = i /365, y = estimate,ymin = conf.low,ymax = conf.high)) +geom_point() +geom_linerange() +labs(x ="Lead-in Period by Years",y ="Odds Ratio for Elixhauser Neurological CMs") +theme_bw()
ggsave("~/projects/als-sx/neuro_series.svg", width =16/2, height =9/2)results |>bind_rows() |>filter( stringr::str_detect(term, "sx") | stringr::str_detect(term, "msa") ) |>mutate(term =case_when( term =="any_sxTRUE"~"Has Symptom", term =="lives_in_msaTRUE"~"Lives in MSA", term =="any_sxTRUE:lives_in_msaTRUE"~"Symptom x MSA" ),term = forcats::fct_relevel(term,"Has Symptom", "Lives in MSA") ) |>ggplot(aes(x = i /365,y = estimate,ymin = conf.low,ymax = conf.high ) ) +geom_point() +geom_linerange() +facet_grid(rows =vars(term), scales ="free_y") +labs(x ="Years Between Symptom and ALS Date", y ="Odds Ratio") +theme_bw()