plotlssVarReg: Plots graphics for a location, scale and shape regression...

View source: R/plotlssVarReg.R

plotlssVarRegR Documentation

Plots graphics for a location, scale and shape regression model

Description

plotlssVarReg is used to produce graphics for models fit in the VarReg package with the lssVarReg function. As the skew-normal distribution is used to fit this type of model, the data needs to be transformed from the SN parameters (location, scale and shape) to the typical mean, variance and skew parameters.

Usage

plotlssVarReg(x, knot.lines = FALSE, xlab = "x", ylab = "y")

Arguments

x

Object of class lssVarReg (output from lssVarReg).

knot.lines

Logical to show the knot lines on the graphics (if model is type "semi"). Default is TRUE

xlab

Label to be placed on the x axis of graphics (covariate)

ylab

Label to be placed on the y axis of graphics (outcome)

Value

A graphic is returned, as well as a dataframe. The graphic returned is a 2 by 2 plot of:

  • the mean function over the x-variable, with or without the knot lines indicated

  • the variance function over the x-variable, with or without the knot lines indicated

  • the skew function over the x-variable, with or without the knot lines indicated

  • a Q-Q plot of the squared residuals from the model, plotted against the Chi-squared (df=1) distribution. For data from a skew-normal distribution, these residuals should follow a Chi-squared (df=1) distribution, regardless of skew.

The dataframe returned contains the following columns:

  • x: x variable

  • y: y variable

  • eta: (\eta), the location parameter

  • omega: (\omega), the scale parameter

  • shape: (\nu), the shape parameter

  • predicted~mean: (\mu), the mean

  • predicted~variance: (\sigma^2), the variance

  • predicted~skewness: (\gamma), the skew

  • stand.res2: the standardised residuals squared.

See Also

lssVarReg

Examples

data(mcycle)
## not run. LSS model followed by the basic plot command
##lssmodel<-lssVarReg(mcycle$accel, mcycle$times,  locationmodel="linear", scale2model="linear",
##shapemodel="constant", maxit=10000)
##lssplot_out<-plotlssVarReg(lssmodel, xlab="Time in seconds", ylab="Acceleration")

VarReg documentation built on May 31, 2023, 8:44 p.m.