signtest: The sign test

Description Usage Arguments Details Value See Also Examples

Description

Performs a test whether a statistical model fits to some data via a binomial test on the signs of residuals.

Usage

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

## Default S3 method:
sign.test(x, ...)

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

Arguments

x

[numeric]
vector of residuals.

...

[any]
further arguments.

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!

Value

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

statistic

the number of positive residuals.

parameter

the number of data points.

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

depth.test, f.test

Examples

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

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