Method for plotting regression curves for the mean from fitted regression model objects of class flexreg.
## 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., μ), 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., λ1 and λ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)