
Last chance! 50% off unlimited learning
Sale ends in
flexreg
ObjectsMethod for plotting regression curves for the mean from fitted regression model objects of class `flexreg`
.
# S3 method for flexreg
plot(
x,
name.x,
additional.cov.default = NA,
smooth = TRUE,
cluster = FALSE,
type = "response",
...
)
an object of class `flexreg`
, usually the result of flexreg
or flexreg_binom
functions.
a character containing the name of the covariate from the mean model to be plotted on the x-axis of the scatterplot.
a list of additional covariates from the mean model and their value to be set as default.
a logical value indicating wheater the curves should be smooth (TRUE
) or piecewise linear (FALSE
, default).
logical. If the model is "FB"
or "FBB"
, cluster = TRUE
plots the cluster means. By default, cluster = FALSE
.
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.
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., 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.,
if (FALSE) {
data("Reading")
FB <- flexreg(accuracy.adj ~ iq + dyslexia, data = Reading)
plot(FB, name.x="iq", additional.cov.default = list("dyslexia"=1))
}
Run the code above in your browser using DataLab