regress_data: Regress one pupil against another for extra smoothing

View source: R/make_smoothed_data.R

regress_dataR Documentation

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)

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

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. 25, 2023, 10:19 a.m.