[R] distcomp2var -- Compare distributions of two variables

Syntax

distcomp2var 1 2 [if] [in] , [alpha(#) pvalue noplot]

Description

distcomp2var compares the distributions of two variables.

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

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

distcomp2var is a wrapper for distcomp, so it has the same output and stored results.

See also ksmirnov2var.

Examples

Setup

. clear

. set obs 100

. generate sample1 = rnormal()

. generate sample2 = rnormal()

. generate sample3 = runiform()

distcomp2var test

. distcomp2var sample1 sample2

. distcomp2var sample1 sample3

With options

. distcomp2var sample1 sample2, alpha(0.1)

. distcomp2var sample1 sample2, pvalue

. distcomp2var sample1 sample2, noplot

Author

Michael Makovi mbmakovi@gmail.com

References

Kaplan, D. M. (2021).
DISTCOMP: Stata module to compare distributions.

Kaplan, David M. (2019).
distcomp: Comparing distributions
The Stata Journal 19(4): 832-848.