knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

classical two-sample problem

For two absolute continuous cumulative distribution functions (cdfs) $F$ and $G$, suppose we are interested in testing the null hypothesis $H_0 : F = G$ against the alternative $H_1 :F=G$ using two independent random samples from the two distributions.

${T_n^{(\ell)}}$ test

We introduce the test statistic as a non-parametric tests for the two-sample problem based on order statistics and power comparisons, denoted as ${T_n^{(\ell)}}$ for testing the hypotheses above based on a random sample from $F$ and an independent random sample from $G$. Also, a class of distribution-free statistics based on the order statistics for testing the equality of two continuous distributions is introduced.

tnlTEST package

This package contains functions to calculate the density, distribution function, quantile function, random number generation, test statistic, density under Lehmann alternatives and distribution function under Lehmann alternatives.

Details

A non-parametric two-sample test is performed for testing null hypothesis ${H_0:F=G}$ against the alternative hypothesis ${H_1:F\not=G}$. The assumptions of the ${T_n^{(\ell)}}$ test are that both samples should come from a continuous distribution and the samples should have the same sample size.
Missing values are silently omitted from x and y.
Exact and simulated p-values are available for the ${T_n^{(\ell)}}$ test. If exact ="NULL" (the default) the p-value is computed based on exact distribution when the sample size is less than 11. Otherwise, p-value is computed based on a Monte Carlo simulation. If exact ="TRUE", an exact p-value is computed. If exact="FALSE", a Monte Carlo simulation is performed to compute the p-value. It is recommended to calculate the p-value by a Monte Carlo simulation (use exact="FALSE"), as it takes too long to calculate the exact p-value when the sample size is greater than 10.
The probability mass function (pmf), cumulative density function (cdf) and quantile function of ${T_n^{(\ell)}}$ are also available in this package, and the above-mentioned conditions about exact ="NULL", exact ="TRUE" and exact="FALSE" is also valid for these functions.
Exact distribution of ${T_n^{(\ell)}}$ test is also computed under Lehman alternative.
Random number generator of ${T_n^{(\ell)}}$ test statistic are provided under null hypothesis in the library.

tnl.test function performs a nonparametric test for two sample test on vectors of data.

library(tnlTEST)
require(stats)
 x=rnorm(7,2,0.5)
 y=rnorm(7,0,1)
 tnl.test(x,y,l=2)

ptnl gives the distribution function of ${T_n^{(\ell)}}$ against the specified quantiles.

library(tnlTEST)
 ptnl(q=2,n=6,l=2,exact="NULL")

dtnl gives the density of ${T_n^{(\ell)}}$ against the specified quantiles.

library(tnlTEST)
 dtnl(k=3,n=7,l=2,exact="TRUE")

qtnl gives the quantile function of ${T_n^{(\ell)}}$ against the specified probabilities.

library(tnlTEST)
 qtnl(p=.3,n=8,l=1,exact="FALSE",trial = 100000)

rtnl generates random values from ${T_n^{(\ell)}}$.

library(tnlTEST)
 rtnl(N=15,n=7,l=2)

tnl_mean gives an expression for $E({T_n^{(\ell)}})$ under ${H_0:F=G}$.

library(tnlTEST)
require(base)
 tnl_mean(n=11, l=2)

ptnl.lehmann gives the distribution function of ${T_n^{(\ell)}}$ under Lehmann alternatives.

library(tnlTEST)
ptnl.lehmann(q=3,l = 2, 5, gamma = 1.2)

dtnl.lehmann gives the density of ${T_n^{(\ell)}}$ under Lehmann alternatives.

library(tnlTEST)
 dtnl.lehmann(k=3,l = 2, n = 6, gamma = 0.8)

qtnl.lehmann returns a quantile function against the specified probabilities under Lehmann alternatives.

library(tnlTEST)
qtnl.lehmann(p=.3, n=4, l=1, gamma=0.5)

rtnl.lehmann generates random values from ${T_n^{(\ell)}}$ under Lehmann alternatives.

library(tnlTEST)
rtnl.lehmann(N = 15, n = 7, l = 2,gamma=0.5)

Corresponding Author

Department of Statistics, Faculty of Science, Selcuk University, 42250, Konya, Turkey
Email:coskun@selcuk.edu.tr

References

Karakaya K. et al. (2021). A Class of Non-parametric Tests for the Two-Sample Problem based on Order Statistics and Power Comparisons. Submitted paper.
Aliev F. et al. (2021). A Nonparametric Test for the Two-Sample Problem based on Order Statistics. Submitted paper.



ihababusaif/tnlTEST documentation built on Dec. 20, 2021, 6:55 p.m.