*42*

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

Whenever you perform a two-tailed test, there will be two critical values. In this case, the Z critical values areÂ **1.959964Â **andÂ **-1.959964**. Thus, if the test statistic is less than -1.959964 or greater than 1.959964, the results of the test are statistically significant.

*You can find more R tutorials here.*