Internal helper functions that return a data.frame summarizing density
values for observed and predicted response times.
calc_dens_obs(
rts_u,
rts_l,
one_cond,
t_max = NULL,
discr = NULL,
scaling_factor = 1
)calc_dens(
pdf_u = NULL,
pdf_l = NULL,
t_vec = NULL,
t_max = NULL,
discr = NULL,
rts_u = NULL,
rts_l = NULL,
one_cond,
b_coding,
scaling_factor = 1
)
A stats_dm object (via new_stats_dm()) containing a
data.frame with columns:
Source: indicates whether the row is from observed ("obs") or
predicted ("pred") data.
Cond: the condition label.
Time: the time point corresponding to the density value.
Stat: type of density summary—"hist" or "kde" (for observed data),
or "pdf" (for predicted data).
Dens_<U>: density value for the upper response.
Dens_<L>: density value for the lower response.
The <U> and <L> placeholders are determined by the b_coding argument.
vectors of RTs for the upper and lower boundary
character label
a single numeric value specifying the maximum RT to consider.
Defaults to the smallest multiple of discr above the maximum RT. If
t_vec is provided, t_max defaults to the maximum value of t_vec.
a single numeric value defining the bin width for histogram and KDE estimation. Defaults to 0.015 (seconds).
a single numeric value, multiplied with the PDFs.
It is used to scale the corresponding probability mass
proportional to the number of trials per condition. Defaults to 1.0.
density values for the upper and lower boundary
the time space (required for the pdfs)
used for accessing the upper/lower boundary labels,
determines the corresponding columns of the returned data.frame
(e.g., Quant_corr).
calc_dens_obs() computes empirical histograms and kernel density
estimates for a single condition based on observed RTs.
calc_dens() serves as a general interface that combines observed and
predicted data into a single data.frame. Observed data (rts_u and
rts_l) is passed to calc_dens_obs(). Predicted data (pdf_u and
pdf_l) is wrapped into a data.frame that matches the structure returned
by calc_dens_obs(). If both are provided, observed and predicted data
are row-bound into a single data.frame.
These functions are used internally to support type = "density" in
calc_stats(), providing a full distributional overview.