infer_os_t_test {inferr}R Documentation

One Sample t Test

Description

infer_os_t_test performs t tests on the equality of means. It tests the hypothesis that a sample has a mean equal to a hypothesized value.

Usage

infer_os_t_test(
  data,
  x,
  mu = 0,
  alpha = 0.05,
  alternative = c("both", "less", "greater", "all"),
  ...
)

Arguments

data

a data.frame or tibble

x

numeric; column in data

mu

a number indicating the true value of the mean

alpha

acceptable tolerance for type I error

alternative

a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter

...

additional arguments passed to or from other methods

Value

infer_os_t_test returns an object of class "infer_os_t_test". An object of class "infer_os_t_test" is a list containing the following components:

mu

a number indicating the true value of the mean

n

number of observations

df

degrees of freedom

Mean

observed mean of x

stddev

standard deviation of x

std_err

estimate of standard error

test_stat

t statistic

confint

confidence interval for the mean

mean_diff

mean difference

mean_diff_l

lower confidence limit for mean difference

mean_diff_u

upper confidence limit for mean difference

p_l

lower one-sided p-value

p_u

upper one-sided p-value

p

two sided p-value

conf

confidence level

type

alternative hypothesis

var_name

name of x

Deprecated Function

ttest() has been deprecated. Instead use infer_os_t_test().

References

Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.

See Also

t.test

Examples

# lower tail
infer_os_t_test(hsb, write, mu = 50, alternative = 'less')

# upper tail
infer_os_t_test(hsb, write, mu = 50, alternative = 'greater')

# both tails
infer_os_t_test(hsb, write, mu = 50, alternative = 'both')

# all tails
infer_os_t_test(hsb, write, mu = 50, alternative = 'all')


[Package inferr version 0.3.1 Index]