baseline_data {PupillometryR}R Documentation

Baseline pupil data to the average pupil size within a window

Description

This function is for use with the PupillometryR package to baseline each participant's pupil size to the mean pupil size within a window. This may not be necessary if you are doing purely within-subject analyses, but it is convenient for comparison across subjects, and makes results more uniform.

Usage

baseline_data(data, pupil, start, stop)

Arguments

data

a PupillometryR dataframe

pupil

a column name denoting pupil data

start

start time of baseline window

stop

stop time of baseline window

Value

A PupillometryR dataframe, with baselined pupil

Examples

Sdata <- make_pupillometryr_data(data = pupil_data,
                               subject = ID,
                               trial = Trial,
                               time = Time,
                               condition = Type)
regressed_data <- regress_data(data = Sdata, pupil1 = RPupil, pupil2 = LPupil)
mean_data <- calculate_mean_pupil_size(data = regressed_data,
pupil1 = RPupil, pupil2 = LPupil)
base_data <- baseline_data(data = mean_data, pupil = mean_pupil, start = 0, stop = 100)

[Package PupillometryR version 0.0.5 Index]