Hypothesis Testing




More Stats


How many samples do I need?


An Example: Sam's weight


Properties of Confidence Intervals


How accurate is the confidence interval?


Potential Problems


Hypothesis Testing


Null Hypothesis


One Tail vs Two Tail


P-value


Calculating the p-value


Pick a significance level


In our example


Relationships to Confidence Intervals


What about smaller alpha levels?


Demo on power and hypothesis testing.





Questions
The Frayed Nerves Anxiety Scale (FNAS) is used to measure the anxiety level of people on a scale from 0 to 1000. Four students were randomly chosen and given the FNAS before their second exam. Their scores were 700, 653, 740, and 707. The standard deviation sigma of the test is 40.

1. What is x bar?

2. What is the standard deviation of the mean?

3. What is the 95% confidence interval for x bar?

4. What is the 99% confidence interval for x bar?

5. How many students do you need to survey to get the plus or minus for the 95% confidence interval down to 20?

6. How about for the 99% confidence interval?

7. A TA for the class states that the mean stress level of the class is 750. The professor is not so sure. Take the TA's belief as the null hypothesis. Remember, only four subjects were run.

a. State the null and alternative hypotheses

b. Calculate the p-value for the null hypothesis.

c. Is it significant with alpha equal to .05?

d. Is it significant with alpha equal to .01?



More questions
How many days a year does it rain in Seattle? A local weather person states that the average number of days is 50. Take this as the null hypothesis. The alterntive is that mu does not equal 50. Sigma is 12.

Looking at data from the last nine years, the mean is 55 rainy days per year. What is the 95% confidence interval for x bar? What is the p-value for the null hypothesis? Do you reject the null hypothesis with an alpha level of .05? Does the hypothesized mu fall within the 95% confidence interval?

What z-score is associated with a 95% confidence interval or .05 alpha level: z(95%)=1.96

What is the standard deviation associated with the sample mean: 12/sqrt(9)=4

What is the 95% confidence interval: 55 plus or minus 4*1.96=7.84

How many z-scores apart is x-bar from the null hypothesis mu:
(55-50)/4=1.25

Is the p-value more or less than the alpha level: more.

To be exact:
plus or minus 1.25 is 79% of the normal distribution, so the p-value is .21








T-tests


Hypothesis Testing


Extension


Standard Error of the Mean


z and t distributions


t and z distributions


How is t related to z (normal distribution)?

N(0,1) and t(5)




Degrees of Freedom




Demo on comparing t and normal distribution


The logic of the one sample t-test


Building a confidence interval with t's


An Example - find the 95% confidence interval for x bar.


A one sample t-test




Questions
The Frayed Nerves Anxiety Scale (FNAS) is used to measure the anxiety level of people on a scale from 0 to 1000. Four students were randomly chosen and given the FNAS before their second exam. Their scores were 700, 653, 740, and 707. We don't know what sigma is.

1. What is x bar?

2. What is the standard error of the mean?

3. What is the 95% confidence interval for x bar?

4. What is the 99% confidence interval for x bar?

5. What is the 80% confidence interval for x bar?

6. A TA for the class states that the mean stress level of the class is 750. The professor is not so sure. Take the TA's belief as the null hypothesis. Remember, only four subjects were run.

a. State the null and alternative hypotheses

b. Is it significant with alpha equal to .05?

c. Is it significant with alpha equal to .01?






More t-tests.


Again, calculate the statistics



Testing and Caffeine


So, we now know one sample t-tests


What if we want to see if two samples are different?
The great questions of our time: What's the null hypothesis here? What to do with two groups



Calculating the t statistic


Here's an experiment


t test is robust


Questions
A public health advocate believes children growing up by power lines get sick 15 days per year. Take sigma for the number of days equal 4. A sample of three children is gathered with number of sick days equal to 19, 15, 17. Do you reject the null hypothesis?

x bar is 17.
stadnard deviation of the mean is 4/sqrt(3) = 2.31
z score = (17 - 15)/2.31 = .866
p value = .36, do not reject with alpha of .05


Do the same problem, but now sigma is unknown.
variance = 4
s = 2
standard error of the mean = 2/(sqrt(3) = 1.15

t(2) = (17 - 15)/1.15 = 1.74
p value = .22, do not reject with alpha of .05


Another researcher wants to compare the effect on boys and girls. She gets a sample of three girls, 10, 15, 20, as well as a sample of boys, 14, 20, 26. Are boys and girls affected differently by the power lines?

x bar girls = 15
x bar boys = 20

variance for girls = 25
variance for boys = 36

pooled variance = (2*25+2*36)/4 = 30.5
pooled standard deviation = 5.52

t(4) = (15-20) / 5.52*sqrt(1/3 + 1/3) = -1.09
p value = .34, do not reject with alpha of .05





More questions
An American and a Englishman get in an argument over who is more boring: Canadians or Belgians (subsequently a Belgian and a Canadian get in an argument over the relative intelligence levels of the English and the Americans, but that is a different story). To resolve the debate, the American and the Englishman collect some data on Canadians and Belgians using the North Atlantic Boredom Scale (NABS). A high rating indicates a boring person.

The data for four Canadians are: 25, 5, 24, 14.

The data for four Belgians are: 31, 41, 22, 42

a. State the null and alternative hypothesis.

b. Do Canadians and Belgians differ significantly in their level of boringness (use alpha at .05)?



Online tutorials when you need help.