cdf takes a data frame for a single experimental condition and
returns a vector of requested CDF values.
A data frame containing the data to be passed to the function.
At the very least, the data frame must contain columns named "accuracy"
logging the accuracy (1 for correct, 0 for error) and "rt" containing the
response time data. If the user wishes to find the average CDFs across
multiple subjects, then another column must be included ("subject") with
numbers identifying unique subjects. See
The quantile values to be found by the function. By default, the function finds the .1, .3, .5, .7, and .9 CDF values.
If set to 1, the function will find the CDFs of correct trials. Set to 2 to find the CDFs of error trials. Set to 3 to find CDFs of ALL trials. Note, though, that CDFs of error trials may be less accurate due to usually-low number of error trials.
Inform the function whether the data frame contains data from multiple subjects. If set to TRUE, the function returns the average CDF values across all subjects. If set to FALSE, the function assumes all data being passed is just from one subject.
The function only deals with one experimental condition. There is another
cdfAll) which will return CDFs for all experimental
conditions. If there are more than one subject in the data frame being
passed to this function, the function first finds the CDF values for each
subject, and then takes the average for each quantile. This average is then
returned to the user.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
### example of multiple subjects and default quantile values # only select the congruent data from the example data set data <- subset(exampleData, exampleData$congruency == "congruent") # get the CDFs getCDF <- cdf(data) ### example of single subject and different quantile values # only select subject 1 from the example data. Also, select only the # "absent" condition and incongruent trials. This is an example when working # with multiple conditions (besides target congruency). data <- subset(exampleData, exampleData$subject == 1 & exampleData$condition == "absent" & exampleData$congruency == "incongruent") # set new quantile values newQuantiles <- c(.1, .2, .3, .4, .5, .6, .7, .8, .9) # get the CDFs getCDF <- cdf(data, quantiles = newQuantiles, multipleSubjects = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.