StatCharrms (version 0.90.96)

dunnsTest: Perform a Dunns test

Description

This function performs a Dunns (non-parametric dunnett) test for multiple comparisons. The code used in this function is a direct translation of the code in the SAS version of StatCharrms.

Usage

dunnsTest(Data, Treatment, Response, TestDirection)

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 the test statistic can be: c('Both', 'Descending', 'Ascending').

Value

Return a data frame containing:

Treatment

The level of the treatment variable.

Count

The Number of observation in that treatment.

Rank

The average rank of the response in the treatment level.

Difference

Difference in rank of the current level to the rank of the controls.

P Value

The p-value of the test statistic.

Signif

The significance flag 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.

References

Dunn, O. J. 1964. Multiple comparisons using rank sums. Technometrics 6:241-252.

Examples

Run this code
# NOT RUN {
	#Data 
		data(lengthWeightData)
	#Subset the data
		SubData<-lengthWeightData[lengthWeightData$Age=='16 week', ] 
		SubData<-SubData[SubData$Generation=='F1', ]
		SubData<-SubData[SubData$SEX=='M', ]
	#Run 
		dunnsTest(Data=SubData, Treatment='Treatment',
			Response='WEIGHT', TestDirection='Both')
# }

Run the code above in your browser using DataCamp Workspace