Next: Hypothesis tests to compare
Up: Statistical Decisions
Previous: Hypothesis tests for a
For this problem we use the same sampling theory derived for confidence intervals of population means. If the
population is approximately normally distributed or if the sample size is large, then the sampling distribution
of
is a tdistribution with n1 degrees of freedom.

The burden of proof is to show that , where is the reference value for the population
mean that is initially assumed to be true. The test statistic for this test is
The pvalue is P(T > t), the area to the right of t under the tdensity with n1 d.f.

The test statistic for this test is
The pvalue is P(T < t), the area to the left of t under the tdensity with n1 d.f.
 For the twosided test,
the test statistic is t and the pvalue is the total area under both tails of the tdensity,
More advanced tools are required to obtain the power function of this test. However, we can approximate
the power function if the sample size is large. First consider a onesided test of the hypotheses:
with level of significance . We would reject the null hypothesis if the tstatistic,
is greater than or equal to the critical value,
, where this critical value is chosen so that the
area to the right of this value under the tdistribution with n1 degrees of freedom equals .
In the large sample case, this critical value is approximately equal to the corresponding value from the
standard normal distribution. In R the approximate critical value is obtained by
This is equivalent to rejecting the null hypothesis if
Therefore, the power function for this test is given by
where represents the actual population mean. In the large sample case, we can use the standard normal
distribution to approximate the distribution of
This gives
Suppose we have a random sample of size n=80 with sample mean 65, sample s.d. 12, and we wish to
test
at 5% level of significance. In R a plot of this power function can be obtained by
xbar = 65
s = 12
n = 80
alpha = .05
mu0 = 60
criticalValue = qnorm(1alpha)
mu = seq(58,68,length=201)
power = 1  pnorm(criticalValue + (mu0  mu)*sqrt(n)/s)
plot(mu,power,type="l",xlab=expression(mu),ylab="Power")
title("Power Function of Onesided Ttest")
abline(h=alpha,col="red")
abline(h=.9,col="blue")
points(mu0,alpha,pch=19,col="red")
text(mu0,alpha,paste("Power(60) =",alpha),adj=c(.1,1.2))
beta = .1
mu1 = max(mu[power <= 1beta])
points(mu1,1beta,pch=19,col="blue")
text(mu1,1beta,paste("Power(",round(mu1,2),") = ",1beta,sep=""),adj=c(.1,1.2))
Note that the power function at the null hypothesis is always equal to the level of significance. This plot
also shows that if the population mean is 63.9, then the probability this test will reject the null hypothesis
is 0.9.
Next: Hypothesis tests to compare
Up: Statistical Decisions
Previous: Hypothesis tests for a
Larry Ammann
20141208