Learn R Programming

FlexReg (version 1.1)

plot.flexreg: Plot method for flexreg Objects

Description

Method for plotting regression curves for the mean from fitted regression model objects of class `flexreg`.

Usage

# S3 method for flexreg
plot(x, name.x, additional.cov.default = NA, ...)

Arguments

x

an object of class `flexreg`, usually the result of flexreg or flexreg_binom.

name.x

a character containing the name of the covariate to be plotted on the x-axis of the scatterplot.

additional.cov.default

a list of additional covariates to be set as default.

...

additional arguments. Currently not used.

Details

The function produces a scatterplot of the covariate specified in name.x and y or y/n if the response is continuous bounded or binomial, respectively. Any other variable involved in the formula must be set to a default through the additional.cov.default argument. If the regression model is of FB or FBB type the function returns a scatterplot with three curves, one corresponding to the overall mean and two corresponding to the component means of the FB distribution, i.e., \(\lambda_1\) and \(\lambda_2\).

Examples

Run this code
if (FALSE) {
data("Reading")
FB <- flexreg(accuracy ~ iq+dyslexia, Reading, n.iter=800)
plot(FB, name.x="iq", additional.cov.default = list("dyslexia"=1))
}

Run the code above in your browser using DataLab