constEffect | R Documentation |
Calculates potential outcomes under modified assignments, according to the specified constant treatment effect(s).
constEffect(y, w, w_new, poOptions)
y |
a vector or matrix of outcomes. |
w |
a vector or matrix of assignments. |
w_new |
a vector or matrix of modified assignments. |
poOptions |
a list of options for calculating potential outcomes.
|
A vector of potential outcomes under the modified assignments.
Joseph J. Lee and Tirthankar Dasgupta
zeroEffect
# 1 treatment factor with 2 levels # Assignments w <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1) # Modified Assignments w_new <- c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0) # Outcomes y <- c(4, 6, 5, 7, 4, 7, 11, 9, 8, 12) constEffect(y, w, w_new, poOptions = list(tau = 2)) # 2 treatment factors, each with 2 levels # Assignments w1 <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1) w2 <- c(0, 1, 0, 1, 0, 1, 0, 1, 0, 1) w <- cbind(w1, w2) # Modified assignments w1_new <- c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0) w2_new <- c(1, 0, 1, 0, 1, 0, 1, 0, 1, 0) w_new <- cbind(w1_new, w2_new) # Outcomes y <- c(4, 6, 5, 7, 4, 7, 11, 9, 8, 12) constEffect(y, w, w_new, poOptions = list(tau = c(2, -1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.