One-sample t-test
one_t_inference.RdCompute the mean of a sample and the corresponding confidence interval, using Student's t distribution. Optionally, compute a p-value for a specified null hypothesis.
Usage
one_t_inference(
formula,
data,
alternative = c("two.sided", "less", "greater"),
null,
conf.level = 0.95,
backtransform = TRUE
)Arguments
- formula
a formula of the form
~ yory ~ 1, whereyis a numeric variable. To perform test within subgroups, usey ~ xory ~ 1 | g, or eveny ~ x | g, wherexandgare factor variables.- data
a data frame containing the values in the formula.
- alternative
character string specifying the alternative hypothesis, must be one of "
two.sided" (default), "greater" or "less".- null
a number specifying the null proportion for testing a null hypothesis; if not specified, no hypothesis test is performed.
- conf.level
confidence level of the returned confidence interval. Must be a single number between 0 and 1.
- backtransform
if response variable is of form
log(...), backtransform the resulting estimate and confidence interval bounds.