Calculates the p-value for a proposed mean for a population with unknown standard deviation, using the t-statistic (t distribution).

pval_t(x, s, n, mu, side = c("two", "one"))

Arguments

x

Sample mean

s

Sample standard deviation

n

Sample size

mu

Population mean

side

To either get a two-tail or one-tail p-value (Default is "two")

Value

P-value

Examples

x <- 6.14 s <- 0.803 n <- 9 mu <- 7 pval_t(x, s, n, mu)
#> [1] 0.0124