Learn R Programming

diegr (version 0.2.0)

summary_stats_rt: Compute summary statistics of reaction times

Description

Calculates basic descriptive statistics of reaction time (RT). Statistics are computed separately for each combination of grouping variables present in the data (e.g., group, subject, condition).

Computed statistics include: the number of epochs, minimum, maximum, median, mean, and standard deviation of RT.

Usage

summary_stats_rt(data)

Value

A tibble with summary statistics of reaction times consisting of the following columns:

group

Group identifier (only if present in the input data).

subject

Subject identifier (only if present in the input data).

condition

Experimental condition (only if present in the input data).

n_epoch

Number of epochs.

min_rt

Minimum reaction time.

max_rt

Maximum reaction time.

median_rt

Median reaction time.

avg_rt

Mean reaction time.

sd_rt

Standard deviation of reaction time.

Arguments

data

A data frame or a database table with reaction times dataset. Required columns are epoch and RT (value of reaction time in ms). Optional columns: group, subject, condition for computing summary statistics per group/subject/condition.

Examples

Run this code
# 1. Summary statistics for rtdata
# two different subjects, no group or conditions - results are computed per subject
summary_stats_rt(rtdata)

# 2. Summary statistics for data with conditions
# a) create example data
data_cond <- rtdata
data_cond$condition <- c(rep("a", 7), rep("b", 7), rep("a", 8), rep("b",7))
# b) compute statistics per subject and condition
summary_stats_rt(data_cond)
# c) compute statistics per conditions regardless of subjects
# exclude "subject" column from computing
summary_stats_rt(data_cond[,-1])

Run the code above in your browser using DataLab