Description Usage Arguments Value Examples
View source: R/aggregate_responses.R
aggregate_responses
aggregates combined or binary responses and stores
them in a list together with additional variables and the stimulus variable.
The resulting object is required by plot_sdt_fit
and
make_stan_data
functions.
1 2 3 4 5 6 7 | aggregate_responses(
data,
stimulus = NULL,
response,
variables = NULL,
K = NULL
)
|
data |
a data frame containing stimulus and response variables. If SDT parameters are regressed on additional variables then these variables have to be present as well. |
stimulus |
a name of the stimulus variable in the provided data frame. The stimulus variable can be of any type but it must contain only two kinds of values. |
response |
a name of the response variable in the provided data frame.
This can be a binary classification response or a combined response (see
|
variables |
an optional vector of names of additional variables (such as a variable encoding group membership) that must by preserved in the resulting aggregated data object. |
a list with three components:
The data frame containing all the variables listed in the variables argument excluding the stimulus and response variables.
The stimulus variable representing the stimulus class as either 1 or 2.
The response counts matrix with K columns where K is the number of possible (combined or binary) responses.
1 2 3 4 5 | data(gabor)
gabor$resp = combined_response(gabor$stim, gabor$rating, gabor$acc)
## See how the lower (higher) combined response values are more common
## for the 1 (2) stimulus class
aggregate_responses(gabor, 'stim', 'resp')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.