Hypothesis Tests 1

Jim Mahoney, October 2003

Overview

This is a summary of the material in chapters 8, 9, and 10 in our Understanding Statistics text, which describe the basic idea behind hypothesis tests as well as several specific tests based directly on the binomal, the normal distribution, and the z - scorethat we've done in earlier chapters.

What's coming up next are several other more sophisticated tests, the Student's t-test, the Chi Square test, and the Anova test.  Each is appropriate for slightly different circumstances.  But first, the three situations we want to look at are
	one sample tests of percentages (chap 8)
	two sample tests of percentages (chap 9)
	comparing means of large samples (chap 10)

The appropriate formulas in each case come from the same underlying principles, which I'm going to try to summarize here in one place.  

The overall procedure for all these hypothesis tests is roughly the same, as described in the text near the end of chapter 8.  Typically you come up with a null hypothesis (Subscript[H, 0])which fits the model of one of of the tests, with a corresponding motivated hypothesis (Subscript[H, α])which you are trying to show.  You then decide upon the data you'll collect, and a critical value of some parameter based on a chosen level of significance α.  The various kinds of tests have different formulas for these critical values, though the underlying idea is always based on a probability distrubtion.  Then you collect your data, compare your results with the critical value, and either reject the null hypothesis or not.  As discussed in the text and in class, there are two ways to come up with the wrong answer depending on whether (Subscript[H, 0])is really true or not; the probabilities of these Type-I and Type-II errors are named α and β.

Formulas

mean and standard deviation

Any random variable x with a probability distribution (Subscript[P, x]) has a mean μ and standard deviation σ given by

\(μ\_x\  = \ \(Σ\ x\ P\_x\  = \ ⟨x⟩\)\)
\(σ\_x = \(\@⟨\((x - μ\_x)\)\^2⟩\  = \ \@\(\((Σ\ x\^2\ P\_x)\) - μ\_x\^2\)\)\)

We can add or subtract two such random variables to create a third, and express the new mean and standard deviation in terms of the old ones.

y  =  (Subscript[x, 1]) ±  (Subscript[x, 2])
(Subscript[μ, y]) =  (Subscript[μ, (Subscript[x, 1])]) ±  (Subscript[μ, (Subscript[x, 2])])
\(σ\_y = \(\(\)\(\@\(σ\_\(x\_1\)\^2\  + \ σ\_\(x\_2\)\^2\)\)\)\)

These results assume that the two random variables (Subscript[x, 1]) and (Subscript[x, 2]) are independent.  They follow directly from the definitions of mean and standard deviations and the fact that (Subscript[P, y])  =  (Subscript[P, (Subscript[x, 1])]) (Subscript[P, (Subscript[x, 2])]).

binomial

A binomial random variable x has possible values 1 (success) and 0 (failure).  
We call the probability of success p and the probability of failure q = 1 - p.
In N trials the number of successes is

(Subscript[μ, N]) =  N p
(Subscript[σ, N]) =  (Sqrt[N p q])

binomial with N=1

Using a subscript "1" to emphasise that we're talking about one trial (N = 1), we have

(Subscript[μ, 1]) =  p 
(Subscript[σ, 1]) =  (Sqrt[p q])

percentage

Here's where it can get a bit confusing.  
Often we would prefer to use the percentage (or fraction) of successes rather than the actual number of successes.  All we need do to get this percentage is divide by the number of trials N.  And since this is just a change of scale, the same division by N applies to the mean and standard deviation of this percentage.

(Subscript[μ, p]) =  (μ/N) = p  = (Subscript[μ, 1])
\(σ\_p = \(σ\_N\/N = \ \(\@\(\(p\ q\)\/N\) = σ\_1\/\@N\)\)\)

difference of two percentages

Now we just apply the results from above.  If we do two surveys, with numbers of trials (Subscript[N, 1]) and (Subscript[N, 2]) respectively, and find (Subscript[S, 1]) and (Subscript[S, 2]) successes, then the mean and standard deviation of the difference of the two percentages looks like this.

(Subscript[p, 1]) =  (Subscript[S, 1]) / (Subscript[N, 1])  ;       (Subscript[p, 2]) =  
      (Subscript[S, 2])/(Subscript[N, 2])
dp  =  (Subscript[p, 1]) -  (Subscript[p, 2])
\(σ\_dp = \ \(\@\(σ\_\(p\_1\)\^2\  + \ σ\_\(p\_2\)\^2\) = \@\(\(p\_1\ q\_1\)\/N\_1 + \(p\_2\ q\_2\)\/N\_2\)\)\)

standard deviation of the estimate of the mean

If we use a sample size of N to find m, which estimates the true population mean, then a different sample will give a different m.  Thus m is also a random variable.  The mean value of m is μ, the true population mean, and the standard deviation is again smaller by the inverse of the square root of N, for the same reasons.  (However, when N is small, and we don't know the true population standard deviation, then its better to use the Student's t distribution than this σ and the normal distribution.)

(Subscript[μ, m]) = μ
(Subscript[σ, m]) = ((Subscript[σ, 1])/(Sqrt[N]))

standard deviation of the difference of means

Likewise, if we have two populations whose means we want to compare,  the difference of their m' s estimated from samples of size (Subscript[N, 1]) and (Subscript[N, 2])follows the same kind of logic.

(Subscript[μ, dm]) = (Subscript[μ, 1]) - (Subscript[μ, 2])
\(s\_dm = \(\@\(s\_\(m\_1\)\^2 + s\_\(m\_2\)\^2\) = \@\(s\_1\^2\/N\_1 + s\_2\^2\/N\_2\)\)\)

z-score

For all of these, we can find probabilities by looking up the appropriate values for a normal distribution.  To do this from the table in appendix D-4, we convert to a standard normal distribution z, in which (Subscript[μ, z]) = 0 and (Subscript[σ, z]) = 1.  Remember that this is only a reasonable approximation to the binomial if μ > 5 and (σ^2) >  5.

x  =  μ  +  z σ
z  =  ((x  -  μ)/σ)

in class 10/28

In class
9-4
example on page 277



Assign:
* 9-11, 9-19
* In the class survey, is the percentage of brown haired females the same as the percentage of brown haired males?
* 10-9, 10-25
* Hypothesis test of your choice from class survey - make one up.