Learn R Programming

met (version 0.1.0)

gfks2_stat: Bivariate GFKS statistics

Description

Compute the GFKS statistics and identify its location for all marginal distributions and bivariate distributions for x. This function and its use are discussed in Yu (2020).

Usage

gfks2_stat(x,z)

Arguments

x

A matrix with length(z) rows giving the discretized covariates.

z

A vector whose ith coordinate is 1 for a treated unit and is 0 for a control.

Value

gfks

A vector of GFKS statistics for all marginal and bivariate distributions.

where

A vector of locations v that the GFKS statistics occur, i.e., the location of the maximum difference of the empirical distribution function in the treated and control groups.

direction

A vector of directions indicating which quadrant the GFKS statistics occur -- 1 for '<=' and '<=', 2 for '<=' and '>', 3 for '>' and '<=', 4 for '>' and '>'.

References

Yu, R. (2020) Evaluating and Improving a Matched Comparison of Antidepressants and Bone Density. Under revision.

Examples

Run this code
# NOT RUN {
library(optmatch)
data("SSRI")
attach(SSRI)
X<-cbind(female,black,education)
dist<-DiPs::maha_dense(z,X)
o<-DiPs::match(z, dist, SSRI)
M0<-o$data
Xm<-cbind(M0$female,M0$black,M0$education)
gfks2_stat(Xm,M0$z)
detach(SSRI)
# }

Run the code above in your browser using DataLab