README.md

tnlTEST

Codecov test
coverage R-CMD-check pkgdown test-coverage

The goal of tnlTEST is to provide functions to perform the hypothesis tests for the two sample problem based on order statistics and power comparisons.

Installation

You can install the released version of tnlTEST from CRAN with:

install.packages("tnlTEST")

Details

A non-parametric two-sample test is performed for testing null hypothesis H0 : F = G against the alternative hypothesis H1 : F ≠ G. The assumptions of the Tn(ℓ) 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 Tn(ℓ) 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 Tn(ℓ) 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 Tn(ℓ) test is also computed under Lehman alternative. Random number generator of Tn(ℓ) test statistic are provided under null hypothesis in the library.

Examples

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)
#> $statistic
#> [1] 2
#> 
#> $p.value
#> [1] 0.02447552

ptnl gives the distribution function of Tn(ℓ) against the specified quantiles.

library(tnlTEST)
 ptnl(q=2,n=6,l=2,exact="NULL")
#> $method
#> [1] "exact"
#> 
#> $cdf
#> [1] 0.03030303

dtnl gives the density of Tn(ℓ) against the specified quantiles.

library(tnlTEST)
 dtnl(k=3,n=7,l=2,exact="TRUE")
#> $method
#> [1] "exact"
#> 
#> $pmf
#> [1] 0.05710956

qtnl gives the quantile function of Tn(ℓ) against the specified probabilities.

library(tnlTEST)
 qtnl(p=.3,n=8,l=1,exact="FALSE",trial = 100000)
#> $method
#> [1] "Monte Carlo simulation"
#> 
#> $quantile
#> [1] 3

rtnl generates random values from Tn(ℓ).

library(tnlTEST)
 rtnl(N=15,n=7,l=2)
#>  [1] 7 6 7 7 7 7 7 5 6 4 7 6 5 5 5

tnl_mean gives an expression for E(Tn(ℓ)) under H0 : F = G.

library(tnlTEST)
require(base)
 tnl_mean(n=11, l=2)
#> [1] 8.058115

ptnl.lehmann gives the distribution function of Tn(ℓ) under Lehmann alternatives.

library(tnlTEST)
ptnl.lehmann(q=3,l = 2, 5, gamma = 1.2)
#> [1] 0.1529147

dtnl.lehmann gives the density of Tn(ℓ) under Lehmann alternatives.

library(tnlTEST)
 dtnl.lehmann(k=3,l = 2, n = 6, gamma = 0.8)
#> [1] 0.08230829

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)
#> [1] 2

rtnl.lehmann generates random values from Tn(ℓ) under Lehmann alternatives.

library(tnlTEST)
rtnl.lehmann(N = 15, n = 7, l = 2,gamma=0.5)
#>  [1] 7 7 6 6 7 3 2 7 2 6 4 3 7 7 3

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.