plot.bbreg: plot.bbreg

Description Usage Arguments See Also Examples

View source: R/2_diagnostic_functions.R

Description

Function to build useful plots for bounded regression models.

Usage

1
2
## S3 method for class 'bbreg'
plot(x, which = c(1, 2, 3, 4), ask = TRUE, main = "", qqline = TRUE, ...)

Arguments

x

object of class "bbreg" containing results from the fitted model. If the model is fitted with envelope = 0, the Q-Q plot will be produced without envelopes.

which

a number of a vector of numbers between 1 and 4. Plot 1: Residuals vs. Index; Plot 2: Q-Q Plot (if the fit contains simulated envelopes, the plot will be with the simulated envelopes); Plot 3: Fitted means vs. Response; Plot 4: Residuals vs. Fitted means.

ask

logical; if TRUE, the user is asked before each plot.

main

character; title to be placed at each plot additionally (and above) all captions.

qqline

logical; if TRUE and the fit does not contain simulated envelopes, a qqline will be added to the normal Q-Q plot.

...

graphical parameters to be passed.

See Also

summary.bbreg, coef.bbreg, vcov.bbreg, fitted.bbreg, predict.bbreg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n <- 100
x <- cbind(rbinom(n, 1, 0.5), runif(n, -1, 1))
v <- runif(n, -1, 1)
z <- simdata_bes(
  kap = c(1, 1, -0.5), lam = c(0.5, -0.5), x, v, repetitions = 1,
  link.mean = "logit", link.precision = "log"
)
z <- unlist(z)
fit <- bbreg(z ~ x | v, envelope = 10)
plot(fit)
plot(fit, which = 2)
plot(fit, which = c(1, 4), ask = FALSE)

vpnsctl/bbreg documentation built on March 14, 2021, 12:11 a.m.