mvgam_marginaleffects | R Documentation |
Helper functions for mvgam marginaleffects calculations
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 |
Should all predictor variables, predictor variables for the conditional model, the zero-inflated part of the model, the dispersion term or the instrumental variables be returned? Applies to models with zero-inflated and/or dispersion formula, or to models with instrumental variable (so called fixed-effects regressions). May be abbreviated. Note that the conditional component is also called count or mean component, depending on the model. |
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.