Description Usage Arguments Value Examples
Function that gives inference for logistic regression plug-in estimators of ATE and Blip Variance.
1 | LR.inference(W, A, Y, Qform, alpha = 0.05, simultaneous.inference = FALSE)
|
W, |
matrix or data.frame of covariates |
A, |
a binary vector of treatment assignments |
Y, |
a binary vector of outcomes |
Qform, |
a formula for Y in terms of the covariates as input in glm |
alpha, |
significance level for the (1-alpha)100 percent CI's. 0.05 is default |
simultaneous.inference, |
TRUE if user wants simultaneous confidence bounds for both ATE and blip variance at level alpha. default is FALSE |
if simultaneous.inference is specified as TRUE then will return a vector giving pt estimate, left and right bound for ATE, simultaneous ATE CI, blip variance, and simultaneous blip variance. Otherwise gives pt estimate, left and right bound for ATE and blip variance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # using built-in package functions, g0_linear and define Q0_linear to specify
# pscore and outcome model probabilities
g0_linear
Q0_linear = function(A,W1,W2,W3,W4) plogis(A + W1 + W2 + A*(W3 + W4) + W3 + W4)
# get a randomly drawn dataframe under the specified model
data = gendata(1000, g0_linear, Q0_linear)
# get the truth
truth = get.truth(g0_linear, Q0_linear)
truth
# well-specified model
Qform = formula("Y ~ W1 + W2 + A*(W3 + W4)")
# specifying the covariates, treatment and outcome
W = data[,2:5]
A = data$A
Y = data$Y
# should cover each truth 95 percent of the time.
info = LR.inference(W=W,A=A,Y=Y,Qform=Qform, alpha = .05)
info
# should cover each truth 95 percent of the time and both truths
# simultaneously 95 percent of the time for the simultaneous CI's
info1 = LR.inference(W=W,A=A,Y=Y,Qform=Qform, alpha = .05,
simultaneous.inference = TRUE)
info1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.