ks: Weighted Kolmogorov-Smirnov Statistic

View source: R/fast.dr.R

ksR Documentation

Weighted Kolmogorov-Smirnov Statistic

Description

Computes a weighted Kolmogorov-Smirnov statistic to measure the difference in the marginal feature distributions between the treatment and control cases

Usage

ks(x, z, w)

Arguments

x

a vector of numeric measurements

z

a vector of 0/1 indicators indicating group membership

w

a vector of weights

Details

This function is used in the propensity score model building step to assess the balance between the treatment and control cases

Value

Returns the Kolmogorov-Smirnov statistic, the largest difference between treatment and control groups' empirical cumulative distribution functions

Author(s)

Greg Ridgeway gridge@sas.upenn.edu

References

A. Kolmogorov (1933). “Sulla determinazione empirica di una legge di distribuzione,”. Giornale dell'Istituto Italiano degli Attuari 4:83-91.

N. Smirnov (1948). “Table for estimating the goodness of fit of empirical distributions,”. Annals of Mathematical Statistics 19:279-281.

See Also

fastDR

Examples

y     <- c(rnorm(100,0,1),rnorm(100,0.5,1))
treat <- rep(0:1,each=100)
w     <- 1/c(pnorm(y[1:100],0,1),pnorm(y[101:200],0.5,1))
ks(x=y,z=treat,w=w)

gregridgeway/fastDR documentation built on July 28, 2023, 12:34 p.m.