View source: R/predict.heckmange.R
predict.heckmanGE | R Documentation |
Generates predictions from a fitted heckmanGE
model. Predictions can be made on the scale of the linear predictors or on the scale of the response variable. The function can also return confidence intervals for the predictions if requested.
## S3 method for class 'heckmanGE'
predict(
object,
...,
part = c("selection", "outcome", "dispersion", "correlation"),
newdata = NULL,
type = c("link", "response"),
cofint = FALSE,
confidence_level = 0.95
)
object |
An object of class |
... |
Argumentos adicionais passados para métodos específicos. Este argumento é mantido para compatibilidade com a função genérica |
part |
A character vector specifying the model part for which to make predictions. Options include "selection", "outcome", "dispersion", and "correlation". The default is "outcome". If multiple parts are specified, only the "outcome" part will be used. |
newdata |
Optionally, a data frame containing new data for making predictions. If omitted, the function uses the fitted linear predictors from the model object. |
type |
The type of prediction required. The default is "link", which returns predictions on the scale of the linear predictors. If "response" is specified, predictions are returned on the scale of the response variable after applying the inverse link function. |
cofint |
A logical indicating whether to return confidence intervals for the predictions. Default is FALSE. |
confidence_level |
A numeric value specifying the confidence level for the confidence intervals if |
The function first checks the validity of the part
and type
arguments.
If newdata
is provided, the function ensures it matches the variables and structure of the original model frame.
Predictions can be on the link scale or the response scale, depending on the type
argument.
Confidence intervals are calculated if cofint
is TRUE, using the standard errors derived from the model.
A vector or matrix of predictions from the heckmanGE
object, depending on the value of cofint
. If cofint
is TRUE, the function returns a matrix with the mean predicted value, and the lower and upper bounds of the confidence interval.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.