format2to4 {sdtalt} | R Documentation |
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.
format2to4(subno, isold, sold, cnames = c("subno", "hits", "fas", "misses", "crs"), ...)
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 |
An nx5 dataframe
Daniel B. Wright
Wright, D.B., Horry, R., & Skagerberg, E.M. (in press). Functions for traditional and multilevel approaches to signal detection theory. Behavior Research Methods.
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