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)
# Covariate for prediction
agep <- seq(min(newpsa$age), max(newpsa$age), length = 5)
df.pred <- data.frame(age = agep)
# \donttest{
AROC_bnp <- AROC.bnp(formula.h = l_marker1 ~ f(age, K = 0),
group = "status",
tag.h = 0,
data = newpsa,
standardise = TRUE,
p = seq(0, 1, len = 101),
compute.lpml = TRUE,
compute.WAIC = TRUE,
compute.DIC = TRUE,
pauc = pauccontrol(compute = TRUE, value = 0.5, focus = "FPF"),
density = densitycontrol.aroc(compute = TRUE, grid.h = NA, newdata = df.pred),
mcmc = mcmccontrol(nsave = 500, nburn = 100, nskip = 1)
)
# }
# \dontshow{
AROC_bnp <- AROC.bnp(formula.h = l_marker1 ~ f(age, K = 0),
group = "status",
tag.h = 0,
data = newpsa,
standardise = TRUE,
p = seq(0, 1, len = 101),
compute.lpml = TRUE,
compute.WAIC = TRUE,
compute.DIC = TRUE,
pauc = pauccontrol(compute = TRUE, value = 0.5, focus = "FPF"),
density = densitycontrol.aroc(compute = TRUE, grid.h = NA, newdata = df.pred),
mcmc = mcmccontrol(nsave = 50, nburn = 10, nskip = 1)
)
# }
Run the code above in your browser using DataLab