Apply [count_transitions()] to each named item shared by pre-test and post-test data. The response-cell schema is inferred after applying `na_as`.

count_item_transitions(
  pre_test,
  post_test,
  ...,
  subgroup = NULL,
  include_aggregate = FALSE,
  na_as = c("dk", "missing"),
  missing_action = c("omit", "error")
)

Arguments

pre_test

Data frame containing one pre-test item per column.

post_test

Data frame containing the corresponding post-test items.

...

Must be empty. Its presence requires optional arguments to be named.

subgroup

Optional logical vector selecting observations to count.

include_aggregate

Whether to append an `aggregate` row containing column sums across items.

na_as

Classification of `NA` responses: `"dk"` treats them as observed don't-know responses and `"missing"` treats them as structural missingness.

missing_action

How to handle structural missingness: `"omit"` excludes incomplete pairs and `"error"` rejects them.

Value

A visible integer matrix with items in rows and inferred transition cells in columns.