| HX | R Documentation |
This function computes the inverse propensity score weight based on treatment assignment and a propensity score model.
HX(A, X, prop_score)
A |
A binary vector or matrix of length n indicating treatment assignment (0 or 1). |
X |
A matrix or data frame of covariates of size n x d (input data in |
prop_score |
A function that estimates the propensity score given treatment (A) and covariates (X). |
A numeric value representing the inverse propensity score weight.
# Example usage:
prop_model <- function(A, X) { 0.5 } # Constant propensity score for illustration
HX(1, data.frame(x1 = 1, x2 = 2), prop_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.