se_tests | R Documentation |
Given an arbitrary random sample, t-statistics are calculated in order to obtain information about the precision of the sample mean or sum. A list of useful statistics is returned, most importantly the standard error and the confidence boundaries according to the confidence level provided by the user.
se_tests(
x,
mu = 0,
ref = c("mean", "sum"),
alternative = c("two.sided", "greater", "less"),
conf.level = 0.95
)
x |
vector representing the sample to be evaluated |
mu |
the hypothesized mean for the null hypothesis, standard = 0 |
ref |
the reference value for the satistic, whether it is calculated from the mean or the sum, default = 'mean' |
alternative |
a character string specifying the alternative hypothesis for the t-statistics: "two-sided", "greater" or "less". Default is "two-sided" |
conf.level |
confidence level of the interval, Default = 0.95 |
A list containing various statistics such as standard error, t-statistic, degrees of freedom, p-value, and confidence interval and margin of error as a percentage of the mean or sum, respectively.
set.seed(123)
data <- rnorm(100, mean = 5, sd = 2)
# Test for sum
se_tests(
data, mu = 0, ref = "sum", alternative = "two.sided", conf.level = 0.95
)
# Test for mean
se_tests(
data, mu = 0, ref = "mean", alternative = "two.sided", conf.level = 0.95
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.