View source: R/plotlssVarReg.R
plotlssVarReg | R Documentation |
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.
plotlssVarReg(x, knot.lines = FALSE, xlab = "x", ylab = "y")
x |
Object of class lssVarReg (output from |
knot.lines |
Logical to show the knot lines on the graphics (if model is type "semi").
Default is |
xlab |
Label to be placed on the x axis of graphics (covariate) |
ylab |
Label to be placed on the y axis of graphics (outcome) |
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.
lssVarReg
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.