This function cleans a scores dataset, based on the standard data structure, returning a dataset focused on provider-variable analysis.

clean_provider(
  data,
  state_filter = NULL,
  id_col = NULL,
  remove_questions = TRUE,
  condense = FALSE,
  clean_id = TRUE
)

Arguments

data

The TRT scores dataset.

state_filter

A character vector identifying the state(s) of interest. Defaults to NULL.

id_col

Differing variable naming structure for participant ID. (Eg. "X", or another name not similar to "participant" or "ID".) Defaults to NULL.

remove_questions

Defaults to TRUE. When TRUE, removes question item variables.

condense

Defaults to FALSE. When true, take medians across participants in order to keep only unique combinations of provider and service.

clean_id

TRUE or FALSE. Defaults to TRUE, when TRUE, rows where participant ID is missing are removed.

Value

A cleaned data frame, including only provider-relevant variables, restructured.