confint.margin: Confidence interval for marginal effect

View source: R/adjrr.R

confint.marginR Documentation

Confidence interval for marginal effect

Description

Confidence interval method for class "'margin'"

Usage

## S3 method for class 'margin'
confint(object, parm, level = 0.95, ...)

Arguments

object

An object of class "'margin'" resulting from a call to margin

parm

No effect.

level

the confidence level required

...

additional argument(s) for methods

Details

Computes confidence intervals using a standard Wald test for the marginal effect. If argument 'df' is used, then a t-statistic is use to construct the interval with 'df' degrees of freedom, otherwise a z-statistic is used.

Value

A named vector giving lower and upper confidence limits for the marginal effect. They will be labelled as (1-level)/2 and 1-(1-level).2 An argument df can be provided to use a t-test to construct the confidence interval.

Examples

## fit a model using glmmTMB
fit <- glmmTMB::glmmTMB(y ~ Treatment + x1 + x2 + x3 + x4 + (1|Cluster),
  data = trial_data, family = binomial(link="logit"),REML = TRUE)
## relative risk, average over random effects and fixed effects
m1 <- margin(fit,
       x = "Treatment",
       type = "ratio",
       average = c("x1","x2","x3","x4"),
       re = "average",
       se="GLS")
confint(m1)

marginme documentation built on Aug. 8, 2025, 6:17 p.m.