Last data update: 2014.03.03

R: Hollander Bivariate Symmetry
cHollBivSymR Documentation

Hollander Bivariate Symmetry

Description

Quantile function for the Hollander A distribution.

Usage

cHollBivSym(alpha,d.mat,method=NA, n.mc=10000)

Arguments

alpha

A numeric value between 0 and 1.

d.mat

The d matrix, explained below.

method

Either "Exact", "Monte Carlo" or "Asymptotic", indicating the desired distribution. When method=NA, "Exact" will be used if the number of permutations is 10,000 or less. Otherwise, "Monte Carlo" will be used. As Kepner and Randles (1984) and Hilton and Gee (1997) have found the large sample approximation to perform poorly, method="Asymptotic" will be treated as method=NA.

n.mc

If method="Monte Carlo", the number of Monte Carlo samples used to estimate the distribution. Otherwise, not used.

Details

The d matrix, d.mat, will be an n*n matrix of ones and zeroes, where the (i,j)th element is 1 if min(Xj,Yj)<max(Xi,Yi)<=max(Xj,Yj) and min(Xi,Yi)<=min(Xj,Yj), 0 otherwise. An illustration may be found in the example section of this document and Section 3.10 of Hollander, Wolfe, and Chicken - NSM3.

Value

Returns a list with "NSM3Ch5c" class containing the following components:

m

number of observations in the first data group (X)

n

number of observations in the second data group (Y) (equal to m, but included for standardization with other procedures)

cutoff.U

upper tail cutoff at or below user-specified alpha

true.alpha.U

true alpha level corresponding to cutoff.U

Author(s)

Grant Schneider

References

Kepner, James L., and Ronald H. Randies. "Comparison of tests for bivariate symmetry versus location and/or scale alternatives." Communications in Statistics-Theory and Methods 13.8 (1984): 915-930.

Hilton, Joan F., and Lauren Gee. "The size and power of the exact bivariate symmetry test." Computational statistics & data analysis 26.1 (1997): 53-69.

Examples

##Hollander-Wolfe-Chicken Example 3.11 Insulin Clearance in Kidney Transplants
x<-c(61.4,63.3,63.7,80,77.3,84,105)
y<-c(70.8,89.2,65.8,67.1,87.3,85.1,88.1)
obs.data<-cbind(x,y)
a.vec<-apply(obs.data,1,min)
b.vec<-apply(obs.data,1,max)
test<-function(r,c) {as.numeric((a.vec[c]<b.vec[r])&&(b.vec[r]<=b.vec[c])&&(a.vec[r]<=a.vec[c]))}
myVecFun <- Vectorize(test,vectorize.args = c('r','c')) 

d.mat<-outer(1:length(x), 1:length(x), FUN=myVecFun) 

##Cutoff based on the exact distribution
cHollBivSym(.10,d.mat)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(NSM3)
Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: MASS
Loading required package: partitions
Loading required package: survival
fANCOVA 0.5-1 loaded
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/NSM3/cHollBivSym.Rd_%03d_medium.png", width=480, height=480)
> ### Name: cHollBivSym
> ### Title: Hollander Bivariate Symmetry
> ### Aliases: cHollBivSym
> ### Keywords: Hollander Bivariate Symmetry
> 
> ### ** Examples
> 
> ##Hollander-Wolfe-Chicken Example 3.11 Insulin Clearance in Kidney Transplants
> x<-c(61.4,63.3,63.7,80,77.3,84,105)
> y<-c(70.8,89.2,65.8,67.1,87.3,85.1,88.1)
> obs.data<-cbind(x,y)
> a.vec<-apply(obs.data,1,min)
> b.vec<-apply(obs.data,1,max)
> test<-function(r,c) {as.numeric((a.vec[c]<b.vec[r])&&(b.vec[r]<=b.vec[c])&&(a.vec[r]<=a.vec[c]))}
> myVecFun <- Vectorize(test,vectorize.args = c('r','c')) 
> 
> d.mat<-outer(1:length(x), 1:length(x), FUN=myVecFun) 
> 
> ##Cutoff based on the exact distribution
> cHollBivSym(.10,d.mat)
Number of X values:  7 Number of Y values:  7 
For the given alpha= 0.1 , the upper cutoff value is  Hollander A = 0.3877551 ,
 with true alpha level= 0.0625 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>