plotPGMM | R Documentation |
Generates a "spaghetti plot" for longitudinal data for multiple subjects. If the results from the BayesBGMM function are supplied, each trajectory is colored by the estimated class membership of its subject, and the trajectory defined by the mean parameters for each class is shown in bold.\
plotPGMM <- (X,Y,Results=NA,xlab='X',ylab='Y',Colors=NULL,MeanColors=NULL,...)
X |
An array of dimensions N x M, where the ij'th value gives the j'th time point for subject i. |
Y |
An array of dimension N x M, where the ij'th value gives the outcome for subject i at the j'th time point. |
Results |
The output of an application of BayesPGMM() to the data X,Y. If Results=NA, only a spaghetti plot of the data will be generated. |
xlab |
X-axis label for the generated plot. |
ylab |
Y-axis label for the generated plot. |
Colors |
Colors for each class. Default is blue for class 1, red for class 2, green for class 3, gold for class 4, gray for class 5. |
MeanColors |
Colors for the trajectory defined by the mean parameters for each class. |
... |
(optional) Other parameters to pass to the plot() function. |
Eric F. Lock
data(SimData) plotPGMM(X,Y) ##Plot the data Results <- BayesPGMM(X,Y) ##Fit PGMM (can take about 5 minutes) plotPGMM(X,Y,Results) ##Plot results
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.