Q1. Suppose that in a one-tail hypothesis test where you reject H0 only in the upper tail, you compute the value of the test statistic Z to be 2.00. What is the p value?
pvalue = pnorm(2,0,1, lower.tail = FALSE)
pvalue
## [1] 0.02275013
Q2. Suppose that in a one-tail hypothesis test where you reject H0 only in the lower tail, you compute the value of the test statistic Z to be –1.38. What is the p value?
pvalue = pnorm(-1.38,0,1,lower.tail = TRUE)
pvalue
## [1] 0.08379332
Q3. Suppose that in a one-tail hypothesis test where you reject H0 only in the lower tail, you compute the value of the test statistic Z to be +1.38. What is the p value?
pvalue = pnorm(1.38,0,1,lower.tail = TRUE)
pvalue
## [1] 0.9162067
Q4. Dataset: Hourly_Wage. The data accompanying this exercise show hourly wages (Wage in $) for 50 employees. An economist wants to test if the average hourly wage is less than $22. Assume that the population standard deviation is $6.
4a. State the null and the alternative hypotheses for the test. \(H_0:\mu\ge 22\) \(H_1:\mu\ < 22\) 4b. Find the value of the test statistic and the p-value.
n = nrow(Hourly_Wage)
n
## [1] 50
x_bar = mean(Hourly_Wage$Wage)
x_bar
## [1] 20.2106
4c. At 0.05 significance level, what is the conclusion to the test? Is the average hourly wage less than $22? my.alpha = .05 my.sigma = 6 Z stat
#Standard Error
SE = 6/sqrt(50)
SE
## [1] 0.8485281
#Z statistics
ZT = (x_bar-22)/SE
ZT
## [1] -2.108828
pvalue
pvalue = pnorm(-2.108828,0,1,lower.tail = TRUE)
pvalue
## [1] 0.01747972
pvalue(.01747972) < significance level(.05)
Since p_value (0.01747972) < \(\alpha\) (0.05), we reject the null hypothesis. At the 5% significance level, We can conclude that the average hourly wage at the company is less than $22 per hour. The sample data does support the economists claims.