estimateit | R Documentation |
Estimate marginal effects for binary exposure and outcome
estimateit(weightitobj, outcome, data)
weightitobj |
A WeightIt object |
outcome |
A binary outcome variable |
data |
A data frame containing the outcome |
Returns a summary table as a tibble, the model, and the individual effects (Control, Treatment, D=their difference, logRR= their log relative "risk", logOR=their log odds ratio). The individual effects are svrepstat objects that can be further analysed using relevant survey functions. The table displays the exponential of the log relative effects. In other words the relative risk and the odds ratio.
library(WeightIt) library(tibble) library(tidyr) dfvi <- tibble( C = rep(0:1, each = 4), X = rep(0:1, times = 4), Y = rep(0:1, times = 2, each = 2), N = c(96, 36, 64, 54, 120, 120, 30, 480) ) %>% uncount(N) W1 <- weightit(X ~ C, data = dfvi, method = "ps", estimand = "ATE") summary(W1) E1 <- estimateit(weightitobj=W1, outcome=Y, data=dfvi) E1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.