Professional Documents
Culture Documents
S. Devi Yamini
H0 : µ = µ0 , H1 : µ < µ0
x̄ −µ
Test statistic: Z = σ
√ follows standard normal distribution.
n
R-code
xbar=9900
mu0=10000
sigma=120
n=30
z=(xbar-mu0)/(sigma/sqrt(n))
z
[1] -4.564355
Lab 6 February 22, 2023 3 / 14
Problem 1
R code
alpha=0.05
zalpha=qnorm(alpha)
[1] -1.644854
R code
alpha=0.05
zalpha=qnorm(alpha)
[1] -1.644854
if (z < zalpha) print("Reject H0 ") else print("Accept H0 ")
[1] "Reject H0 "
Interpretation
The test statistic -4.5644 is less than the critical value -1.644854.
So, we reject the null hypothesis. Hence, at 5% significance level,
we accept the claim that the mean lifetime of a light bulb is less
than 10,000 hours.
H0 : µ = µ0 , H1 = µ > µ0
x̄ −µ
Test statistic: Z = σ
√ follows standard normal distribution.
n
R-code
xbar=2.1
mu0=2
sigma=0.25
n=35
z=(xbar-mu0)/(sigma/sqrt(n))
z
[1] 2.366432
Lab 6 February 22, 2023 6 / 14
Problem 2
R code
alpha=0.05
zalpha=qnorm(1-alpha)
[1] 1.644854
R code
alpha=0.05
zalpha=qnorm(1-alpha)
[1] 1.644854
if (z > zalpha) print("Reject H0 ") else print("Accept H0 ")
[1] "Reject H0 "
Interpretation
The test statistic 2.3664 is greater than the critical value 1.644854.
So, we reject the null hypothesis. Hence, at 5% significance level,
we accept the claim that there is at least 2 grams of saturated fat in
a cookie.
H0 : µ = µ0 , H1 = µ ̸= µ0
x̄ −µ
Test statistic: Z = σ
√ follows standard normal distribution.
n
R code
alpha=0.05
zalpha=qnorm(alpha/2)
[1] -1.959964
R code
alpha=0.05
zalpha=qnorm(alpha/2)
[1] -1.959964
if (abs(z)< abs(zalpha)) print("Accept H0") else print("Reject H0")
Interpretation
The test statistic -1.8931 lies between the critical values -1.96 and
1.96. So, we accept the null hypothesis. Hence, at 5% significance
level, we accept the claim the null hypothesis that the mean
penguin weight does not differ from the last year.
H0 : P = P0 , H1 = P ≤ P0
p −P
Test statistic: z = q PQ
follows standard normal distribution.
n
H0 : P = P0 , H1 = P ≤ P0
p −P
Test statistic: z = q PQ
follows standard normal distribution.
n
Problem 1
Suppose 60 % of citizens voted in last election. 85 out of 148 people
in a telephone survey said that they voted in the current election. A
0.05 significance level, test the hypothesis that the proportion of
voters in the population is below 60 % this year?
R code
p=85/148
P=60/100
n=148
Q=1-P
z=(p-P)/sqrt(P x Q/n)
z
[1] -0.6375983
alpha=0.05
zalpha=qnorm(alpha)
[1] -1.644854
alpha=0.05
zalpha=qnorm(alpha)
[1] -1.644854
if (z < zalpha) print("Reject H0") else print("Accept H0")
[1] "Accept H0"
Interpretation
The test statistic -0.6376 is more than the critical value -1.644854.
So, we accept the null hypothesis. Hence, at 5% significance level,
there is no evidence to prove that the proportion of voters in the
population is below 60% this year.