One sample t-test for a vector
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@yahoo.gr>
x = rnorm(500) res<-t.test(x, mu = 0) res<-ttest1(x, 0, conf = 0.95)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.