Plot Results from a GSLCCA Analysis

Share:

Description

Plot ‘signatures’ (loadings of the Y matrix) or (projected) observed and fitted values (Y and X scores) from an “gslcca” object.

Usage

1
2
3
4
5
6
7
    ## S3 method for class 'gslcca'
plot(x, type = "signature", series = x$treatment,
        mean = FALSE, overlay = length(agrep(type, "signature")), 
        ask = dev.interactive(), lattice = !length(agrep(type, "signature")), 
        main = NULL, xlab = NULL, ylab = NULL, col = NULL, lty = 1, lwd = 1.5, 
        pch = NULL, legend.x = "topright", space = "bottom", corner = NULL, 
        columns = 2, ...)

Arguments

x

an object of class "gslcca".

type

the type of plot: either "signature", "fitted" or "scores".

series

if x$treatment is NULL and there are multiple time series for each subject, a factor to differentiate these series.

mean

logical: if TRUE values are averaged over subjects.

overlay

for type = \"signature\" only, a logical value specifying whether to overlay signatures for different subjects on the same plot or create a separate plot for each subject.

ask

logical: if TRUE, the user is asked before each plot, see par(ask=.). Ignored when only one plot is produced.

lattice

logical: if TRUE the values for each subject are displayed in separate panels of a trellis plot.

main

an overall title for the plot.

xlab

a title for the x axis.

ylab

a title for the y axis.

col

a vector specifying a colour palette to use for the lines/points. By default the palette is specified by rainbow_hcl if available, otherwise the standard plotting colours are used.

lty

a vector of line types, see par.

lwd

a vector of line widths, see par.

pch

a vector of plotting characters, see points.

legend.x

a character vector to use in the legend.

space

when type = "fitted" and lattice = TRUE, the space outside the plot region in which to put the legend, see xyplot. Overrides the corner argument.

corner

when type = "fitted" and lattice = TRUE, the corner inside the plot region in which to put the legend, see xyplot.

columns

when type = "fitted" and lattice = TRUE, how many columns to use to format the legend, see xyplot.

...

arguments passed on to the plotting functions (plot for single curves, xyplot for trellis graphics, else matplot)

Details

For type = "signature", the loadings of the Y matrix from the GSLCCA analysis are displayed for each subject or their average is displayed, as specified by individual. When both individual and overlay are TRUE, the arguments col, lty and legend.x control the line style and legend text for each subject.

For type = "fitted", the X scores are displayed with lines. If there are multiple X scores for each time point, then a line is displayed for each times series specified by series (usually the treatment factor used in GSLCCA) and the arguments col, lty, pch and legend.x control the display for each series. By default, grey or black is used to display values corresponding to the reference treatment (specified by x$ref).

For type = "scores" the X scores are displayed as for type = "fitted" and points are added for the Y scores, again coloured by series.

Author(s)

Heather Turner

See Also

gslcca

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
data(clonidine)

### Separate critical exponential model for each treatment
result <- gslcca(spectra, "Critical Exponential",
    time = Time, treatment = Treatment, subject = Rat,
    subject.smooth = 4, data = clonidine)

## plot of individual signatures
plot(result, type = "signature", overlay = FALSE)

## plot of individual projected observed and fitted values
plot(result, type = "scores", lattice = FALSE)

## plot of individual projected fitted values
plot(result, type = "fitted", lattice = FALSE)

## plot of individual signatures - overlaid
plot(result, type = "signature")

## plot of individual signatures - lattice
plot(result, type = "signature", overlay = FALSE, lattice = TRUE)

## plot of individual projected observed and fitted values - lattice
plot(result, type = "scores")

## plot of individual projected fitted values - lattice
plot(result, type = "fitted")

## plot of mean signature
plot(result, type = "signature", mean = TRUE)

## plot of mean fitted
plot(result, type = "fitted", mean = TRUE)