gen_a_start {OVtool} | R Documentation |
gen_a_start
Description
This function is a wrapper to ov_simgrid. It generates the a. a is used to control the strength of the relationshp between the unobserved counfounder, U, and the treatment indicator
Usage
gen_a_start(y, tx, residuals, es, rho, my_estimand)
Arguments
y |
A vector that represents the outcome. |
tx |
A vector for the treatment indicator (must be 0s and 1s). |
residuals |
A vector of residuals from regressing Y on X and controlling for treatment. |
es |
An effect size value to simulate over. |
rho |
A rho (correlation) value to simulate over. |
my_estimand |
"ATE" or "ATT" |
Value
gen_a_start returns a list containing the following components:
n1 |
scalar representing sample size of treatment group (treat == 1) |
ve1 |
1 - b1^2 multiplied by the variance of Ystar1 |
b1 |
bounded parameter for treatment group (treat == 1) that it with b0 are selected to set the correlation of the omitted variable and the outcome equal to rho |
es |
|
pi |
proportion of population that is in the treatment group (treat == 1) |
n0 |
scalar represnting sample size of control group (treat == 0) |
ve0 |
1 - b0^2 multiplied by the variance of Ystar0 |
b0 |
bounded parameter for control group (treat == 0) that it with b1 are selected to set the correlation of the omitted variable and the outcome equal to rho |
n |
scalar representing the total sample size |
ind |
vector of positions in data that represent treatment group (treat == 1) |
Rstar_1 |
Residuals in treatment group |
Rstar_0 |
Residuals in control group |
Examples
data(sud)
sud = data.frame(sud)
sud$treat = ifelse(sud$treat == "A", 1, 0)
sud$wts = sample(seq(1, 10, by=.01), size=nrow(sud), replace = TRUE)
outcome_mod = outcome_model(data = sud,
weights = "wts",
treatment = "treat",
outcome = "eps7p_3",
model_covariates = c("sfs8p_0"),
estimand = "ATE")
start = gen_a_start(y=sud$eps7p_3, tx=sud$treat,
residuals=residuals(outcome_mod$mod_results),
es = .01,
rho = .01,
my_estimand = "ATE")