calc_basic_stats: Calculate Basic Statistics for Response Times or Probability...

View source: R/core_stats.R

calc_basic_statsR Documentation

Calculate Basic Statistics for Response Times or Probability Densities

Description

Function that calls the underlying functions calc_basic_stats_obs and calc_basic_stats_pred. Handles input checks and data wrangling.

Usage

calc_basic_stats(
  pdf_u = NULL,
  pdf_l = NULL,
  rts_u = NULL,
  rts_l = NULL,
  one_cond,
  b_coding,
  t_vec = NULL,
  dt = NULL,
  skip_if_contr_low = NULL
)

Arguments

pdf_u, pdf_l

numeric, vectors of probability density values for the upper and lower boundaries.

rts_u, rts_l

numeric, vectors of response times for the upper and lower boundaries.

one_cond

character, a label for the condition.

b_coding

list, used for accessing the upper boundary label, determines the corresponding column of the returned data.frame (e.g., P_corr).

t_vec

numeric vector, containing the time points corresponding to the probability density values.

dt

a single numeric, providing the step size in t_vec.

skip_if_contr_low

a single numeric, threshold below which probability densities are ignored (default is obtained from drift_dm_skip_if_contr_low()).

Details

  • If pdf_u and pdf_l are provided, the function computes statistics for the probability densities.

  • If rts_u and rts_l are provided, the function computes statistics for the observed RTs.

  • If both sets of inputs are provided, both types of statistics are computed and returned.

Value

A data.frame with columns:

  • Source: Indicates whether the statistics refer to observed (obs) or predicted (pred) data.

  • Cond: A condition label.

  • ⁠Mean_<u_label>⁠: Mean response time for the upper boundary.

  • ⁠Mean_<l_label>⁠: Mean response time for the lower boundary.

  • ⁠P_<u_label>⁠: Proportion of upper-boundary responses.

See Also

calc_basic_stats_obs, calc_basic_stats_pred, new_stats_dm


dRiftDM documentation built on Dec. 1, 2025, 5:08 p.m.