Description Usage Arguments Details See Also Examples
Function produces QQ-plots for an object of class 'lm' and, optionally, for another object of class 'lm' or 'lmvar'.
1 2 |
object_1 |
Object of class 'lm' |
object_2 |
Object of class 'lm' or class 'lmvar' |
... |
for compatibility with |
If object_2
is specified, a QQ-plot for object_1
and one for object_2
will be
combined in the same plot.
All inputs of class 'lm' must contain the response vector y. I.e., one must run lm
with argument y = TRUE
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | if (interactive()){
library(lmvar)
# create a linear model using the 'iris' data set
fit_lm = lm( Petal.Length ~ Species, data = iris, y = TRUE)
plot_qq(fit_lm)
# compare 'lm' with 'lmvar' fit
X = model.matrix(~ Species - 1, data = iris)
fit_lmvar = lmvar(iris$Petal.Length, X, X)
plot_qq(fit_lm, fit_lmvar)
# check whether inclustion of petal in model improves QQ-plot
fit_lm_width = lm( Petal.Length ~ Species + Petal.Width, data = iris, y = TRUE)
plot_qq(fit_lm, fit_lm_width)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.