Description Usage Arguments Value Source Examples
Since the "standard" z-test is not available in R as in most real-world scenarios you're only ever going to use a t-test, this function fills that gap for teaching purposes. The function is basically a carbon-copy of stats::t.test, but with user-supplied variances for x and y and p-value and related calculations use a standard normal distribution.
1 2 3 4 5 6 7 8 9 10 |
x |
A (non-empty) numeric vector of data values |
y |
An optional (non-empty) numeric vector of data values. If omitted, a one-sample test is conducted. |
alternative |
A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. |
mu |
A number indicating the true value of the mean (or difference in means if you are performing a two sample test). |
sigma_x, sigma_y |
The assumed known variance of |
paired |
A logical indicating whether you want a paired t-test. |
conf.level |
Confidence level of the interval. |
An object of class htest
, see stats::t.test
stats::t.test
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.