summarize_confounds {eyeris} | R Documentation |
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)
Arguments
eyeris |
An object of class |
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
Examples
# 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
[Package eyeris version 2.1.0 Index]