roc_plot: A function to plot ROC curves. Note that the NA values in the...

View source: R/roc_plot.R

roc_plotR Documentation

A function to plot ROC curves. Note that the NA values in the data will be replaced with zero.

Description

A function to plot ROC curves. Note that the NA values in the data will be replaced with zero.

Usage

roc_plot(
  cp,
  ca,
  group = NULL,
  byDR = FALSE,
  cumdata = FALSE,
  grayscale = FALSE,
  ...
)

Arguments

cp

A vector of cp id rates or frequencies.

ca

A vector of ca id rates or frequencies.

group

Grouping variable to indicate group membership. Will create an ROC curve and calculate AUC for each group.

byDR

Whether to order ids by diagnosticity ratios. Defaults to FALSE.

cumdata

Whether to output the cumulative data that are used to create the ROC curves. Default to FALSE.

grayscale

Whether to produce the plot in grayscale. Defaults to FALSE.

...

Additional plotting parameters. For example, users can change x-axis and y-axis labels using xlab and ylab.

Value

Plot ROC curves and calculate AUCs as side effects.

References

Yueran Yang & Andrew Smith. (2022). "fullROC: An R package for generating and analyzing eyewitness-lineup ROC curves." Behavior Research Methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-022-01807-6")}

Andrew Smith, Yueran Yang, & Gary Wells. (2020). "Distinguishing between investigator discriminability and eyewitness discriminability: A method for creating full receiver operating characteristic curves of lineup identification performance". Perspectives on Psychological Science, 15(3), 589-607. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/1745691620902426")}

Examples

cpf1 <- c(100, 90, 80, 20, 10, 5)
caf1 <- c(6, 7, 15, 50, 75, 120)
roc_plot(cpf1, caf1)


cpf2 <- c(90, 40, 20)
caf2 <- c(10, 70, 80)
roc_plot(cpf2, caf2)

## plot two ROC curves
cpf <- c(cpf1, cpf2)
caf <- c(caf1, caf2)
group <- rep(letters[1:2], times = c(length(cpf1), length(cpf2) ) )
roc_plot(cpf, caf, group = group)


yuerany/fullROC documentation built on March 24, 2023, 4:11 a.m.