JT.test: Jonckheere-Terpstra trend test

Description Usage Arguments Details Value Author(s) References Examples

View source: R/JT.test.r

Description

The test is testing for a monotone trend in terms of the class parameter. The number of times that an individual of a higher class has a higher gene expression forms a basis for the inference.

Usage

1
JT.test(data, class, labs = NULL, alternative = c("two-sided", "decreasing", "increasing"), ties = FALSE)

Arguments

data

A matrix with genes in rows and subjects in columns

class

the column labels, if not an ordered fctor it will be redefined to be one.

labs

the labels of the categories coded by class

alternative

two-sided, decreasing or increasing

ties

Adjustment for ties

Details

Assumes that groups are given in increasing order, if the class variable is not an ordered factor, it will be redefined to be one. The p-value is calculated through a normal approximation.

The implementation owes to suggestions posted to R list.

The definition of predictive strength appears in Flandre and O'Quigley.

Value

an object of class JT-test, which extends the class htest, and includes the following slots

statistic

the observed JT statistic

parameter

the null hypothesis parameter, if other value than 0.

p.value

the p-value for the two-sided test of no trend.

method

Jonckheere-Terpstra

alternative

The relations between the levels: decreasing, increasing or two-sided

data.name

the name of the input data

median1 ... mediann

the medians for the n groups

trend

the rank correlation with category

S1

Predictive strength

Author(s)

Per Broberg, acknowledging input from Christopher Andrews at SUNY Buffalo

References

Lehmann, EH (1975) Nonparametrics: Statistical Methods Based on Ranks p. 233. Holden Day
Flandre, Philippe and O'Quigley, John, Predictive strength of Jonckheere's test for trend: an application to genotypic scores in HIV infection, Statistics in Medicine, 2007, 26, 24, 4441-4454

Examples

1
2
3
4
5
6
7
8
# Enter the data as a vector
A <- as.matrix(c(99,114,116,127,146,111, 125,143,148,157,133,139, 149, 160, 184))
# create the class labels
g <- c(rep(1,5),rep(2,5),rep(3,5))
# The groups have the medians
tapply(A, g, median)
# JT.test indicates that this trend is significant at the 5% level
JT.test(data = A, class = g, labs = c("GRP 1", "GRP 2", "GRP 3"), alternative = "two-sided")

Example output

Loading required package: multtest
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

  1   2   3 
116 143 149 
class was not an ordered factor.  Redefined to be one.

	Jonckheere-Terpstra

data:  A by g
J = 16, p-value = 0.02311
alternative hypothesis: two-sided: GRP 1two-sided: GRP 2two-sided: GRP 3

SAGx documentation built on Nov. 8, 2020, 8:18 p.m.