z_test | R Documentation |
This function asks you a sequence of questions in order to execute a z-test. It finds a confidence interval and a p-value, produces a plot, and indicates how this could be queried directly from R.
z_test()
*******
Z-TESTS
*******
> z_test()
What is the *population* standard deviation? 4
What is your sample mean? 8
What is the theoretical mean you are testing against (called mu_0)? 7.5
What is your sample size? 36
What is your desired confidence level? .90
Are you doing a one-sided or two-sided test? Possible answers are 'less', 'greater', and 'two-sided'. two-sided
The probability of getting this result or more extreme for xbar if mu really is 7.5 is
p = 0.4532547
You can get this result by typing:
2*(1-pnorm(8,7.5,4/sqrt(36))
The 90% confidence interval for the population mean is
6.903431 < mu < 9.096569
You can get this result by finding:
zstar = 1-qnorm((1-0.9)/2,0,1) = 1.644854
and then calculating:
8 - 1.644854 x 4/sqrt(36) and 8 + 1.644854 x 4/sqrt(36)
> z_test()
What is the *population* standard deviation? 4
What is your sample mean? 8
What is the theoretical mean you are testing against (called mu_0)? 7.5
What is your sample size? 16
What is your desired confidence level? .99
Are you doing a one-sided or two-sided test? Possible answers are 'less', 'greater', and 'two-sided'. less
The probability of getting this result or more extreme for xbar if mu really is 7.5 is
p = 0.6914625
You can get this result by typing:
pnorm(8,7.5,4/sqrt(16))
The 99% confidence interval for the population mean is
5.424171 < mu < 10.57583
You can get this result by finding:
zstar = 1-qnorm((1-0.99)/2,0,1) = 2.575829
and then calculating:
8 - 2.575829 x 4/sqrt(16) and 8 + 2.575829 x 4/sqrt(16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.