[R] ksmirnov2var -- Kolmogorov-Smirnov equality-of-distributions test for 2 variables

Syntax

ksmirnov2var 1 2 [if] [in] , [exact]

Description

ksmirnov2var performs the Kolmogorov-Smirnov test of the equality of distributions for two variables.

By contrast, ksmirnov will test the equality of distributions of two groups of one variable.

ksmirnov2var is similar to comparing the means of two variables with ttest 1 == 2, except ksmirnov2var will compare their distributions.

ksmirnov2var is a wrapper for ksmirnov, so it has the same output and stored results.

See also distcomp2var.

Examples

Setup

. clear

. set obs 100

. generate sample1 = rnormal()

. generate sample2 = rnormal()

. generate sample3 = runiform()

ksmirnov2var test

. ksmirnov2var sample1 sample2, exact

. ksmirnov2var sample1 sample3, exact

Author

Michael Makovi mbmakovi@gmail.com