Skip to contents

Calculates participant retention across events in a longitudinal study. Shows the number and percentage of participants retained at each event compared to the baseline/first event.

Usage

get_retention_summary(
  project,
  baseline_event = NULL,
  definition = c("any_data", "complete_form"),
  form = NULL,
  datatable = FALSE
)

Arguments

project

A redcap_project object

baseline_event

Character. Name of the baseline event. If NULL, uses first event (default: NULL)

definition

Character. How to define retention: "any_data" (default) or "complete_form"

form

Character. If definition = "complete_form", which form to check (default: NULL)

datatable

Logical. If TRUE, returns a datatable output (default: FALSE)

Value

A data frame with retention statistics by event

Examples

if (FALSE) { # \dontrun{
project <- redcap_project()

# Get retention summary
retention <- get_retention_summary(project)

# Based on specific form completion
retention <- get_retention_summary(
  project,
  definition = "complete_form",
  form = "follow_up_survey"
)
} # }