plot_rt: Plot reaction time distributions

View source: R/plot_rt.R

plot_rtR Documentation

Plot reaction time distributions

Description

Visualize reaction time distributions from your model predictions. Overlay observed experimental data for reference.

Usage

plot_rt(simulated_output, observed_df, facet_x = c("item_idx"), facet_y = c())

Arguments

simulated_output

Output from run_simulation containing posterior predictions

observed_df

Your observed data as a data frame

facet_x

Variables to split plots horizontally. Default is "item_idx" to show separate plots for each item

facet_y

Variables to split plots vertically. Default is none (c())

Details

Posterior predictions are plotted directly at the trial level. This pools all simulated trials for the requested facets without condition-level aggregation.

Value

A plot showing predicted RT distributions (blue), with observed data (red) if provided

Examples

# Load example posterior simulation output
post_output_path <- system.file(
  "extdata", "rdm_minimal", "abc", "posterior", "neuralnet",
  package = "eam"
)
post_output <- load_simulation_output(post_output_path)

# Load example observed data
obs_file <- system.file(
  "extdata", "rdm_minimal", "observation", "observation_data.csv",
  package = "eam"
)
obs_df <- read.csv(obs_file)

# Plot RT distributions by item
plot_rt(post_output, obs_df, facet_x = c("item_idx"))

# Plot RT distributions by item and group
plot_rt(
  post_output,
  obs_df,
  facet_x = c("item_idx"),
  facet_y = c("group")
)


eam documentation built on March 29, 2026, 5:07 p.m.

Related to plot_rt in eam...