plot.mvrm {BNSP}R Documentation

Creates plots of terms in the mean and/or variance models

Description

This function plots estimated terms that appear in the mean and variance models.

Usage

## S3 method for class 'mvrm'
plot(x, model, term, response, response2, intercept = TRUE, grid = 30, 
centre = mean, quantiles = c(0.1, 0.9), contour = TRUE, static = TRUE, 
centreEffects = FALSE, plotOptions = list(), nrow, ask = FALSE, 
plotEmptyCluster = FALSE, combine = FALSE, ...) 

Arguments

x

an object of class ‘mvrm’ as generated by function mvrm.

model

one of "mean", "stdev", or "both", specifying which model to be visualized.

term

the term in the selected model to be plotted.

response

integer number denoting the response variable to be plotted (in case there is more than one).

response2

only relevant for multivariate longitudinal data.

intercept

specifies if an intercept should be included in the calculations.

grid

the length of the grid on which the term will be evaluated.

centre

a description of how the centre of the posterior should be measured. Usually mean or median.

quantiles

the quantiles to be used when plotting credible regions. Plots without credible intervals may be obtained by setting this argument to NULL.

contour

relevant for 3D plots only. If contour=TRUE then plot.mvrm creates contour plots. contour=FALSE is allowed only for creating one plot at a time. The plot can be static or dynamic. See argument ‘static’.

static

relevant for 3D plots only. If static=TRUE then plot.mvrm calls function ribbon3D from package plot3D to create the plot. If static=FALSE then plot.mvrm calls function scatterplot3js from package threejs to create the plot.

centreEffects

if TRUE then the effects in the mean functions are centred around zero over the range of the predictor while the effects in the variance function are scaled around one.

plotOptions

for plots of univariate smooth terms or for plots of bivariate smooth terms where one of the two covariates is discrete, this is a list of plot elements to give to ggplot. For smooths of bivariate continuous covariates, this is a list of plot elements to give to ribbon3D (if static=FALSE) or to scatterplot3js (if static=TRUE).

nrow

the number of rows in the figure with the plots.

ask

if set to TRUE, plots will be displayed one at a time.

plotEmptyCluster

if set to TRUE, plots of empty clusters will be displayed. Relevant for multivariate longitudinal datasets.

combine

Binary indicator. It can be set to TRUE to simultaneously plot two terms. One of the terms must be continuous and the other must be discrete. This makes sense to set to TRUE when wanting to visualize groups that have a common slope.

...

other arguments.

Details

Use this function to obtain predictions.

Value

Predictions along with credible/pediction intervals

Author(s)

Georgios Papageorgiou gpapageo@gmail.com

See Also

mvrm

Examples

#see \code{mvrm} example

[Package BNSP version 2.2.3 Index]