confint.margin | R Documentation |
Confidence interval method for class "'margin'"
## S3 method for class 'margin'
confint(object, parm, level = 0.95, ...)
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 |
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.
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.