Learn R Programming

Deducer (version 0.7-9)

k.sample.test: K Sample Test

Description

Performs a K independent sample test.

Usage

k.sample.test(formula,data,test=oneway.test,...)

Arguments

formula
A formula, the left hand side of which indicated the outcomes, and the right hand side of which contains the factor
data
A data.frame
test
A function whose first argument is a formula with the outcome on the lhs and the factor on the rhs. The second argument should be the data to be used for the formula. The result of the function should be an object of class htest.
...
further arguments for func

Value

A multi.test object, representing a table of the results of func applied to each of the variables.

See Also

oneway.test kruskal.test wilcox.test

Examples

Run this code
dat<-data.frame(a=rnorm(100),b=rnorm(100),c=rnorm(100),d=cut(rnorm(100),4))
k.sample.test(d(a,b)~d,dat)
k.sample.test(dat[,-4]~dat$d,var.equal=TRUE)
k.sample.test(d(a,c)~d,dat,kruskal.test)

Run the code above in your browser using DataLab