library(ROCnReg)
data(psa)
# Select the last measurement
newpsa <- psa[!duplicated(psa$id, fromLast = TRUE),]
# Log-transform the biomarker
newpsa$l_marker1 <- log(newpsa$marker1)
# \donttest{
m0_dpm <- pooledROC.dpm(marker = "l_marker1", group = "status",
tag.h = 0, data = newpsa, standardise = TRUE,
p = seq(0,1,l=101), compute.WAIC = TRUE, compute.lpml = TRUE,
compute.DIC = TRUE,
prior.h = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1,
L =10),
prior.d = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1,
L =10),
mcmc = mcmccontrol(nsave = 400, nburn = 100, nskip = 1))
## Threshold values based on the YI
th_m0_dpm_yi <- compute.threshold.pooledROC(m0_dpm, criterion = "YI")
th_m0_dpm_yi$threshold
th_m0_dpm_yi$YI
### Threshold values for a fixed FPF
th_m0_dpm_fpf <- compute.threshold.pooledROC(m0_dpm, criterion = "FPF", FPF = 0.1)
th_m0_dpm_fpf$threshold
# }
# \dontshow{
m0_dpm <- pooledROC.dpm(marker = "l_marker1", group = "status",
tag.h = 0, data = newpsa, standardise = TRUE,
p = seq(0,1,l=101), compute.WAIC = FALSE, compute.lpml = FALSE,
compute.DIC = FALSE,
prior.h = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1,
L = 10),
prior.d = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1,
L = 10),
mcmc = mcmccontrol(nsave = 40, nburn = 10, nskip = 1))
## Threshold values based on the YI
th_m0_dpm_yi <- compute.threshold.pooledROC(m0_dpm, criterion = "YI")
th_m0_dpm_yi$threshold
th_m0_dpm_yi$YI
### Threshold values for a fixed FPF
th_m0_dpm_fpf <- compute.threshold.pooledROC(m0_dpm, criterion = "FPF", FPF = 0.1)
th_m0_dpm_fpf$threshold
# }
Run the code above in your browser using DataLab