Wednesday, October 12, 2011

Test if two samples are different

visually using boxplot()

assuming normal distribution, use

t.test(A, B) #default does not assume equality of variance, small p-value = diff. means, Welch Two sample t-test (unpaired)

var.test(A, B) # test for equality of variance, big p-value = same variance

t.test(A, B, var.equal=TRUE) # Two sample t-test

wilcox.test(A, B) # does not assume normality, just assume a common continous distribution under the null hypothesis, small p-value = diff means

http://cran.r-project.org/manuals.html

No comments: