R/make_smoothed_data.R
regress_data.Rd
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.
regress_data(data, pupil1, pupil2)
a PupillometryR dataframe
Column name for first pupil data
Column name for second pupil data
a PupillometryR dataframe with smoothed pupil values
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)