Learn R Programming

ROCnReg (version 1.0-8)

densitycontrol: (Conditional) density estimates of test outcomes

Description

This function is used to set various parameters controlling the estimation of the (conditional) density (densities) of test outcomes in both the healthy and diseased groups.

Usage

densitycontrol(compute = FALSE, grid.h = NA, grid.d = NA)

Value

A list with components for each of the possible arguments.

Arguments

compute

Logical value. If TRUE the (conditional) density (densities) of test outcomes in each group, healthy and diseased, are estimated.

grid.h

Grid of test outcomes in the healthy group where the (conditional) density (densities) estimates are to be evaluated. Value NA signals autoinitialization, with default a vector of length 200 in the range of test outcomes in the healthy group.

grid.d

Grid of test outcomes in the diseased group where the (conditional) density (densities) estimates are to be evaluated. Value NA signals autoinitialization, with default a vector of length 200 in the range of test outcomes in the diseased group.

Details

The value returned by this function is used as a control argument of the cROC.bnp and pooledROC.dpm functions.

See Also

cROC.bnp and pooledROC.dpm

Examples

Run this code
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{
cROC_bnp <- cROC.bnp(formula.h = l_marker1 ~ f(age, K = 0),
               formula.d = 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(compute = TRUE, grid.h = NA, grid.d = NA),
               mcmc = mcmccontrol(nsave = 500, nburn = 100, nskip = 1))
# }
# \dontshow{
agep <- seq(min(newpsa$age), max(newpsa$age), length = 5)
df.pred <- data.frame(age = agep)
cROC_bnp <- cROC.bnp(formula.h = l_marker1 ~ f(age, K = 0),
               formula.d = l_marker1 ~ f(age, K = 0),
               group = "status", 
               tag.h = 0,
               data = newpsa,
               newdata = df.pred,
               standardise = TRUE, 
               p = seq(0, 1, len = 101),
               compute.lpml = FALSE, 
               compute.WAIC = FALSE,
               compute.DIC = FALSE, 
               pauc = pauccontrol(compute = FALSE, value = 0.5, focus = "FPF"),
               density = densitycontrol(compute = FALSE, grid.h = NA, grid.d = NA),
               mcmc = mcmccontrol(nsave = 50, nburn = 10, nskip = 1))

summary(cROC_bnp)

plot(cROC_bnp)
# }

Run the code above in your browser using DataLab