bcROCsurface (version 1.0-4)

asyCovTCF: Asymptotic variance-covariance estimation for True Class Fractions (TCFs) at the cut point \((c_1, c_2)\)

Description

asyCovTCF computes the asymptotic variance-covariance matrix of full data (FULL) and bias-corrected estimators (i.e. full imputation, mean score imputation, inverse probability weighting, semiparametric efficient and K nearest neighbor) of TCFs.

Usage

asyCovTCF(
  obj_tcf,
  T,
  Dvec,
  V = NULL,
  rhoEst = NULL,
  piEst = NULL,
  BOOT = FALSE,
  nR = 250,
  parallel = FALSE,
  ncpus = ifelse(parallel, detectCores()/2, NULL)
)

Arguments

obj_tcf

a result of a call to ROCs.tcf.

T

a numeric vector containing the diagnostic test values. NA values of T are not accepted.

Dvec

a n * 3 binary matrix with three columns, corresponding to the three classes of the disease status. In row i, 1 in column j indicates that the i-th subject belongs to class j, with j = 1, 2, 3. A row of NA values indicates a non-verified subject.

V

a binary vector containing the verification status (1 verified, 0 not verified).

rhoEst

a result of a call to rhoMLogit of rhoKNN to fit the disease model.

piEst

a result of a call to psglm to fit the verification model.

BOOT

a logical value. Default = FALSE. If set to TRUE, a bootstrap resampling is employed to estimate the asymptotic variance-covariance matrix of bias-corrected TCFs.

nR

the number of bootstrap replicates, used when BOOT = TRUE or for FULL estimator. Usually this will be a single positive integer. Default 250.

parallel

a logical value. If TRUE, a parallel computing is employed in the bootstrap resampling process.

ncpus

number of processes to be used in parallel computing. Default is half of available cores.

Value

This function returns an estimated asymptotic variance-covariance matrix for FULL estimator and bias-corrected estimators of TCFs at a fixed cut point.

Details

For bias-corrected estimators of TCFs, the asymptotic variance-covariance matrix at a fixed cut point is estimated by using the Delta method. The function asyCovTCF implements the explicit forms presented in To Duc et al. (2016a, 2016b). In addition, the bootstrap procedure is also available.

For FULL estimator, the asymptotic variance-covariance matrix is computed via bootstrap only.

References

To Duc, K., Chiogna, M. and Adimari, G. (2016a) Bias-corrected methods for estimating the receiver operating characteristic surface of continuous diagnostic tests. Electronic Journal of Statistics, 10, 3063-3113.

To Duc, K., Chiogna, M. and Adimari, G. (2018) Nonparametric estimation of ROC surfaces in presence of verification bias. REVSTAT Statistical Journal. Accepted.

Examples

Run this code
# NOT RUN {
data(EOC)

# FULL data estimator
Dfull <- preDATA(EOC$D.full, EOC$CA125)
Dvec.full <- Dfull$Dvec

full.tcf <- ROCs.tcf("full", T = EOC$CA125, Dvec = Dvec.full, cps = c(2, 4))
full.var <- asyCovTCF(full.tcf, T = EOC$CA125, Dvec = Dvec.full)

# Preparing the missing disease status
Dna <- preDATA(EOC$D, EOC$CA125)
Dfact.na <- Dna$D
Dvec.na <- Dna$Dvec

rho.out <- rhoMLogit(Dfact.na ~ CA125 + CA153 + Age, data = EOC, test = TRUE)

## FI estimator
fi.tcf <- ROCs.tcf("fi", T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                   rhoEst = rho.out, cps = c(2,4))
fi.var <- asyCovTCF(fi.tcf, T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                    rhoEst = rho.out)

## MSI estimator
msi.tcf <- ROCs.tcf("msi", T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                    rhoEst = rho.out, cps = c(2,4))
msi.var <- asyCovTCF(msi.tcf, T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                     rhoEst = rho.out)

## IPW estimator
pi.out <- psglm(V ~ CA125 + CA153 + Age, data = EOC, test = TRUE)

ipw.tcf <- ROCs.tcf("ipw", T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                    piEst = pi.out, cps = c(2,4))
ipw.var <- asyCovTCF(ipw.tcf, T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                     piEst = pi.out)

## SPE estimator
spe.tcf <- ROCs.tcf("spe", T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                   rhoEst = rho.out, piEst = pi.out, cps = c(2,4))
spe.var <- asyCovTCF(spe.tcf, T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                     rhoEst = rho.out, piEst = pi.out)

## KNN estimators
XX <- cbind(EOC$CA125, EOC$CA153, EOC$Age)
rho.1nn <- rhoKNN(X = XX, Dvec = Dvec.na, V = EOC$V, K = 1, type = "mahala")
knn.tcf <- ROCs.tcf("knn", T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                   rhoEst = rho.1nn, cps = c(2,4))
knn.var <- asyCovTCF(knn.tcf, T = EOC$CA125, Dvec = Dvec.na, V = EOC$V,
                     rhoEst = rho.1nn)


# }

Run the code above in your browser using DataCamp Workspace