predictions
predictions
Functions
Name | Description |
---|---|
avg_predictions | Predict average outcomes (TO DO) |
predictions | Predict outcomes using a fitted model on a specified scale for given combinations of values |
avg_predictions
predictions.avg_predictions(
model,=0.95,
conf_level=True,
vcov=True,
by=None,
newdata=None,
hypothesis=None,
equivalence=None,
transform=None,
wts )
Predict average outcomes (TO DO)
predictions
predictions.predictions(
model,=None,
variables=0.95,
conf_level=True,
vcov=False,
by=None,
newdata=None,
hypothesis=None,
equivalence=None,
transform=None,
wts=None,
eps_vcov )
Predict outcomes using a fitted model on a specified scale for given combinations of values of predictor variables, such as their observed values, means, or factor levels (reference grid).
This function handles unit-level (conditional) estimates and average (marginal) estimates based on the variables
and newdata
arguments. See the package website and vignette for examples: - https://vincentarelbundock.github.io/marginaleffects/articles/predictions.html - https://vincentarelbundock.github.io/marginaleffects/
Parameters
Name | Type | Description | Default |
---|---|---|---|
model | object | Model object. | required |
newdata | Union[None, DataFrame] | Grid of predictor values at which to evaluate predictions, by default predictions are made on the data used to fit the model. | None |
by | False |
||
wts | None |
||
transform | - transform = numpy.exp - transform = lambda x: x.exp() - transform = lambda x: x.map_elements() |
None |
|
hypothesis | None |
Returns
Name | Type | Description |
---|---|---|
DataFrame | A DataFrame with one row per observation and several columns: - rowid: row number of the newdata data frame - type: prediction type, as defined by the type argument - group: (optional) value of the grouped outcome (e.g., categorical outcome models) - estimate: predicted outcome - std_error: standard errors computed using the delta method. - p_value: p value associated with the estimate column. - s_value: Shannon information transforms of p values. - conf_low: lower bound of the confidence interval (or equal-tailed interval for Bayesian models) - conf_high: upper bound of the confidence interval (or equal-tailed interval for Bayesian models) |