Learn R Programming

DstarM (version 0.4.0)

obsQuantiles: Calculate model fit

Description

This function is nothing but a wrapper for quantile.

Usage

obsQuantiles(data, probs = seq(0, 1, 0.01), what = "cr")

Arguments

data

A dataframe with: a column named rt containing response times in ms, a column named response containing at most 2 response options, and an optional column named condition containing a numeric index as to which conditions observations belong.

probs

vector of probabilities for which the corresponding values should be called

what

Character. 'cr' if the quantiles are to be calculated per condition-response pair, 'c' if the quantiles are to be calculated per condition, and 'r' if the quantiles are to be calculated per response.

Examples

Run this code
tt = seq(0, 5, .01)
pars = c(.8, 2, .5, .5, .5, # condition 1
        .8, 3, .5, .5, .5,  # condition 2
        .8, 4, .5, .5, .5)  # condition 3
pdfND = dbeta(tt, 10, 30)
# simulate data
data = simData(n = 3e3, pars = pars, tt = tt, pdfND = pdfND)
probs = seq(0, 1, .01)
q = obsQuantiles(data, probs = probs)
matplot(probs, q, type = 'l', las = 1, bty = 'n')

Run the code above in your browser using DataLab