---
title: "Using dropout"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Using dropout}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

## Introduction

Survey data frequently faces the issue of dropout — situations where participants leave sections of the survey incomplete. Effectively managing dropouts is key to preserving data quality and gaining a deeper understanding of participants' response patterns. The dropout package addresses this challenge by providing tools to analyze and interpret participant behavior throughout the survey process.

## Use cases of the dropout package

  * Identifying the specific survey points where participants tend to stop completing the survey.
  * Detecting sections that are frequently skipped by respondents.
  * Quantifying the extent and locations of dropouts within the survey.
  * Estimating the proportion of missing values attributed to dropouts in each column.
  * Profiling respondents who discontinued the survey and pinpointing their dropout points.

```{r}
library(dropout)
```
## Quantifying Dropout with `drop_summary`
The `drop_summary` function provides an overview of where and to what extent participants tend to stop answering questions. It highlights patterns of missing values, such as whether participants are skipping specific questions or entire sections of the survey.

```{r}
drop_summary(flying)
```
## Detecting Specific Dropouts with `drop_detect`
For a more detailed analysis, the `drop_detect` function identifies individual participants who dropped out of the survey. It returns the index of the participant and the column where the dropout occurred, helping you focus on the critical dropout points.

```{r}
drop_detect(flying) |>
  head()
```
## Data Cleaning Based on Dropout Information
With the output from drop_detect, you can refine your data by filtering participants. For instance, you may choose to retain only those who completed most of the survey or analyze patterns of early dropout for further insights.
