csregion | R Documentation |
The csregion()
function estimates the boundaries of the
rectangular common support region, as defined by Lopez and Gutman (2017),
and filters the matrix of generalized propensity scores based on these
boundaries. The function returns a matrix of observations whose generalized
propensity scores lie within the treatment group-specific boundaries.
csregion(gps_matrix)
gps_matrix |
An object of classes |
A numeric matrix similar to the one returned by estimate_gps()
,
but with the number of rows reduced to exclude those observations that do
not fit within the common support region (CSR) boundaries. The returned
object also possesses additional attributes that summarize the calculation
process of the CSR boundaries:
filter_matrix
- A logical matrix with the same dimensions as the
gps-part of gps_matrix
, indicating which treatment assignment
probabilities fall within the CSR boundaries,
filter_vector
- A vector indicating whether each observation was kept
(TRUE
) or removed (FALSE
), essentially a row-wise
sum of filter_matrix
,
csr_summary
- A summary of the CSR calculation process, including
details of the boundaries and the number of observations filtered.
csr_data
- The original dataset used for the estimation of generalized
propensity scores (original_data
attribute of the gps
object) filtered
by the filter_vector
# We could estimate simples generalized propensity scores for the `iris`
# dataset
gps <- estimate_gps(Species ~ Sepal.Length, data = iris)
# And then define the common support region boundaries using `csregion()`
gps_csr <- csregion(gps)
# The additional information of the CSR-calculation process are
# accessible through the attributes described in the `*Value*` section
attr(gps_csr, "filter_matrix")
attr(gps_csr, "csr_summary")
attr(gps_csr, "csr_data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.