CA.rel: Create confidence-accuracy relationship object

View source: R/CA.rel.R

CA.relR Documentation

Create confidence-accuracy relationship object

Description

CA.rel() returns an object which can be placed into the different summary functions (e.g.,CA.curves(), CA.print()) to showcase the different aspect of the confidence-accuracy relationship.

Usage

CA.rel(data, confidence, correct, test, confidenceLevels, var = NULL,
  var.names = NULL, var.levels = NULL, jack = FALSE,
  confMin = NULL, confMax = NULL)

Arguments

data

Dataset used for analysis.

confidence

A string which identifies the variable that holds the confidence estimations.

correct

A string which identifies the variable that states whether a person made a correct identification rated as 0 incorrect and 1 correct.

test

A character string specifying the confidence-accuracy relationship test. The following is permitted: "CAL" (calibration) or "CAC" (confidence-accuracy characteristics)

confidenceLevels

A list or vector identifying the levels for which confidence is tested. Either all levels can be tested separately of confidence levels can also be collapsed.

var

A vector containing variable names, which allows comparison of calibration or CAC performance across different groups of those variables (e.g., choosers vs. nonchoosers).

var.names

A vector containing variable names that will be displayed in the graph.

var.levels

A vector to be declared if one wants to compare only specific levels of a certain variable with each other.

jack

A logical variable. If true, a jackknife SEs will be calculated to attain 95 percent confidence intervals for the C, OU, NRI statistics.

confMin

An integer, indicating the minimum value of the confidence scale used. It is only necessary to define this variable, if the confidenceLevel variable disregards the lower spectrum of the attainable confidence levels

confMax

An integer, indicating the maximum value of the confidence scale used. It is only necessary to define this variable, if the confidenceLevel variable disregards the higher spectrum of the attainable confidence levels

Details

For a more detailed explanation see the github page for a manual. https://github.com/IngerMathilde/CArelationship

Value

A CA.rel object that can be put into several summary functions

Author(s)

Inger van Boeijen <inger.vb.r@gmail.com>

Examples

library(jtools)
data(metamemoryCA)

# Compare choosers vs. nonchoosers with collapsed confidence groups and Jackknife SE
Ch <- CA.rel(data = metamemoryCA, confidence = "Confidence",
                      correct = "ChoiceCorrect", test = "CAL", var = "ChoiceChooser",
                      confidenceLevels = list(c(0,20),c(30,40), c(50,60), c(70,80), c(90,100)),
                      jack = TRUE)
CA.curves(Ch)
CA.table(Ch)

# Create CAC curves for high vs. low raters with adjusted variable names
data.CAC <- subset(metamemoryCA, ChoiceValue == "Target") #create a subset with only suspect ID
CAC <- CA.rel(data = data.CAC, confidence = "Confidence",
                       correct = "ChoiceCorrect", test = "CAC", var =
                       c("Rater.EMS.Relative.Face.Recognition", "Rater.EMS.Eyewitness.Ability"),
                       var.names = c("EMS Relative Face Recognition", "EMS Eyewitness Ability"),
                       var.levels = c('Low', 'High'),
                       confidenceLevels = list(c(0,60), c(70,80), c(90,100)))
CA.curves(CAC)
CA.table(CAC)



IngerMathilde/legalPsych documentation built on March 28, 2024, 10:10 p.m.