plot.flexreg: Plot Method for 'flexreg' Objects

View source: R/Summaries.R

plot.flexregR Documentation

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 class 'flexreg'
plot(
  x,
  name.x,
  additional.cov.default = NA,
  smooth = TRUE,
  cluster = FALSE,
  type = "response",
  ...
)

Arguments

x

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

name.x

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

additional.cov.default

a list of additional covariates from the mean model and their value to be set as default.

smooth

a logical value indicating wheater the curves should be smooth (TRUE) or piecewise linear (FALSE, default).

cluster

logical. If the model is "FB" or "FBB", cluster = TRUE plots the cluster means. By default, cluster = FALSE.

type

a vector of characters indicating the regression curves to be plotted. Available options are "response" and "response.aug" for augmented models.

...

additional arguments. Currently not used.

Details

The function produces a scatterplot of the covariate from the mean model specified in name.x and y or y/n if the response is bounded continuous or discrete, respectively. Any other variable specified in the mean model must be set to a default through the additional.cov.default argument. The argument type = "response" plots the conditional mean curve (i.e., \mu), whereas the argument type = "response.aug", available only for augmented models, plots the augmented mean curve. If the regression model is of "FB" or "FBB" type and cluster = TRUE, then the function returns two additional curves corresponding to the component means, i.e., \lambda_1 and \lambda_2.

Examples

## Not run: 
data("Reading")
FB <- flexreg(accuracy.adj ~ iq + dyslexia, data = Reading)
plot(FB, name.x="iq", additional.cov.default = list("dyslexia"=1))

## End(Not run)


FlexReg documentation built on Sept. 29, 2023, 9:06 a.m.