plot_qq.lmvar: QQ-plot for an object of class 'lmvar'

Description Usage Arguments Details See Also Examples

Description

Function produces QQ-plots for an object of class 'lmvar' and, optionally, for another object of class 'lm' or 'lmvar'.

Usage

1
2
## S3 method for class 'lmvar'
plot_qq(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_qq generic.

Details

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

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

See Also

plot_qq

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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_qq(fit_lmvar)

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

plot_qq(fit_lmvar, fit_lm)

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

plot_qq(fit_lmvar, fit_lmvar_width)

}

lmvar documentation built on May 16, 2019, 5:06 p.m.