regress_data: Regress one pupil against another for extra smoothing

Description Usage Arguments Value Examples

View source: R/make_smoothed_data.R

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

1
regress_data(data, pupil1, pupil2)

Arguments

data

a PupillometryR dataframe

pupil1

Column name for first pupil data

pupil2

Column name for second pupil data

Value

a PupillometryR dataframe with smoothed pupil values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

samhforbes/PupillometryR documentation built on Sept. 14, 2021, 11:50 p.m.