Description Usage Arguments Value Examples
View source: R/data_aug_functions.R
cace
takes a sample from the posterior distribution of the model parameters
and computes the corresponding posterior distribution of the Complier Average Causal Effect.
1 | cace(chain, outcome_model, strong_access)
|
chain |
a matrix containing the draws from the posterior distribution of the model parameters.
The matrix should either be the result of a call to |
outcome_model |
a character string indicating which outcome model was used in fitting the model, either "binary" for a dichotomous outcome or "normal" for the Normal model. |
strong_access |
a logical indicating whether the strong access monotonicity assumption was made when fitting the model |
a vector containing the draws from the posterior distribution of the CACE
1 2 3 4 5 6 7 8 9 10 | # CACE based on a subset of the vitaminA dataset
set.seed(4923)
chain <- compliance_chain(vitaminA[sample(1:nrow(vitaminA), 1000),], outcome_model = "binary",
exclusion_restriction = TRUE, strong_access = TRUE, n_iter = 10, n_burn = 1)
cace(chain, outcome_model = "binary", strong_access = TRUE)
# matrix representing the samples from the posterior distribution of the model parameters
posterior_mat <- matrix(rnorm(10*8, mean = 10), nrow = 10, ncol = 8)
cace(posterior_mat, "normal", strong_access = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.