
Summary method for average marginal effects
Source:R/marginal_effects.R
summary.marginal_effects.RdCreates a summary object that produces the detailed AME table (estimate, delta-method SE, z, p, confidence interval) when printed.
Usage
# S3 method for class 'marginal_effects'
summary(object, effects = TRUE, digits = 3, ...)See also
marginal_effects for the main analysis function.
Examples
survey_data$high_satisfaction <- as.integer(survey_data$life_satisfaction >= 4)
model <- logistic_regression(survey_data, high_satisfaction ~ age + income)
summary(marginal_effects(model))
#>
#> Average Marginal Effects Results
#> --------------------------------
#> - Formula: high_satisfaction ~ age + income
#> - Scale: Predicted probability
#> - Std. errors: Delta method
#> - N: 2115
#>
#> --------------------------------------------------------------------------
#> Term AME SE z p 95% CI Lower 95% CI Upper
#> --------------------------------------------------------------------------
#> age 2.41e-04 0.001 0.417 .677 -0.001 0.001
#> income 1.43e-04 6.51e-06 22.019 <.001 1.31e-04 1.56e-04 ***
#> --------------------------------------------------------------------------
#>
#> Factor rows show the average discrete change vs. the reference level.
#>
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05