Table of Contents
Z critical values in R refer to the critical values of the standard normal distribution, which are used in statistical hypothesis testing to determine the probability of obtaining a certain sample mean or proportion. These values are essential in determining whether a sample mean or proportion falls within a specific range of values and are crucial in making decisions about the significance of a statistical test. In R, these values can be calculated using the qnorm() function and are often used in conjunction with confidence intervals and p-values to assess the strength of evidence for or against a null hypothesis.
Find Z Critical Values in R
Whenever you conduct a hypothesis test, you will get a test statistic as a result. To determine if the results of the hypothesis test are statistically significant, you can compare the test statistic to a Z critical value. If the absolute value of the test statistic is greater than the Z critical value, then the results of the test are statistically significant.
To find the Z critical value in R, you can use the qnorm() function, which uses the following syntax:
qnorm(p, mean = 0, sd = 1, lower.tail = TRUE)
where:
- p: The significance level to use
- mean: The mean of the normal distribution
- sd: The standard deviation of the normal distribution
- lower.tail: If TRUE, the probability to the left of p in the normal distribution is returned. If FALSE, the probability to the right is returned. Default is TRUE.
The following examples illustrate how to find the Z critical value for a left-tailed test, right-tailed test, and a two-tailed test.
Left-tailed test
Suppose we want to find the Z critical value for a left-tailed test with a significance level of .05:
#find Z critical value qnorm(p=.05, lower.tail=TRUE) [1] -1.644854
The Z critical value is -1.644854. Thus, if the test statistic is less than this value, the results of the test are statistically significant.
Right-tailed test
Suppose we want to find the Z critical value for a right-tailed test with a significance level of .05:
#find Z critical value qnorm(p=.05, lower.tail=FALSE) [1] 1.644854
The Z critical value is 1.644854. Thus, if the test statistic is greater than this value, the results of the test are statistically significant.
Two-tailed test
Suppose we want to find the Z critical value for a two-tailed test with a significance level of .05:
#find Z critical value qnorm(p=.05/2, lower.tail=FALSE) [1] 1.959964
You can find more R tutorials .