drop_detect {dropout} | R Documentation |
drop_detect
function detects participants who have dropped out of a survey.
It identifies sequences of NA values up to the last survey question and pinpoints the column where the dropout occurred.
It also provides the index of that column, enabling targeted analysis of dropout patterns.
drop_detect(data, last_col = NULL)
data |
A dataframe or tibble containing the survey data. |
last_col |
The index position or column name of the last survey item. This is optional and is used when there are additional columns in the data frame that are not part of the survey questions you are interested in. |
A dataframe or tibble where each row corresponds to a row in the original dataset. It contains three columns:
dropout
: A logical indicating whether a dropout was detected for this row.
dropout_column
: If dropout
is TRUE, the name of the column where the dropout occurred.
dropout_index
: If dropout
is TRUE, the index (column number) where the dropout occurred.
See vignette for detailed workflows and practical examples.
# Basic usage
drop_detect(flying, "location_census_region")