Last data update: 2014.03.03

R: One Sample Location Test based on Marginal Ranks in the...
rank.ictestR Documentation

One Sample Location Test based on Marginal Ranks in the Independent Component Model

Description

marginal rank test for the location problem in the one sample case when the margins are assumed independent.

Usage

rank.ictest(X, ...)

## Default S3 method:
rank.ictest(X, mu = NULL, scores = "rank", method = "approximation",
            n.simu = 1000, na.action = na.fail, ...)

## S3 method for class 'ics'
rank.ictest(X, index = NULL, na.action = na.fail, ...)

Arguments

X

a numeric data frame or matrix or an ics object.

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 and 'normal' for the normal score test.

method

defines the method used for the computation of the p-value. The possibilites are "approximation" (default), "simulation" or "permutation". Details below.

n.simu

if 'method=simulation' or 'method=permutation' this specifies the number of replications used in the simulation or permutation procedure.

index

an integer vector that gives the columns to choose from invariant coordinates form the 'ics' object. The default uses all columns.

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.

Details

The test is normally used to test for location in the symmetric independent component model.

By default the limiting distribution is used to compute the p-values. However for moderate sample sizes (N=50) was observed in Nordhausen et al. (2009) that the normal score test can be sometimes slightly biased. Therefore the argument method can be used to get p-values based on simulations from a multivariate normal under the null or by permuting the signs of the centered observations.

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.

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, klaus.nordhausen@uta.fi

References

Nordhausen, K., Oja, H. and Paindaveine, D. (2009), Signed-rank tests for location in the symmetric independent component model, Journal of Multivariate Analysis, 100, 821–834.

Examples

set.seed(555)
X <- cbind(rt(30,8), rnorm(30,0.5), runif(30,-3,3))
mix.matrix <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
X.mixed <- X %*% t(mix.matrix)
ica.X <- ics(X, covOrigin, cov4, S2args = list(location = "Origin"))
rank.ictest(ica.X)
rank.ictest(ica.X, scores = "normal", method = "simu")
rank.ictest(ics.components(ica.X), scores = "normal", method = "perm")
rm(.Random.seed)
         

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(ICSNP)
Loading required package: mvtnorm
Loading required package: ICS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICSNP/rank.ictest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rank.ictest
> ### Title: One Sample Location Test based on Marginal Ranks in the
> ###   Independent Component Model
> ### Aliases: rank.ictest rank.ictest.default rank.ictest.ics
> ### Keywords: htest multivariate nonparametric
> 
> ### ** Examples
> 
> set.seed(555)
> X <- cbind(rt(30,8), rnorm(30,0.5), runif(30,-3,3))
> mix.matrix <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
> X.mixed <- X %*% t(mix.matrix)
> ica.X <- ics(X, covOrigin, cov4, S2args = list(location = "Origin"))
> rank.ictest(ica.X)

	MARGINAL SIGNED RANK TEST (assuming the independent component model)

data:  ica.X
Q.W = 7.9379, df = 3, p-value = 0.04731
alternative hypothesis: true location is not equal to c(0,0,0)

> rank.ictest(ica.X, scores = "normal", method = "simu")

	MARGINAL NORMAL SCORE TEST (assuming the independent component model)

data:  ica.X
Q.N = 7.3328, replications = 1000, p-value = 0.039
alternative hypothesis: true location is not equal to c(0,0,0)

> rank.ictest(ics.components(ica.X), scores = "normal", method = "perm")

	MARGINAL NORMAL SCORE TEST (assuming the independent component model)

data:  ics.components(ica.X)
Q.N = 7.3328, replications = 1000, p-value = 0.03
alternative hypothesis: true location is not equal to c(0,0,0)

> rm(.Random.seed)
>          
> 
> 
> 
> 
> dev.off()
null device 
          1 
>