This is an internal function that is used to remove incomplete observations
from a data.frame
. It removes (1) explicit NAs and (2) cases with
implicit NAs, i.e. participants who did not provide observations for all
combinations of (possibly multiple) within-subjects factors.
complete_observations(data, id, within, dv)
A data.frame
where NAs and incomplete observations are removed.
It also has up to two additional attributes removed_cases_explicit_NA
and removed_cases_implicit_NA
, carrying the subject identifiers of
participants whose data has been removed.
The data.frame
to be processed.
Character. Name of the column containing the subject identifier.
Character. Names of the columns containing within-subjects factors.
Character. Name of the column containing the dependent variable.