ROC.MRC: ROC.MRC - ROC areas for matched control data

Description Usage Arguments Details Value Author(s) Examples

View source: R/ROC.MRC.R

Description

ROC curve areas, variances, and p-values for datasets in which each case has a collection of matching controls.

Usage

1
2
ROC.MRC(response, stratum, variables, origin = NULL, origin.levels = NULL,
  ragged.OK = TRUE)

Arguments

response

logical vector identifying cases or character vector or factor vector with “insertion” marking the cases. Alternatively, a factor or character vector with elements matching "insertion" denoting the cases.

stratum

a vector of length(response) elements whose unique values correspond to cases and their matched controls. There must be exactly one case and k controls in every stratum.

variables

numeric a matrix or data.frame with length(response) rows and two or more columns.

origin

NULL or a vector of length(response) elements to identify different data sources.

origin.levels

optional character vector of origin levels

ragged.OK

logical - TRUE, if differing numbers of MRCs of any one origin are acceptable.

Details

When data are collected under a scheme in which matched controls are used to allow for biased selection and every case has k controls, the ROC area is estimated as the average fraction of controls whose variable value is less than that of its reference case. Variances are computed from the usual sample variance divided by the number of cases. It is the responsiibility of the caller to remove NA values from the arguments.

Value

list with elements ‘ROC’ giving a matrix of ROC curve areas, ‘var’ giving a list of variance matrices, and ‘pvalues’ giving a list of matrices containing pvalues for various contrasts.

Author(s)

Charles Berry

Examples

1
2
3
4
5
6
7
case <- rep(rep(c(TRUE,FALSE),c(1,3)),1000)
group <- rep(1:1000,each=4)
var1 <- case + rnorm(4000)
var2 <- case + rexp(4000)
var3 <- case + runif(4000,-1,1)
origin <- rep(factor(letters[1:4]),each=1000)
ROC.MRC(case,group,cbind(var1,var2,var3),origin)

BushmanLab/hotROCs documentation built on May 6, 2019, 9:11 a.m.