I have gone about solving the regression in the following manner:

- Determine quantiles (0.01, 0.25, 0.5, 0.75) for each biomarker above the LoD
- Fit linear splines with above quantiles - however, I got an error when trying to fit the model using lrm.fit with a 1% quantile above the LoD. It would only compute at 0.12 quantile - maybe I’m overlooking something?
- Build regression model with all relevant risk factors, and as suggested by @kiwiskiNZ, including the CKD-EPI formula, thus omitting age & gender from the regression equation.

Code as below:

```
dat <- dat %>% mutate(
myc.belowlod = case_when(
MyC_0h <= 0.4 ~ 1,
TRUE ~ 0
),
tnt.belowlod = case_when(
hsTnT_ambulance <= 5 ~ 1,
TRUE ~ 0
)
)
myc.quant <- round(as.numeric(quantile(subset(dat$MyC_0h, dat$myc.belowlod==0), probs = c(0.12, 0.25, 0.5, 0.75))))
tnt.quant <- round(as.numeric(quantile(subset(dat$hsTnT_ambulance, dat$tnt.belowlod==0), probs = c(0.12, 0.25, 0.5, 0.75))))
lrm(AMI ~ lsp(MyC_0h, myc.quant) + lsp(hsTnT_ambulance, tnt.quant) + gfr_epi + dm_base + chol_base + htn_base + previousMI, data=dat) # Full monty - i.e. all-inclusive model
lrm(AMI ~ lsp(MyC_0h, myc.quant) + gfr_epi + dm_base + chol_base + htn_base + previousMI, data=dat) # cMyC model
lrm(AMI ~ lsp(hsTnT_ambulance, tnt.quant) + gfr_epi + dm_base + chol_base + htn_base + previousMI, data=dat) # hs-cTnT model
```

Output:

```
Frequencies of Missing Values Due to Each Variable
AMI MyC_0h hsTnT_ambulance gfr_epi dm_base
0 0 0 84 0
chol_base htn_base previousMI
0 0 0
Logistic Regression Model
lrm(formula = AMI ~ lsp(MyC_0h, myc.quant) + lsp(hsTnT_ambulance,
tnt.quant) + gfr_epi + dm_base + chol_base + htn_base + previousMI,
data = dat)
Model Likelihood Discrimination Rank Discrim.
Ratio Test Indexes Indexes
Obs 692 LR chi2 256.87 R2 0.469 C 0.866
0 532 d.f. 15 g 2.827 Dxy 0.732
1 160 Pr(> chi2) <0.0001 gr 16.897 gamma 0.732
max |deriv| 0.0001 gp 0.263 tau-a 0.261
Brier 0.109
Coef S.E. Wald Z Pr(>|Z|)
Intercept -22.0606 10.4984 -2.10 0.0356
MyC_0h 1.9825 1.4746 1.34 0.1788
MyC_0h' -2.2639 1.5749 -1.44 0.1506
MyC_0h'' 0.3488 0.2605 1.34 0.1806
MyC_0h''' -0.0350 0.0532 -0.66 0.5110
MyC_0h'''' -0.0321 0.0105 -3.05 0.0023
hsTnT_ambulance 0.5085 0.4831 1.05 0.2925
hsTnT_ambulance' -0.4553 1.1983 -0.38 0.7039
hsTnT_ambulance'' 0.1270 0.8750 0.15 0.8846
hsTnT_ambulance''' -0.1716 0.1021 -1.68 0.0929
hsTnT_ambulance'''' -0.0044 0.0271 -0.16 0.8723
gfr_epi 0.0281 0.0057 4.92 <0.0001
dm_base=Yes -0.9719 0.3163 -3.07 0.0021
chol_base=Yes 0.3064 0.3181 0.96 0.3354
htn_base=Yes 0.0979 0.2494 0.39 0.6948
previousMI=Yes -0.0445 0.2483 -0.18 0.8578
Frequencies of Missing Values Due to Each Variable
AMI MyC_0h gfr_epi dm_base chol_base htn_base previousMI
0 0 84 0 0 0 0
Logistic Regression Model
lrm(formula = AMI ~ lsp(MyC_0h, myc.quant) + gfr_epi + dm_base +
chol_base + htn_base + previousMI, data = dat)
Model Likelihood Discrimination Rank Discrim.
Ratio Test Indexes Indexes
Obs 692 LR chi2 242.72 R2 0.448 C 0.856
0 532 d.f. 10 g 2.504 Dxy 0.711
1 160 Pr(> chi2) <0.0001 gr 12.231 gamma 0.711
max |deriv| 3e-05 gp 0.257 tau-a 0.253
Brier 0.112
Coef S.E. Wald Z Pr(>|Z|)
Intercept -18.4166 9.6059 -1.92 0.0552
MyC_0h 1.9705 1.4042 1.40 0.1605
MyC_0h' -2.0841 1.4968 -1.39 0.1638
MyC_0h'' 0.2164 0.2467 0.88 0.3803
MyC_0h''' -0.0598 0.0502 -1.19 0.2334
MyC_0h'''' -0.0420 0.0082 -5.13 <0.0001
gfr_epi 0.0233 0.0052 4.44 <0.0001
dm_base=Yes -0.8962 0.3145 -2.85 0.0044
chol_base=Yes 0.2060 0.3070 0.67 0.5023
htn_base=Yes 0.1628 0.2453 0.66 0.5069
previousMI=Yes -0.0411 0.2472 -0.17 0.8678
Frequencies of Missing Values Due to Each Variable
AMI hsTnT_ambulance gfr_epi dm_base chol_base
0 0 84 0 0
htn_base previousMI
0 0
Logistic Regression Model
lrm(formula = AMI ~ lsp(hsTnT_ambulance, tnt.quant) + gfr_epi +
dm_base + chol_base + htn_base + previousMI, data = dat)
Model Likelihood Discrimination Rank Discrim.
Ratio Test Indexes Indexes
Obs 692 LR chi2 231.35 R2 0.430 C 0.849
0 532 d.f. 10 g 2.275 Dxy 0.698
1 160 Pr(> chi2) <0.0001 gr 9.724 gamma 0.698
max |deriv| 0.002 gp 0.250 tau-a 0.248
Brier 0.116
Coef S.E. Wald Z Pr(>|Z|)
Intercept -9.7911 2.6558 -3.69 0.0002
hsTnT_ambulance 0.6282 0.4268 1.47 0.1410
hsTnT_ambulance' -0.4979 1.0905 -0.46 0.6480
hsTnT_ambulance'' 0.1676 0.8135 0.21 0.8368
hsTnT_ambulance''' -0.2298 0.0947 -2.43 0.0152
hsTnT_ambulance'''' -0.0616 0.0220 -2.81 0.0050
gfr_epi 0.0283 0.0055 5.11 <0.0001
dm_base=Yes -1.0309 0.3104 -3.32 0.0009
chol_base=Yes 0.3356 0.3064 1.10 0.2734
htn_base=Yes 0.0565 0.2419 0.23 0.8153
previousMI=Yes 0.0463 0.2425 0.19 0.8486
```

I’m not convinced that the linear spline fits better than the restricted cubic spline quoted above? In fact, the LR chi2 is 259, R2 0.473 and C index 0.865 for the all-inclusive model using rcs, which I think points to a better model fit?