bal.ks.psa: Kolgomorov-Smirnov 2 sample tests for multiple strata

View source: R/bal.ks.psa.R

bal.ks.psaR Documentation

Kolgomorov-Smirnov 2 sample tests for multiple strata

Description

Automates the Kolgomorov-Smirnov 2-sample nonparametric test of equivalence of two distrbutions across multiple pairs of sample distributions.

Usage

bal.ks.psa(continuous, treatment = NULL, strata = NULL)

Arguments

continuous

Quantitative covariate that is being balanced within strata in a PSA. If continuous has three columns, then the second and third are assumed to be the treatment and strata respectively. Missing values are not allowed.

treatment

Binary variable of same length as continuous; generally 0 for 'control,' 1 for 'treatment.'

strata

Integer variable (usually 1 - 5); A vector of same length as continuous indicating the derived strata from estimated propensity scores. Generally 5 or 6 strata are used, but graph works reasonably well at least up to 10 strata.

Details

Makes multiple calls to ks.test, returning a vector of p-values associated with strata from a Propensity Score Analysis.

Value

Returns a vector of same length as the number of strata containing the p-values from the KS-test of equivalence of distributions for each stratum-treatment pair.

Author(s)

James E. Helmreich James.Helmreich@Marist.edu

Robert M. Pruzek RMPruzek@yahoo.com

See Also

bal.ms.psa, bal.cs.psa, bal.cws.psa

Examples


continuous<-rnorm(1000)
treatment<-sample(c(0,1),1000,replace=TRUE)
strata<-sample(5,1000,replace=TRUE)
bal.ks.psa(continuous,treatment,strata)


PSAgraphics documentation built on March 31, 2023, 5:30 p.m.