Plots graphics for a location, scale and shape regression model
Source:R/plotlssVarReg.R
plotlssVarReg.Rd
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.
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 variabley
: y variableeta
: (\(\eta\)), the location parameteromega
: (\(\omega\)), the scale parametershape
: (\(\nu\)), the shape parameterpredicted~mean
: (\(\mu\)), the meanpredicted~variance
: (\(\sigma^2\)), the variancepredicted~skewness
: (\(\gamma\)), the skewstand.res2
: the standardised residuals squared.
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")