Check that response values use the expected coding
Source:R/check_response_coding.R
check_response_coding.RdFor the 2IFC pipeline, responses must be coded as {-1, 1}. Common
miscodings ({0, 1} or {1, 2}) produce classification images that
look plausible but are shifted or inverted. This check detects the
common miscodings explicitly and returns a status with a fix suggestion.
Usage
check_response_coding(
responses,
method = c("2ifc", "briefrc"),
col_response = "response",
...
)Value
An rcdiag_result() object.
Details
For the Brief-RC pipeline, responses may be binary {-1, 1} or
continuous weights. Anything numeric and finite is accepted.
Examples
responses <- data.frame(
participant_id = rep(1, 10),
stimulus = 1:10,
response = sample(c(-1, 1), 10, replace = TRUE)
)
check_response_coding(responses, method = "2ifc")
#> [PASS] Response coding
#> All 10 responses coded as {-1, 1}.