Last data update: 2014.03.03

R: One Sample Location Test Based on Oja Signs and Ranks
oja1sampleTestR Documentation

One Sample Location Test Based on Oja Signs and Ranks

Description

Function to test for location in the one sample case using Oja signs and ranks.

Usage

oja1sampleTest(X, mu = NULL, scores = "sign", p = 1,
               method = "approximation", n.simu = 1000, 
               na.action = na.fail, ...)

Arguments

X

a numeric data frame or data matrix.

mu

a vector indicating the hypothesized value of the location. NULL represents the origin.

scores

options are “rank” for the signed rank test, “sign” for the sign test. The sign test is the default.

p

value of “p” to be passed on to ojaSign or ojaSignedRank. The default here is to use all hyperplanes since only then the tests are valid. This can make the functions quite slow, however.

method

defines the method used for the computation of the p-value. The possibilities are “approximation” (default) or “permutation” which permutes the signs of the Oja signs or Oja signed ranks.

n.simu

if “method = permutation” specifies this the number of replications used in the permutation procedure.

na.action

a function which indicates what should happen when the data contain 'NA's. Default is to fail.

...

further arguments to be passed to or from methods.

Value

A list with class 'htest' containing the following components:

statistic

the value of the Q-statistic.

parameter

the degrees of freedom for the Q-statistic or the number of replications in the permutation procedure.

p.value

the p-value for the test.

null.value

the specified hypothesized value of the location.

alternative

a character string with the value 'two.sided'.

method

a character string indicating what type of test was performed.

data.name

a character string giving the name of the data.

Author(s)

Klaus Nordhausen

References

Hettmansperger, T. P., Nyblom, J. and Oja, H. (1994), Affine invariant multivariate one-sample sign test, Journal of the Royal Statistical Society, Series B, 56, 221–234.

Hettmansperger, T. P., M<c3><83><c2><b6>tt<c3><83><c2><b6>nen, J. and Oja, H. (1997), Multivariate affine invariant one-sample signed-rank tests, Journal of the American Statistical Society, 92, 1591–1600.

See Also

ojaMedian, ojaSign, ojaSignedRank

Examples

data(biochem)
oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4))
oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), method = "p")

oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), scores = "rank")
oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), scores = "rank", method = "p")

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(OjaNP)
Loading required package: ICS
Loading required package: mvtnorm
Loading required package: ICSNP
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/OjaNP/oja1sampleTest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: oja1sampleTest
> ### Title: One Sample Location Test Based on Oja Signs and Ranks
> ### Aliases: oja1sampleTest
> ### Keywords: htest multivariate nonparametric
> 
> ### ** Examples
> 
> data(biochem)
> oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4))

	OJA 1 SAMPLE SIGN TEST

data:  biochem[, 1:2]
Q.S = 2.1199, df = 2, p-value = 0.3465
alternative hypothesis: true location is not equal to c(1.1,0.4)

> oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), method = "p")

	OJA 1 SAMPLE SIGN TEST

data:  biochem[, 1:2]
Q.S = 2.1199, replications = 1000, p-value = 0.32
alternative hypothesis: true location is not equal to c(1.1,0.4)

> 
> oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), scores = "rank")

	OJA 1 SAMPLE SIGNED RANK TEST

data:  biochem[, 1:2]
Q.R = 2.3007, df = 2, p-value = 0.3165
alternative hypothesis: true location is not equal to c(1.1,0.4)

> oja1sampleTest(biochem[,1:2], mu = c(1.1, 0.4), scores = "rank", method = "p")

	OJA 1 SAMPLE SIGNED RANK TEST

data:  biochem[, 1:2]
Q.R = 2.3007, replications = 1000, p-value = 0.323
alternative hypothesis: true location is not equal to c(1.1,0.4)

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>