The cramer Package. June 19, cramer.test Index 5

Similar documents
Package dhsic. R topics documented: July 27, 2017

Package CCP. R topics documented: December 17, Type Package. Title Significance Tests for Canonical Correlation Analysis (CCA) Version 0.

Package sscor. January 28, 2016

Package LIStest. February 19, 2015

Package homtest. February 20, 2015

The energy Package. October 28, 2007

Bootstrapping, Randomization, 2B-PLS

Package MultisiteMediation

Package EL. February 19, 2015

The energy Package. October 3, Title E-statistics (energy statistics) tests of fit, independence, clustering

The bootstrap. Patrick Breheny. December 6. The empirical distribution function The bootstrap

Package EnergyOnlineCPM

arxiv:math/ v1 [math.pr] 9 Sep 2003

Package NonpModelCheck

Package CovSel. September 25, 2013

Package SpatialNP. June 5, 2018

Package covsep. May 6, 2018

Package goftest. R topics documented: April 3, Type Package

Package gtheory. October 30, 2016

The SpatialNP Package

Package alphaoutlier

Package generalhoslem

The paran Package. October 4, 2007

Package RATest. November 30, Type Package Title Randomization Tests

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package testassay. November 29, 2016

Package RI2by2. October 21, 2016

Package decon. February 19, 2015

Package RTransferEntropy

Package agree. R topics documented: July 7, Title Various Methods for Measuring Agreement Version Author Dai Feng

Package ChIPtest. July 20, 2016

Package milineage. October 20, 2017

Package gma. September 19, 2017

The ProbForecastGOP Package

Sequential Implementation of Monte Carlo Tests with Uniformly Bounded Resampling Risk

The Nonparametric Bootstrap

Package comparec. R topics documented: February 19, Type Package

Package HDtest. R topics documented: September 13, Type Package

Package jmuoutlier. February 17, 2017

Package ppcc. June 28, 2017

Package codadiags. February 19, 2015

Package QuantifQuantile

Package RcppSMC. March 18, 2018

Package BayesNI. February 19, 2015

Package idmtpreg. February 27, 2018

Package hiddenf. April 9, 2015

Package MiRKATS. May 30, 2016

Computational Biology Course Descriptions 12-14

Package rela. R topics documented: February 20, Version 4.1 Date Title Item Analysis Package with Standard Errors

Package anoint. July 19, 2015

Package AssocTests. October 14, 2017

Package depth.plot. December 20, 2015

Package rarpack. August 29, 2016

Package mcmcse. July 4, 2017

Package SPECIES. R topics documented: April 23, Type Package. Title Statistical package for species richness estimation. Version 1.

Package invgamma. May 7, 2017

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package ForecastCombinations

Package BNN. February 2, 2018

The mcmc Package. July 27, metrop... 1 olbm Index 5. Metropolis Algorithm

Package elhmc. R topics documented: July 4, Type Package

Package ICBayes. September 24, 2017

Package ProbForecastGOP

Package severity. February 20, 2015

Package metansue. July 11, 2018

Package multivariance

Package crossreg. February 19, 2015

Package sbgcop. May 29, 2018

Package TruncatedNormal

Package mpmcorrelogram

The sbgcop Package. March 9, 2007

Package hot.deck. January 4, 2016

Package SimCorMultRes

Package ShrinkCovMat

Package rgabriel. February 20, 2015

Package vhica. April 5, 2016

Package covrna. R topics documented: September 7, Type Package

Package RootsExtremaInflections

6 Single Sample Methods for a Location Parameter

Package bigtime. November 9, 2017

Package NanoStringDiff

Supplemental Information Likelihood-based inference in isolation-by-distance models using the spatial distribution of low-frequency alleles

Package plw. R topics documented: May 7, Type Package

Package ltsbase. R topics documented: February 20, 2015

Fall 2017 STAT 532 Homework Peter Hoff. 1. Let P be a probability measure on a collection of sets A.

Package hierdiversity

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package dama. November 25, 2017

The ICS Package. May 4, 2007

Package IndepTest. August 23, 2018

Package cccrm. July 8, 2015

Package dhga. September 6, 2016

Conditioning Nonparametric null hypotheses Permutation testing. Permutation tests. Patrick Breheny. October 5. STA 621: Nonparametric Statistics

Package SPADAR. April 30, 2017

Titolo Smooth Backfitting with R

Package ENA. February 15, 2013

The nltm Package. July 24, 2006

Package noncompliance

Special Two-Semester Linear Algebra Course (Fall 2012 and Spring 2013)

Hotelling s One- Sample T2

Transcription:

The cramer Package June 19, 2006 Version 0.8-1 Date 2006/06/18 Title Multivariate nonparametric Cramer-Test for the two-sample-problem Author Carsten Franz <franz@stochastik.uni-hannover.de> Maintainer Carsten Franz <franz@stochastik.uni-hannover.de> Depends R (>= 0.65), boot Imports boot Description Provides R routine for the so called two-sample Cramer-Test. This not distribution free, nonparametric two-sample-test can be applied on multivariate data as well as univariate data. It offers two possiblities to approximate the critical value both of which are included in this package. License GPL version 2 or newer R topics documented: cramer.test.......................................... 1 Index 5 cramer.test Cramer-Test for uni- and multivariate two-sample-problem Description Usage Perform Cramér-test for two-sample-problem. Both univariate and multivariate data is possible. For calculation of the critical value Monte-Carlo-bootstrap-methods and eigenvalue-methods are available. For the bootstrap access ordinary and permutation methods can be chosen as well as the number of bootstrap-replicates taken. cramer.test(x,y,conf.level=0.95,replicates=1000, sim="ordinary",just.statistic=false, kernel="phicramer", maxm=2^14, K=160) 1

2 cramer.test Arguments x First set of observations. Either in vector form (univariate) or in a matrix with one observation per row (multivariate). y Second set of observations. Same dimension as x. conf.level sim Details replicates maxm Confidence level of test. The default is conf.level=0.95. Type of Monte-Carlo-bootstrap method or eigenvalue method. Possible values are "ordinary" (default) for normal Monte-Carlo-bootstrap, "permutation" for a permutation Monte-Carlo-bootstrap or "eigenvalue" for bootstrapping the limit distribution, evaluating the (approximate) eigenvalues being the weights of the limiting chisquared-distribution and using the critical value of this approximation (calculated via fast fourier transform). This method is especially good if the dataset is too large to perform Monte-Carlo-bootstrapping (although it must not be too large so the matrix eigenvalue problem can still be solved). Number of bootstrap-replicates taken to obtain critical value. The default is replicates=1000. When using the eigenvalue method, this variable is unused. Gives the maximum number of points used for the fast fourier transform. When using Monte-Carlo-bootstrap methods, this variable is unused. K Gives the upper value up to which the integral for the calculation of the distribution function out of the characteristic function (Gurlands formula) is evaluated. The default ist 160. Careful: When increasing K it is necessary to increase maxm as well since the resolution of the points where the distribution function is calculated is 2π K. Thus, if just K is increased the maximum value, where the distribution function is calculated is lower. When using Monte-Carlo-bootstrap methods, this variable is unused. just.statistic Boolean variable. If TRUE just the value of the Cramér-statistic is calculated and no bootstrap-replicates are produced. kernel Character-string giving the name of the kernel function. The default is "phicramer" which is the Cramér-test included in earlier versions of this package and which is used in the paper of Baringhaus and the author mentioned below. It is possible to use user-defined kernel functions here. The functions needs to be able to deal with matrix arguments. Kernel functions need to be defined on the positive real line with value 0 at 0 and have a nonconstant completely monotone first derivative. An example is show in the Examples section below. Build-in functions are "phicramer", "phibahr", "philog", "phifraca" and "phifracb". The Cramér-statistic is given by T m,n = mn ( 2 m,n φ( X m + n mn i Y j 2 ) 1 m m 2 i,j 1 n 2 n i,j=1 ) φ( Y i Y j 2 ), i,j=1 φ( X i X j 2 )

cramer.test 3 The function φ is the kernel function mentioned in the Parameters section. The proof that the Monte-Carlo-Bootstrap and eigenvalue methods work is given in the reference listed below. Other build-in kernel functions are φ Cramer (z) = z/2 (recommended for location alternatives), φ Bahr (z) = 1 exp( z/2) (recommended for dispersion as well as location alternatives), (preferrably for location alternatives), (preferrably for dispersion alternatives) and φ log (z) = log(1 + z) φ F raca (z) = 1 1 1 + z φ F racb (z) = 1 1 (1 + z) 2. (also for dispersion alternatives). A further analysis of the test performance for these kernels will be included in a further publication. The idea of using this statistic is due to L. Baringhaus, University of Hanover. Value The returned value is an object of class "cramertest", containing the following components: method d m n statistic conf.level crit.value p.value Describing the test in words. Dimension of the observations. Number of x observations. Number of y observations. Value of the Cramér-statistic for the given observations. Confidence level for the test. Critical value calculated by bootstrap method, eigenvalue method, respectively. When using the eigenvalue method, the distribution under the hypothesis will be interpolated linearly. Estimated p-value of the test. result Contains 1 if the hypothesis of equal distributions should not be accepted and 0 otherwise. sim replicates ev hypdist Method used for obtaining the critical value. Number of bootstrap-replicates taken. Contains eigenvalues and eigenfunctions when using the eigenvalue-method to obtain the critical value Contains the via fft reconstructed distribution function under the hypothesis. $x contains the x-values and $Fx the values of the distribution function at the positions.

4 cramer.test References The test and its properties is described in: Baringhaus, L. and Franz, C. (2004) On a new multivariate two-sample test, Journal of Multivariate Analysis, 88, p. 190-206 Franz, C. (2000) Ein statistischer Test fuer das mehrdimensionale Zweistichproben-Problem, German, Diploma thesis, University of Hanover. The test of Bahr so far is only mentioned in: Bahr, R. (1996) Ein neuer Test fuer das mehrdimensionale Zwei-Stichproben-Problem bei allgemeiner Alternative, German, Ph.D. thesis, University of Hanover. The eigenvalue method will be described in a forthcoming article. Examples # comparison of two univariate normal distributions x<-rnorm(20,mean=0,sd=1) y<-rnorm(50,mean=0.5,sd=1) cramer.test(x,y) # comparison of two multivariate normal distributions with permutation test: # library "MASS" for multivariate routines (included in package "VR") # library(mass) # x<-mvrnorm(n=20,mu=c(0,0),sigma=diag(c(1,1))) # y<-mvrnorm(n=50,mu=c(0.3,0),sigma=diag(c(1,1))) # cramer.test(x,y,sim="permutation") # comparison of two univariate normal distributions with Bahrs Kernel phibahr<-function(x) return(1-exp(-x/2)) x<-rnorm(20,mean=0,sd=1) y<-rnorm(50,mean=0,sd=2) cramer.test(x,y,sim="eigenvalue",kernel="phibahr")

Index Topic htest Topic multivariate Topic nonparametric phibahr (cramer.test), 1 phicramer (cramer.test), 1 phifraca (cramer.test), 1 phifracb (cramer.test), 1 philog (cramer.test), 1 print.cramertest (cramer.test), 1 5