format4to2 {sdtalt}R Documentation

Changes data for sdt to data for mlmsdt

Description

Changes data in the form of hits, false alarms, misses, and correct rejections (which is suitable for the sdt function) for each individual into a file with one trial per line suitable for mlmsdt. See Wright, Horry and Skagerberg (in press, Behavior Research Methods).

Usage

format4to2(x, cnames = c("subno", "isold", "saysold"), code = 0.5, ...)

Arguments

x dataframe with subject number, hits, false alarms, misses, and CR
cnames names to output
code code for isold and saysold
... other parameters passed

Details

code - default is -.5 for new and +.5 for old for isold. Put 1 in for 0 and 1. saysold is 0 and 1

Value

A three column dataframe with length equal the number of trials is produced.

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

format4 <- rbinom(100,25,.5)
dim(format4) <- c(25,4)
format4 <- cbind(1:25,format4)
dim(format4)
format4[1:5,]
format2 <- format4to2(format4)
dim(format2)
format2[1:5,]

[Package sdtalt version 0.1-0.1 Index]