ttesti {rigr} | R Documentation |
T-test Given Summary Statistics with Improved Layout
Description
Performs a one- or two-sample t-test given summary statistics. In the two-sample case, the user can specify whether or not equal variances should be presumed.
Usage
ttesti(
obs,
mean,
sd,
obs2 = NA,
mean2 = NA,
sd2 = NA,
null.hypoth = 0,
conf.level = 0.95,
alternative = "two.sided",
var.eq = FALSE,
more.digits = 0
)
Arguments
obs |
number of observations for the first sample. |
mean |
the sample mean of the first sample. |
sd |
the sample standard deviation of the first sample. |
obs2 |
number of observations for the second sample (this is optional). |
mean2 |
if |
sd2 |
if |
null.hypoth |
a number specifying the null hypothesis for the mean (or difference in means if performing a two-sample test). Defaults to zero. |
conf.level |
confidence level of the test. Defaults to 0.95. |
alternative |
a string: one of
|
var.eq |
a logical value, either
|
more.digits |
a numeric value specifying whether or not to display more or fewer digits in the output. Non-integers are automatically rounded down. |
Details
If obs2
, mean2
, or sd2
is specified, then all three must be specified
and a two-sample t-test is run.
Value
a list of class ttesti
. The print method lays out the information in an easy-to-read
format.
tab |
A formatted table of descriptive and inferential statistics (number of observations, mean, standard error of the mean estimate, standard deviation), along with a confidence interval for the mean. |
df |
Degrees of freedom for the t-test. |
p |
P-value for the t-test. |
tstat |
Test statistic for the t-test. |
par |
A vector of information about the type of test (null hypothesis, alternative hypothesis, etc.) |
twosamp |
A logical value indicating whether a two-sample test was performed. |
call |
The call made to the |
Examples
# t-test given sample descriptives
ttesti(24, 175, 35, null.hypoth=230)
# two-sample test
ttesti(10, -1.6, 1.5, 30, -.7, 2.1)