Learn R Programming

eyeris (version 2.0.0)

summarize_confounds: Extract confounding variables calculated separately for each pupil data file

Description

Calculates various confounding variables for pupil data, including blink statistics, gaze position metrics, and pupil size characteristics. These confounds are calculated separately for each preprocessing step, recording block, and epoched timeseries in the eyeris object.

Usage

summarize_confounds(eyeris)

Value

An eyeris object with a new nested list of data frames: $confounds

The confounds are organized hierarchically by block and preprocessing step. Each step contains metrics such as:

  • Blink rate and duration statistics

  • Gaze position (x,y) mean and standard deviation

  • Pupil size mean, standard deviation, and range

  • Missing data percentage

Arguments

eyeris

An object of class eyeris derived from load_asc()

Examples

Run this code
# load demo dataset
demo_data <- eyelink_asc_demo_dataset()

# calculate confounds for all blocks and preprocessing steps
confounds <- demo_data |>
  eyeris::glassbox() |>
  eyeris::epoch(
    events = "PROBE_{type}_{trial}",
    limits = c(-1, 1), # grab 1 second prior to and 1 second post event
    label = "prePostProbe" # custom epoch label name
  ) |>
  eyeris::summarize_confounds()

# access confounds for entire timeseries for a specific block and step
confounds$confounds$unepoched_timeseries

# access confounds for a specific epoched timeseries
# for a specific block and step
confounds$confounds$epoched_timeseries
confounds$confounds$epoched_epoch_wide

Run the code above in your browser using DataLab