plotPGM | R Documentation |
Generates a "spaghetti plot" for longitudinal data for multiple subjects. If the results from the BayesBGMMfunction are supplied, each trajectory is colored gray, and the trajectory defined by the mean parameters is shown in bold.\
plotPGMM <- (X,Y,Results=NA,xlab='X',ylab='Y',...)
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. |
... |
(optional) Other parameters to pass to the plot() function. |
Eric F. Lock
data(SimData) X=X[1:10,]; Y=Y[1:10,] ###Take 10 samples belonging to single class plotPGM(X,Y) ##Plot the data Results <- BayesPGM(X,Y) ##Fit PGM (can take about 5 minutes) plotPGM(X,Y,Results) ##Plot results
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.