Learn R Programming

growcurves (version 0.2.4.1)

growplot: Plot by-subject and by-group growth curves

Description

Produces a by-subject plot of predicted growth curves with associated data values and an aggregated by-group plot of growth curves along with a smoother line for each group based on user input. Facilates inference for different growth curve patterns based on subsets of subjects and various subject groupings.

Usage

growplot(object, compare.objects = NULL, subjects.plot = NULL, groups.plot = NULL, subjects.subset = NULL, subjects.random = TRUE, x.lab = "Time", y.lab = "Fit", main.label = "Main_Model", title.lab = NULL)

Arguments

object
A dpgrow, dgrowmm or dpgrowmult object obtained from running the appropriate modeling function.
compare.objects
An optional list of dpgrow, dgrowmm or dpgrowmm objects to employ as comparison models for by-subject plotting
subjects.plot
A vector of subjects to use for by-group plot that is composed of some subset of subject. Defaults to all subjects modeled in object.
groups.plot
A vector with associated group identifiers for subjects.plot if the grouping is different from trt used to run the dpgrow or dpgrowmm model. The entered grouping does not have to relate to that used for modeling. Defaults to use of treatment groups modeled in object (if not entered).
subjects.subset
A vector of a subset of subjects.plot to use for by-subject plotting for readability. The full subjects.plot set is used for by group plotting. If left blank, the full subjects.plot vector is used for by-subject plotting.
subjects.random
A boolean scalar. If TRUE a random subset (of 10) is selected from subjects.plot for by-subject plotting. Leave blank if enter subjects.subset. Defaults to TRUE.
x.lab
Optional title for x-axis. Default = "Time"
y.lab
Optional title for y-axis. Default = "Fit"
main.label
An optional character model label for object to use in by-subject plots for comparison with models from compare.objects
title.lab
option plot title. A vector of 2 character entries is allowed. The first entry is the title for the group aggregated plot. The second entry is the title for the plot of selected subject growth curves. If title.lab contains a single entry, then it is used as the title for both plots. Otherwise, defaults to NULL.

Value

A list object containing a plot objects, data.frame object from which it is constructed, and data.frame with actual data values co-plotted.

See Also

dpgrowmm, dpgrow, dpgrowmult, growthCurve