5. plot.srafit {sra}R Documentation

Plotting "srafit" objects

Description

These functions plot in a nice way the content of objects of class srafit, the result of sra model fitting.

Usage

## S3 method for class 'srafit'
 plot(x, series = levels(x$data$rep), resid = FALSE, 
			variance = FALSE, ...)
sraPlotMean(srafit, series=levels(srafit$data$rep), legend=TRUE, 
               		xlim=NULL, ylim=NULL, xlab=NULL, ylab=NULL, pch=1, ...)
sraPlotMeanResid(srafit, series=levels(srafit$data$rep))
sraPlotVar (srafit, series=levels(srafit$data$rep), legend=TRUE, 
            		xlim=NULL, ylim=NULL, xlab=NULL, ylab=NULL, pch=1, ...)
sraPlotVarResid (srafit, series=levels(srafit$data$rep))
sraPlotlegend(labels, estimates, AIC=NULL, confint=NULL, 
                       	location="topleft")
sraFormatlegend(names, values, AIC=NULL, ...)

Arguments

x

An object of class srafit

srafit

An object of class srafit

series

The identifier (rep) of the time series that should be plotted. By default, all series are displayed.

resid

Whether or not the residuals (data - model expectation) should be displayed.

variance

If TRUE, the phenotypic variance is displayed. If FALSE (default), the phenotypic mean is displayed.

legend

If TRUE, a legend with the parameter estimates is displayed.

xlim

Same meaning as in plot. If NULL, a (hopefully) nice range is calculated.

ylim

Same meaning as in plot. If NULL, a (hopefully) nice range is calculated.

xlab

Same meaning as in plot. If NULL, a default label is provided.

ylab

Same meaning as in plot. If NULL, a default label is provided.

pch

Same meaning as in par.

labels

Formatted labels of the names of the estimates in the legend.

estimates

Values of the parameter estimates.

AIC

Value of the AIC. If NULL, the AIC is not added to the legend.

confint

Confidence intervals of the parameters. If NULL (default), they are not displayed in the legend.

location

Location of the legend, corresponding to x in legend.

names

Names of the parameters (as defined in the models).

values

Values of the parameter estimates (as defined in the models).

...

For plot.srafit, sraPlotMean, sraPlotVar: Additional parameters for the function plot. For sraFormatlegend: Additional parameters to format.

Details

The only function that should be used by the end user is plot.srafit.

Author(s)

Arnaud Le Rouzic

See Also

sraAutoreg, sraCstvar.

Examples

########### Generating a dummy dataset ################

m <- c(12,11,12,14,18,17,19,22,20,19)
v <- c(53,47,97,155,150,102,65,144,179,126)
s <- c(15,14,14,17,21,20,22,25,24,NA)
n <- c(100,80,120,60,100,90,110,80,60,100)

########## Making a sra data set #######################
data <- sraData(phen.mean=m, phen.var=v, phen.sel=s, N=n)

cstvar <- sraCstvar(data)


plot(cstvar)
plot(cstvar, xlim=c(3,9))
plot(cstvar, var=TRUE, ylab="This is a custom Y axis label")
plot(cstvar, resid=TRUE, legend=FALSE, main="Constant variance model fit")

[Package sra version 0.1.4.1 Index]