jonckheereTerpstraTest: Perform the Jonckheere-Terpstra trend test

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/jonckheereTerpstraTest.R

Description

The Jonckheere-Terpstra is a non-parametric test for trend. This function is a wrapper for jonckheere.test from the clinfun package.

Usage

1
jonckheereTerpstraTest(Data, Treatment, Response, TestDirection, AlphaLevel)

Arguments

Data

A data set.

Treatment

The name (as a string) of the treatment variable.

Response

The name (as a string) of the response variable.

TestDirection

The direction of the test statistic can be any of: c('Both', 'Descending', 'Ascending').

AlphaLevel

The alpha level each step needs to pass before moving on to test a lower treatment level.

Value

JT Statistic

The JT test statistic.

Decreasing Trend P-Value

The p-value for a decreasing trend.

D.Sig

The significance flag for the decreasing tend where "." is a p-value > 0.05, "*" is a 0.01 < p-value <= 0.05, "**" for 0.001 < p-value <= 0.01, and "***" for p-value <= 0.001.

Increasing Trend P-Value

The p-value for a increasing trend.

I.Sig

The significance flag for the increasing tend where "." is a p-value > 0.05, "*" is a 0.01 < p-value <= 0.05, "**" for 0.001 < p-value <= 0.01, and "***" for p-value <= 0.001.

Max Level of Treatment

The treatment level the test statistic corresponds to.

Note

A note when using the JT. The JT estimates p-values by a random process thus after an initial run, subsequent runs of the JT will produce slightly different p-values. To produce exactly the same p-values between each run you will need to use the set.seed function in the R console before each run.

Author(s)

Joe Swintek

References

Jonckheere, A. R. (1954). A distribution-free k-sample test against ordered alternatives. Biometrika 41:133-145.
Terpstra, T. J. (1952). The asymptotic normality and consistency of Kendall's test against trend, when ties are present in one ranking. emphIndagationes Mathematicae 14:327-333.

See Also

jonckheere.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
	## Not run: 
	#Data 
		data(lengthWeightData)
	#Subset the data
		SubData<-lengthWeightData[lengthWeightData$Age=='16 week', ] 
		SubData<-SubData[SubData$Generation=='F1', ]
		SubData<-SubData[SubData$SEX=='M', ]
	#Not Run 
	## Not run: 
		jonckheereTerpstraTest(Data=SubData, Treatment='Treatment', 
			Response='WEIGHT', TestDirection='Both', AlphaLevel=0.05)
	
## End(Not run)
	## End(Not run)		

StatCharrms documentation built on Nov. 14, 2020, 5:09 p.m.