plot_p_a_one_item.Rd
Creates a line plot of the percentage of children passing a specific item as a function of age, D-score, or other continuous item, optionally including individual-level responses as rug plots.
A data frame containing summarized pass rate data, with
variables including item
, p
(percent pass), a
(mean age),
n
(sample size), and cohort
.
Optional data frame of individual responses to the item,
used to add rug plots. Should include item
, age
/dscore
,
response
and cohort
.
Only relevant for long shape. Character string with the
name of the column containing item names. The default is item_var = "item"
.
Only relevant for long shape. Character string with
the name of the column containing responses. The default is
response_var = "response"
.
Variable representing the continuous x-axis (e.g., age in months, or D-score).
Variable by which to group the data for plotting.
Value of the item to filter and plot.
Item index or number (used for annotation).
Minimum number of observations required to include a point. Defaults to 10.
Optional model name used as annotation in the plot.
Numeric vector of length 2 specifying x-axis limits
(in months). Defaults to c(0, 60)
.
Sequence of breaks for the x-axis. Defaults to
seq(0, 60, 6)
.
Label for the x-axis. Defaults to "Age (in months)"
.
Maximum length of the item label to display.
Optional named vector of manual colors by cohort
.
If NULL
, colors are obtained using get_palette()
.
Color to use for missing values. Default is "grey"
.
A ggplot
object.