Learn R Programming

lmvar (version 1.5.2)

plot_qdis.lmvar: Plot of the distribution of quantiles for an object of class 'lmvar'

Description

Function produces plot of the distribution of quantiles for an object of class 'lmvar' and, optionally, for another object of class 'lm' or 'lmvar'.

Usage

# S3 method for lmvar
plot_qdis(object_1, object_2 = NULL, ...)

Arguments

object_1

Object of class 'lmvar'

object_2

Object of class 'lm' or class 'lmvar'

...

for compatibility with plot_qdis generic.

Details

If object_2 is specified, a plot for object_1 and one for object_2 will be combined in the same plot.

If object_2 is of class 'lm', it must contain the response vector \(y\). I.e., one must run lm with argument y = TRUE.

See Also

plot_qdis

Examples

Run this code
# NOT RUN {
if (interactive()){

library(lmvar)

# create a 'lmvar' model using the 'iris' data set
X = model.matrix(~ Species - 1, data = iris)
fit_lmvar = lmvar(iris$Petal.Length, X, X)

plot_qdis(fit_lmvar)

# compare 'lmvar' model with linear model
fit_lm = lm( Petal.Length ~ Species, data = iris, y = TRUE)

plot_qdis(fit_lmvar, fit_lm)

# check whether inclustion of petal in model improves distribution of quantiles
X = model.matrix(~ Species + Petal.Width - 1, data = iris)
fit_lmvar_width = lmvar(iris$Petal.Length, X, X)

plot_qdis(fit_lmvar, fit_lmvar_width)

}
# }

Run the code above in your browser using DataLab