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{
cROC_sp_normal <- cROC.sp(formula.h = l_marker1 ~ age,
formula.d = l_marker1 ~ age,
group = "status",
tag.h = 0,
data = newpsa,
newdata = df.pred,
est.cdf = "normal",
pauc = list(compute = TRUE, value = 0.5, focus = "FPF"),
p = seq(0, 1, l = 101),
B = 10)
# }
# \dontshow{
cROC_sp_normal <- cROC.sp(formula.h = l_marker1 ~ age,
formula.d = l_marker1 ~ age,
group = "status",
tag.h = 0,
data = newpsa,
newdata = df.pred,
est.cdf = "normal",
pauc = list(compute = TRUE, value = 0.5, focus = "FPF"),
p = seq(0, 1, l = 101),
B = 10)
# }
Run the code above in your browser using DataLab