% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mtsknn.R
\name{mtsknn.eq}
\alias{mtsknn.eq}
\title{Compare discrete distributions}
\usage{
mtsknn.eq(x, y, k, clevel = 0.05, getpval = TRUE, print = TRUE)
}
\arguments{
\item{x}{A matrix or data frame.}

\item{y}{A matrix or data frame.}

\item{k}{k An integer.}

\item{clevel}{The confidence level. Default value is 0.05.}

\item{getpval}{Logic value. If it is set to be TRUE the p value of
test will be calcuated and reported; if it is set to be false the
p value will not be calculated.}

\item{print}{Boolean value. If it is set to be TRUE the test
result will be reported; if it is set to be FALSE the test
result will not be reported.}
}
\value{
A list consists of the test statistics,
normalized Z score and corresponding P value.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}

Multivariate two-sample test based on k-nearest neighbors
}
\details{
This function tests whether two samples share the same underlying
distribution based on k-nearest-neighbors approach.
Matrices or data frames x and y are the two samples to be tested.
Each row consists of the coordinates of a data point.
The integer k is the number of nearest neighbors to choose in the
testing procedure. This approach is robust in the unbalanced case.
}
\references{
Schilling, M. F. (1986). Multivariate two-sample tests based on nearest neighbors. \emph{J. Amer. Statist. Assoc.}, 81 799-806.
Henze, N. (1988). A multivariate two-sample test based on the number of nearest neighbor type coincidences.\emph{Ann. Statist.}, 16 772-783.
Chen, L. and Dou W. (2009). Robust multivariate two-sample tests based on k nearest neighbors for unbalanced designs. \emph{manuscripts}.
}
\author{
Lisha Chen (Yale), Peng Dai (Stonybrook) and Wei Dou (Yale)
}
