signTest: Sign Test

Description Usage Arguments Value Author(s) Examples

View source: R/signTest.R

Description

Perform a sign test for a paired sample on variables of a data set. The output is printed as a LaTeX table that mimics the look of SPSS output (version <24).

Usage

1
2
3
4
signTest(data, variables, exact = FALSE)

## S3 method for class 'signTestSPSS'
print(x, digits = 3, statistics = c("frequencies", "test"), ...)

Arguments

data

a data frame containing the variables.

variables

a character vector specifying two numeric variables containing the paired observations.

exact

a logical indicating whether or not to include the exact p-value using the binomial distribution. Note that the p-value using the normal approximation is always reported.

x

an object of class "signTestSPSS" as returned by function signTest.

digits

an integer giving the number of digits after the comma to be printed in the LaTeX tables.

statistics

a character vector specifying which LaTeX tables should be printed. Available options are "frequencies" for a summary of the frequencies and "test" for test results. The default is to print both tables.

...

currently ignored.

Value

An object of class "signTestSPSS" with the following components:

statistics

a data frame containing information on the number of observations with negative and positive differences.

asymptotic

a list containing the results of the test using the normal approximation.

exact

if requested, a numeric vector containing the exact two-sided p-value, one-sided p-value, and point probability using the binomial distribution.

variables

a character vector containing the names of the two numeric variables with the paired observations.

n

an integer giving the number of observations.

The print method produces a LaTeX table that mimics the look of SPSS output (version <24).

Author(s)

Andreas Alfons

Examples

1
2
3
4
5
6
# load data
data("Exams")

# test whether grades differ between the
# regular exam and the resit
signTest(Exams, c("Regular", "Resit"))

r2spss documentation built on Nov. 25, 2021, 1:06 a.m.