make_time_window_data {eyetrackingR}R Documentation

Make a dataset collapsing over a time-window

Description

Collapse time across our entire window and return a dataframe ready for analyses

Usage

make_time_window_data(
  data,
  aois = NULL,
  predictor_columns = NULL,
  other_dv_columns = NULL,
  summarize_by = NULL
)

Arguments

data

The output of make_eyetrackingr_data

aois

Which AOI(s) is/are of interest? Defaults to all specified in make_eyetracking_r_data

predictor_columns

Which columns indicate predictor vars, and therefore should be preserved in grouping operations?

other_dv_columns

Within each participant/trial (or whatever is specified in summarize_by), this function will calculate not only proportion-looking, but also the mean of any columns specified here.

summarize_by

Should the data be summarized along, e.g., participants, items, etc.? If so, give column names here. If left blank, will leave trials distinct. The former is needed for more traditional analyses (t.test, ANOVA), while the latter is preferable for mixed-effects models (lmer)

Details

Aside from proportion looking (Prop), this function returns several columns useful for subsequent analysis:

Value

Data with proportion-looking and transformations (logit, arc-sin, etc.)

Examples

data(word_recognition)
data <- make_eyetrackingr_data(word_recognition,
                               participant_column = "ParticipantName",
                               trial_column = "Trial",
                               time_column = "TimeFromTrialOnset",
                               trackloss_column = "TrackLoss",
                               aoi_columns = c('Animate','Inanimate'),
                               treat_non_aoi_looks_as_missing = TRUE
)

# generate a dataset summarizing an AOI (Animate) by ParticipantName
response_window_agg_by_sub <- make_time_window_data(data,
                                                    aois='Animate',
                                                    summarize_by = "ParticipantName"
)

## Not run: 
# optionally included additional columns for use as predictors
# in later statistical models
response_window_agg_by_sub <- make_time_window_data(data,
                                                    aois='Animate',
                                                    predictor_columns=c('Age','MCDI_Total'),
                                                    summarize_by = "ParticipantName"
)

# plot the aggregated data for sanity check
plot(response_window_agg_by_sub, predictor_columns="Age", dv = "LogitAdjusted")

## End(Not run)


[Package eyetrackingR version 0.2.1 Index]