This function produces a canned ggplot object.

plot_pass(
  pass,
  data_rug = NULL,
  items = NULL,
  item_var = "item",
  response_var = "response",
  x_var = "a",
  by_var = "cohort",
  min_n = 10,
  model_name = "",
  xlim = NULL,
  xbreaks = NULL,
  xlab = NULL,
  label_trunc = 60,
  col_manual = NULL,
  na_value = "grey"
)

Arguments

pass

A data.frame with empirical probabilities per item. For age, the expected columns are item, cohort, p, a, n, equate and label. For D-score, the expected columns are item, cohort, dcut, p, d, n, equate and label.

data_rug

Optional data frame of individual responses to the item, used to add rug plots. Should include item, age/dscore, response and cohort.

items

Character vector with item names. If not specified, all columns in the data are included as items (for wide shape) or all items in the item column are included (for long shape).

item_var

Only relevant for long shape. Character string with the name of the column containing item names. The default is item_var = "item".

response_var

Only relevant for long shape. Character string with the name of the column containing responses. The default is response_var = "response".

x_var

Variable representing the continuous x-axis (e.g., age in months, or D-score).

by_var

Variable by which to group the data for plotting (e.g. cohort).

min_n

Minimum number of observations required to include a point. Defaults to 10.

model_name

Optional model name used as annotation in the plot.

xlim

Numeric vector of length 2 specifying x-axis limits (in months).

xbreaks

Sequence of breaks for the x-axis.

xlab

Label for the x-axis.

label_trunc

Maximum length of the item label to display.

col_manual

Optional named vector of manual colors by cohort. If NULL, colors are obtained using get_palette().

na_value

Color to use for missing values. Default is "grey".

Value

A ggplot object.