Learn R Programming

OjaNP (version 0.9-4)

ojaCsampleTest: C Sample Location Test Based on Oja Signs and Ranks

Description

Function to test for equality of location in the C sample case using Oja signs and ranks.

Usage

ojaCsampleTest(X, ...)

## S3 method for class 'default':
ojaCsampleTest(X, Y, mu = NULL, scores = "sign", p = 1, 
               method = "approximation", n.simu = 1000, 
               center = "ojaMedian", na.action = na.fail, ...)

## S3 method for class 'formula':
ojaCsampleTest(formula, scores="sign", p = 1, 
               method = "approximation", n.simu = 1000, 
               center = "ojaMedian", data, subset, na.action,...)

Arguments

X
a numeric data frame or matrix in the two sample case.
Y
a numeric data frame or matrix in the two sample case.
formula
a formula of the form X ~ g where X is a numeric matrix with at least two columns giving the data values and g a factor with at least two levels giving the corresponding groups.
mu
a vector indicating the hypothesized value of the difference in location. NULL represents no difference between the groups. For more than two groups mu should be 0 or not be specified at all.
scores
options are rank for the Oja rank test, sign for the Oja sign test. The sign test is the default.
p
value of p to be passed on to ojaSign or ojaRank. The default here is to use all hyperplanes since only then the tests are vali
method
defines the method used for the computation of the p-value. The possibilities are approximation (default) or permutation.
n.simu
if method = permutation specifies this the number of replications used in the permutation procedure.
center
value of center to be passed on to ojaSign. Is used to center the data matrix. The default is the natural but computationally expansive Oja median. For other options see the h
data
an optional data frame, list or environment containing the variables in the model. If not found in data, the variables are taken from environment(formula).
subset
an optional vector specifying a subset of observations to be used for the testing.
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. Mainly further arguments for ojaSign or ojaRank.

Value

  • A list with class 'htest' containing the following components:
  • statisticthe value of the Q-statistic.
  • parameterthe degrees of freedom for the Q-statistic or the number of replications in the permutation procedure.
  • p.valuethe p-value for the test.
  • null.valuethe specified hypothesized value of the difference in location. (only in the two sample case)
  • alternativea character string with the value 'two.sided'. (only in the two sample case)
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name of the data.

Details

In the C-sample case of the Oja sign test the covariance matrix of the signs is divided by the sample size and not by sample size - 1. For the sign test version always the Oja median should be used from a theoretical point of view to center the data and the median should be computed using the exact algorithm. For further details about the the Oja median see ojaMedian. Note that no theoretical results are available when p is not set to 1.

References

Hettmansperger, T. P. and Oja, H. (1994), Affine invariant multivariate multisample sign test, Journal of the Royal Statistical Society, Series B, 56, 235--249. Hettmansperger, T. P., M�tt�nen{Mottonen}, J. and Oja, H. (1999), Multivariate affine invariant rank tests for several samples, Statistica Sinica, 8, 785--800. Visuri, S., Ollila, E., Koivunen, V., M�tt�nen{Mottonen}, J. and Oja, H. (2003), Affine equivariant multivariat rank methods, Journal of Statistical Planning and Inference, 114, 161--185.

See Also

ojaSign, ojaRank, oja1sampleTest

Examples

Run this code
data(biochem)
X <- subset(biochem, group=="Control", select=c("comp.1","comp.2"))
Y <- subset(biochem, group=="Treat", select=c("comp.1","comp.2"))
ojaCsampleTest(X,Y, alg="ex")
ojaCsampleTest(X,Y, method="p", alg="ex")
ojaCsampleTest(cbind(comp.1, comp.2) ~ group, score="r", data=biochem)

Run the code above in your browser using DataLab