robincar_mh | R Documentation |
This function estimates Mantel-Haenszel risk difference and average treatment effect.
robincar_mh(
df,
treat_col,
response_col,
strata_cols,
estimand = "ATE",
ci_type = "mGR"
)
df |
A data.frame with the required columns |
treat_col |
Name of column in df with treatment variable. Must be binary |
response_col |
Name of the column in df with response variable |
strata_cols |
Names of columns in df with strata variables |
estimand |
A character string specifying the estimand. One of "MH" or "ATE" (default). See Details |
ci_type |
A character string specifying the type of confidence interval. One of "GR", "mGR" (default), "Sato" |
The estimand of interest can be either Mantel-Haenszel risk difference or Average Treatment Effect (ATE). The latter is the default option of 'estimand'. When 'estimand="ATE"', 'ci_type' is limited to the modified Greenland variance estimator (mGR). Otherwise, Greenland's variance estimator (GR) and Sato's variance estimator are optional.
df <- RobinCar:::data_sim
df$y_bin = ifelse(df$y>2.5, 1, 0)
robincar_mh(df = df[df$A!=2,],
treat_col = "A",
response_col = "y_bin",
strata_cols = c("z1", "z2"),
estimand = "MH",
ci_type = "mGR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.