mvgam_marginaleffects | R Documentation |
Helper functions for marginaleffects calculations in mvgam models
Functions needed for working with marginaleffects
Functions needed for getting data / objects with insight
## S3 method for class 'mvgam'
get_coef(model, trend_effects = FALSE, ...)
## S3 method for class 'mvgam'
set_coef(model, coefs, trend_effects = FALSE, ...)
## S3 method for class 'mvgam'
get_vcov(model, vcov = NULL, ...)
## S3 method for class 'mvgam'
get_predict(model, newdata, type = "response", process_error = FALSE, ...)
## S3 method for class 'mvgam'
get_data(x, source = "environment", verbose = TRUE, ...)
## S3 method for class 'mvgam_prefit'
get_data(x, source = "environment", verbose = TRUE, ...)
## S3 method for class 'mvgam'
find_predictors(
x,
effects = c("fixed", "random", "all"),
component = c("all", "conditional", "zi", "zero_inflated", "dispersion", "instruments",
"correlation", "smooth_terms"),
flatten = FALSE,
verbose = TRUE,
...
)
## S3 method for class 'mvgam_prefit'
find_predictors(
x,
effects = c("fixed", "random", "all"),
component = c("all", "conditional", "zi", "zero_inflated", "dispersion", "instruments",
"correlation", "smooth_terms"),
flatten = FALSE,
verbose = TRUE,
...
)
model |
Model object |
trend_effects |
|
... |
Additional arguments are passed to the |
coefs |
vector of coefficients to insert in the model object |
vcov |
Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values:
|
newdata |
Grid of predictor values at which we evaluate the slopes.
|
type |
string indicates the type (scale) of the predictions used to
compute contrasts or slopes. This can differ based on the model
type, but will typically be a string such as: "response", "link", "probs",
or "zero". When an unsupported string is entered, the model-specific list of
acceptable values is returned in an error message. When |
process_error |
|
x |
A fitted model. |
source |
String, indicating from where data should be recovered. If
|
verbose |
Toggle messages and warnings. |
effects |
Should model data for fixed effects ( |
component |
Which type of parameters to return, such as parameters for the conditional model, the zero-inflated part of the model, the dispersion term, the instrumental variables or marginal effects be returned? Applies to models with zero-inflated and/or dispersion formula, or to models with instrumental variables (so called fixed-effects regressions), or models with marginal effects (from mfx). See details in section Model Components .May be abbreviated. Note that the conditional component also refers to the count or mean component - names may differ, depending on the modeling package. There are three convenient shortcuts (not applicable to all model classes):
|
flatten |
Logical, if |
Objects suitable for internal 'marginaleffects' functions to proceed.
See marginaleffects::get_coef()
, marginaleffects::set_coef()
,
marginaleffects::get_vcov()
, marginaleffects::get_predict()
,
insight::get_data()
and insight::find_predictors()
for details
Nicholas J Clark
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.