depthtest: The K-sign depth test

Description Usage Arguments Details Value See Also Examples

Description

Performs the robust K-sign depth test, which tests whether a statistical model fits to some data.

Usage

1
2
3
4
5
6
7
depth.test(x, ...)

## Default S3 method:
depth.test(x, K, ...)

## S3 method for class 'formula'
depth.test(formula, data, params, K, ...)

Arguments

x

[numeric]
vector of residuals.

...

[any] further arguments in the formula-method. Arguments are passed to the multiSorting-function.

K

[integer(1)]
parameter of the K-sign depth.

formula

[formula]
a formula of the form lhs ~ rhs where lhs is a numeric giving the target variable and rhs are the explanatory variables .

data

[data.frame]
a data frame containing the variables in the formula.

params

[numeric]
a parameter vector for the null-hypothesis.

Details

In the default method a residual vector is given and it is tested whether this residual vector comes from a model that describes the data sufficiently. With the formula interface it is possible to give a formula and a parameter vector, so that a linear model with the given parameters is fitted and the residuals are calculated with this model.

At the moment only linear models for the formula interface are supported!

The parameter K of the sign depth has to be a natural number. Currently only K = 2, 3, 4, 5 are supported!

The quantiles used for calculating the p-value of the test are simulation based. For more information see qdepth.

Value

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

statistic

the value of the K-sign depth.

parameter

the parameter K of the K-sign depth.

p.value

the p-value for the test.

alternative

a character string describing the alternative hypothesis.

data.name

a character string giving the name of the data.

method

a character string describing the method.

See Also

qdepth, calcDepth, multiSorting, sign.test, f.test

Examples

1
2
3
depth.test(rnorm(30), 3)
depth.test(y ~ ., data = data.frame(x = rnorm(30), y = rnorm(30)),
  params = c(1, 1), K = 3)

melaniehorn/GSignTest documentation built on July 11, 2021, 1:18 a.m.