ks | R Documentation |
Computes a weighted Kolmogorov-Smirnov statistic to measure the difference in the marginal feature distributions between the treatment and control cases
ks(x, z, w)
x |
a vector of numeric measurements |
z |
a vector of 0/1 indicators indicating group membership |
w |
a vector of weights |
This function is used in the propensity score model building step to assess the balance between the treatment and control cases
Returns the Kolmogorov-Smirnov statistic, the largest difference between treatment and control groups' empirical cumulative distribution functions
Greg Ridgeway gridge@sas.upenn.edu
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.
fastDR
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.