Calculates the p-value for a proposed mean for a population with known standard deviation, using the Z-statistic (normal distribution).
pval_z(x, sig, n, mu = 0, side = c("two", "one"))
x | Sample mean |
---|---|
sig | Population standard deviation |
n | Sample size |
mu | Population mean |
side | To either get a two-tail or one-tail p-value (Default is "two") |
P-value
x <- 2.6 sig <- 0.3 n <- 36 mu <- 2.5 pval_z(x, sig, n, mu)#> [1] 0.0455