Skip to contents

Tabulates the normalised participant covariates without silently dropping or filling anything. Every row carries both denominators and both kinds of uncertainty, so a reader cannot see a share without seeing what it rests on:

Usage

sdt_participant_summary(x, fields = NULL, by = NULL)

Arguments

x

A sdt_participants object.

fields

Optional character vector of covariates to report. Defaults to every categorical covariate the dictionary normalises.

by

Optional column name to report within, typically "file" or "short_course_id". NULL, the default, pools the whole register.

Value

A tibble with one row per level, carrying n, n_filled, n_observed, n_records, share_observed, share_records, n_missing and share_missing.

Details

  • n — rows at this level, filled rows included.

  • n_filled — how many of those n came from a participant-level fill rather than from an answer somebody wrote down. Read n - n_filled as the observed count.

  • n_records — every row in the group, the denominator of share_records.

  • n_observed — rows where the raw field was actually recorded, taken from the .missing_ indicator, and the denominator of share_observed, which counts observed rows only.

  • n_missing, share_missing — what is not there, in the same row as the shares it is missing from.

This is the honest half of the missingness policy. The imputing half lives in sdt_course_composition(), which fills and flags.

Examples

if (FALSE) { # \dontrun{
p <- sdt_read_participants("TDSC_course_participant_relations.xlsx")
sdt_participant_summary(p)
sdt_participant_summary(p, fields = "seniority", by = "short_course_id")
} # }