View source: R/ttest_related_functions.R
One sample t-test for a vector | R Documentation |
One sample t-test for a vector.
ttest1(x, m, alternative = "unequal", logged = FALSE, conf = NULL)
x |
A numerical vector with the data. |
m |
The mean value under the null hypothesis. |
alternative |
The alternative hypothesis, "unequal", "greater" or "less". |
logged |
Should the p-values be returned (FALSE) or their logarithm (TRUE)? |
conf |
If you want a confidence interval supply the confidence level. |
The usual one sample t-test is implemented, only faster.
A list including:
res |
A two valued vector with the test statistic and its (logged) p-value. |
ci |
In the case you supplied a number in the input argument "conf" the relevant confidence interval will be returned as well. |
Michail Tsagris
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>
ttest, anova1, ttests
x = rnorm(500)
res<-t.test(x, mu = 0)
res<-ttest1(x, 0, conf = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.