
Summarise Functional Curves by Group
functional_group_summary.RdComputes mean functional curves by group and, when exactly two groups are present, also returns the pointwise difference between those curves.
Arguments
- data
A data frame in long format.
- id_col
Subject identifier column.
- time_col
Time column, such as relative day or days after planting.
- value_col
Measured series column.
- group_col
Grouping column, such as disease status.
- time_grid
Optional grid where the summary curves are evaluated. If
NULL, the sorted observed time values are used. Supplying a denser grid is useful when plotting smoothed curves as continuous functions.- method
Smoothing method used on the group mean curves. One of
"none","lowess", or"spline".- smooth_args
Named list of extra arguments passed to the smoothing method. For
"lowess", a common choice islist(f = 0.2). For"spline", typical choices includelist(df = 12)orlist(spar = 0.6).