View source: R/utility_usek1d.R
usek1d | R Documentation |
Any k-sample method implies that it can be used for
a special case of k=2. usek1d
lets any k-sample tests
provided in this package be used with two univariate samples x and y.
usek1d(x, y, test.name, ...)
x |
a length-n data vector. |
y |
a length-m data vector. |
test.name |
character string for the name of k-sample test to be used. |
... |
extra arguments passed onto the function |
a (list) object of S3
class htest
containing:
a test statistic.
p-value under H_0.
alternative hypothesis.
name of the test.
name(s) of provided sample data.
### compare two-means via anova and t-test ### since they coincide when k=2 x = rnorm(50) y = rnorm(50) ### run anova and t-test test1 = usek1d(x, y, "meank.anova") test2 = mean2.ttest(x,y) ## print the result cat(paste("\n* Comparison of ANOVA and t-test \n","*\n", "* p-value from ANOVA : ", round(test1$p.value,5),"\n", "* t-test : ", round(test2$p.value,5),"\n",sep=""))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.