PupillometryR (version 0.0.5)

regress_data: Regress one pupil against another for extra smoothing

Description

regress_data runs a simple linear regression of pupil1 against pupil2 and the reverse. This can help to account for small amount of bumpiness in the data. The regression runs over each participant and each trial, per time.

Usage

regress_data(data, pupil1, pupil2)

Value

a PupillometryR dataframe with smoothed pupil values

Arguments

data

a PupillometryR dataframe

pupil1

Column name for first pupil data

pupil2

Column name for second pupil data

Examples

Run this code
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)

Run the code above in your browser using DataLab