Apply a subtractive or divisive baseline correction to pupil data. See https://dr-jt.github.io/pupillometry/ for more information.
pupil_baselinecorrect(
x,
bc_onset_message = "",
baseline_duration = 200,
type = "subtractive",
match = "exact",
no_pretrial = FALSE,
bc_onset.message = NULL,
pre.duration = NULL
)
dataframe.
Message string(s) that marks the onset of the segment to be baseline corrected. The values in the Stimulus column can be used here. Multiple values can be specified if multiple segments need to be baseline corrected.
Duration of baseline period(s). Multiple values can be specified if multiple segments need to be baseline corrected with different baseline durations. default: 200
Do you want to use "subtractive" or "divisive" baseline correction? default: "subtractive"
Is the message string an "exact" match or a "pattern" match?
The design of the task did not include a pretrial period to use for baseline correction. Therefore, use the end of the previous trial as the baseline period. default: FALSE
deprecated. see bc_onset_message
deprecated. see baseline_duration.
Adds a `Pupil_Diameter_bc` column to the data.
Baseline correction is calculated based on the median pupil size during a defined baseline period. That baseline period is defined with the
1) `bc_onset_message` argument that specifies a message string that is sent to the eye tracker at onset of the segment to be baseline corrected. The values in the Stimulus column can be used here. Multiple values can be specified if multiple segments need to be baseline corrected.
AND
2) `baseline_duration` argument that specifies the duration of the baseline period, before `bc_onset_message`, to use in calculating the median baseline pupil size.
Either "subtractive" or "divisive" baseline correction can be applied.