obsQuantiles: Calculate model fit

Description Usage Arguments Examples

View source: R/obsQuantiles.R

Description

This function is nothing but a wrapper for quantile.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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')

DstarM documentation built on Aug. 29, 2020, 1:06 a.m.