format2to4 {sdtalt}R Documentation

Changes data for sdt to mlmsdt form

Description

Takes three variables (subject number, whether an item is old, and what the person says) and changes them into a dataframe with hits, false alarms, misses and correct rejections for each subject.

Usage

format2to4(subno, isold, sold, cnames = c("subno", "hits", "fas", "misses", "crs"), ...)

Arguments

subno unique subject number for each individual
isold whether the item is old - higher number old
sold whether the person saysold - higher number old
cnames names for the five variables in the output dataframe
... other parameters passed

Value

An nx5 dataframe

Author(s)

Daniel B. Wright

References

Wright, D.B., Horry, R., & Skagerberg, E.M. (in press). Functions for traditional and multilevel approaches to signal detection theory. Behavior Research Methods.

Examples

madeup <- data.frame(rep(1:10,each=10),rep(0:1,50),rbinom(100,1,.5))
colnames(madeup) <- c("subno","isold","sayold")
madeup[1:5,]
madeup4 <- format2to4(madeup[,1],madeup[,2],madeup[,3])
madeup4

[Package sdtalt version 0.1-0.1 Index]