Provides a normative summary for one or more subjects across multiple timepoints. Generates numeric histograms with subject lines colored by time, categorical barplots with subject highlight, and a combined Z-score barplot distinguishing timepoints. Histogram bounds exclude the subject(s) so that the display is reproducible if only one row changes.

longitudinalNormativeSummary(
  data,
  subject_idx,
  columns,
  idcolumn = "commonID",
  timecol = "yearsbl",
  sexcol = "commonSex",
  agecol = "commonAge",
  return_plot = FALSE,
  verbose = FALSE
)

Arguments

data

Data frame containing all subjects and measures.

subject_idx

Vector of row indices of the subjects of interest.

columns

Vector of column names to summarize.

idcolumn

Name of subject ID column (default = "commonID").

timecol

Name of time variable (default = "yearsbl").

sexcol

Name of sex column (default = "commonSex").

agecol

Name of age column (default = "commonAge").

return_plot

Logical, whether to return the combined grid plot.

verbose

Logical, whether to print debugging info.

Value

A list with:

summary

List of numeric and categorical summaries, including Z-scores.

plots

List of individual ggplot objects per column.

zplot

Z-score barplot across numeric columns and timepoints.

grid

Combined gridExtra::arrangeGrob object for all plots.