Learn R Programming

NSM3 (version 1.1)

pKW: Kruskal-Wallis

Description

Function to compute the P-value for the observed Kruskal-Wallis H statistic.

Usage

pKW(x,g=NA, method=NA, n.mc=10000)

Arguments

Value

Returns a list with "NSM3Ch6p" class containing the following components:na vector containing the number of observations in each of the data groupsobs.statthe observed H statisticp.valupper tail P-value

Details

The data entry is intended to be flexible, so that the groups of data can be entered in either of two ways. For data a=1,2 and b=3,4,5 the following are equivalent: pKW(x=list(c(1,2),c(3,4,5))) pKW(x=c(1,2,3,4,5),g=c(1,1,2,2,2))

See Also

Also see kruskal.test().

Examples

Run this code
##Hollander-Wolfe-Chicken Example 6.1 Half-Time of Mucociliary Clearance
mucociliary<-list(Normal = c(2.9, 3, 2.5, 2.6, 3.2), Obstructive = c(3.8, 
2.7, 4, 2.4), Asbestosis = c(2.8, 3.4, 3.7, 2.2, 2))

pKW(mucociliary)

Run the code above in your browser using DataLab