Counterfactual marginal effects from fitted distributional parameters
Source:R/adoption_workflow.R
marginal_effects.RdCounterfactual marginal effects from fitted distributional parameters
Usage
marginal_effects(
object,
newdata,
variable,
values = NULL,
parameter = "mu",
reference = NULL,
se.fit = FALSE,
level = 0.95,
vcov_method = "analytical",
...
)Arguments
- object
A fitted
gamlss.longitudinalobject.- newdata
Data used as the counterfactual baseline.
- variable
Single variable to vary.
- values
Values to assign to
variable. Defaults to observed factor levels for factors/characters or the 25th, 50th, and 75th percentiles for numeric variables.- parameter
Distributional parameter to summarize, usually
"mu".- reference
Optional reference value. Defaults to the first value.
- se.fit
Logical; when
TRUEandparameter = "mu", attach approximate delta-method standard errors for response-scale averages.- level
Confidence level used when
se.fit = TRUE.- vcov_method
Variance-covariance method passed to
vcov.gamlss.longitudinal().- ...
Additional arguments passed to
predict.gamlss.longitudinal().