objectives use simulations and hypothesis testing to compare treatments from a randomized experiment

27
Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment.

Upload: timothy-ferguson

Post on 17-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Objectives

Use simulations and hypothesis testing to compare treatments from a randomized experiment.

Page 2: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Vocabularyhypothesis testingnull hypothesisalternative hypothesisreject claimsignificant evidencez-scoreunusual z-score (outlier)

Page 3: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Suppose you flipped a coin 20 times. Even if the coin were fair, you would not necessarily get exactly 10 heads and 10 tails. But what if you got 15 heads and 5 tails, or 20 heads and no tails? You might start to think that the coin was not a fair coin, after all.

Hypothesis testing is used to determine whether the difference in two groups is likely to be caused by chance.

Page 4: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

You try it. Flip a coin 20 times and record the outcomes that you get below like.....HHTHTTT.....Then, put it in the table:

Heads Tails

Simulated or Observed Outcomes

Expected Outcomes

Add the expected number of outcomes to your table (How many heads would you expect to get if you flippedthe coin 20 times? How many tails?

Now compare your simulated values to the expected values. Are they close?_____ Explain._______________ Check with your neighbors to see if they agree.

Page 5: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Class Survey:Raise your hand if you think your simulation was close to what you would expect_________. Not close_________.

Perhaps 20 simulations is not enough to get a consensus of whether a randomly selected coin is fair. Let's pool class data......

How many students are in our class?_________ If each student flipped the coin 20 times, how many heads would we expect?____________ Tails?___________

Put our class totals in the table below:Heads Tails

Class total Observed (simulated)

Expected

Page 6: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Hypothesis testing begins with an assumption called the null hypothesis. The null hypothesis states that there is no difference between the two groups being tested. The purpose of hypothesis testing is to use experimental data to test theviability of the null hypothesis.

In the case of our coin flipping experiment, our two groups would be the observed outcomes and the expected outcomes.So, our null hypothesis would state that there is no difference between the observed outcomes and the expected outcomes. In other words, the two groups should basically be the same.

Page 7: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

The alternative hypothesis is the opposite of the null hypothesis.

Which of the following is the null hypothesis and alternative hypothesis for our coin flip simulation?Null HypothesisAlternative hypothesis

A randomly selected coin has a 50/50 chance of landing on heads/tails.

A randomly selected coin does not have a 50/50 chance of landing on heads/tails

Page 8: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

We have to assume that the null hypothesis is true unless we have enough evidence to reject it.

In the case of coin flipping, what do we have to assume is true?_______________________________

"Evidence" is gathered to determine if our null hypothesis is true or if we have enough proof to reject the claim.

What evidence did we collect?_____________________________________

Page 9: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Analyzing the evidence:

We now need to look at the evidence and make a decision to reject the null hypothesis or not.

We can make graphs of the data to help with our decision, find summary statistics, or both.

In this case, we would find what percent of the class outcomes were heads:_____ tails?_____

What percent of the class outcomes are expected to be heads?______ tails?_____

Are the percents basically the same?____________

Are the percents radically different?__________

We can also compare graphs such as a side-by-sidebar graph:

perc

en

tsobserved expected observed expectedheads heads tails tails

Page 10: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

If they are basically the same, we do not reject the null hypothesis and assume that randomly selected coins have a 50/50 chance of landing on heads/tails.

If they are radically different, we reject the null hypothesis claim and say that there is enough evidence to say that coins are not 50/50.

Based on our class data, what should we conclude?______________________

Page 11: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Steps for a significance test:

Step 1: Come up with a question, and write the appropriate hypotheses. The null is a statement of no effect, the alternative is the opposite.

Step 2: Collect data as your evidence.

Step 3: Analyze data by transforming it into summary statistics and graphs.

Step 4: Decide whether to reject the null hypothesis or not based on your evidence.

Page 12: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

The null hypothesis should be that the music has no effect on retention. If the control group results are the same

as the test group results, then music did not matter.

Page 13: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Analyze evidence with summary statistics and graphs

Make 2 boxplots using the 5 number summary above.

Page 14: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Make a decision:

Page 15: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

A researcher is testing whether a certain medication for raising glucose levels is more effective at higher doses. In a random trial, fasting glucose levels of 5 patients being treated at a normal dose (Group A) and 5 patients being treated at a high dose (Group B) were recorded. The glucose levels in mmol/L are shown below.

A. State the null hypothesis for the experiment.

The glucose levels of the drug will be the same for the control group (A) and the treatment group (B).

Page 16: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Analyze evidence with summary statistics and graphs

Make a 5 number summary and boxplots below:

Page 17: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

B. Compare the results for the control group and the treatment group. Do you think that the researcher has enough evidence to reject the null hypothesis?

The minimum, maximum, median, and quartile values are as shown in the diagram below. There is a small difference in the two groups that is likely to be caused by chance. If anything, the treatment group actually shows a tendency toward higher glucose levels. The researcher cannot reject the null hypothesis, which means that the medication is probably just as effective at the normal dose as it is at the high dose.

Page 18: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

A teacher wants to know if students in her morning class do better on a test than students in her afternoon class. She compares the test scores of 10 randomly chosen students in each class.

Morning class: 76,81,71, 80,88,66,79,67,85,68Afternoon class: 80,91,74,92,80,80,88,67,75,78a. State the null hypothesis

The students in the morning class will have the same test scores as the students in the afternoon class

Page 19: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Analyze evidence with summary statistics and graphs

Morning class: 76,81,71, 80, 88, 66, 79, 67, 85, 68

Afternoon class: 80,91,74,92,80,80,88,67,75,78

Page 20: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

b. Compare the results of the two groups. Does the teacher have enough evidence to reject the null hypothesis?Yes; there is a large difference in the test scores of the two classes. The teacher does have enough evidence to reject the null hypothesis, so she can conclude that students in her afternoon class perform better on tests.

Page 21: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

1. A software company is testing whether a new interface decreases the time it takes to complete a certain task. In a random trial, Group A used the existing interface and Group B used the new one. The times in seconds are given for the members of each group.Group A: 12, 16, 12, 15, 17, 9, 13, 14, 16, 14Group B: 8, 12, 10, 14, 9, 10, 13, 13, 10, 14

State the null hypothesis for the experiment.

The task will take the same amt. of time for both groups.

Page 22: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Analyze evidence with summary statistics and graphs

Group A: 12, 16, 12, 15, 17, 9, 13, 14, 16, 14Group B: 8, 12, 10, 14, 9, 10, 13, 13, 10, 14

Page 23: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

Compare the results for Group A and Group B. Do you think that there is enough evidence to reject the null hypothesis?

Page 24: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

z-score: A z-score is a standardized value that will help us to compare and make decisions. It is the number of standard deviations away from the mean. It is mostly used to describe normal distributions which we will look at in section 2.2. Right now, we will use a z-score to help us to decide if we should reject the null hypothesis claim or not.

If z > 1.96, reject the null hypothesis claim.

If z < -1.96, rejectthe null hypothesisclaim

z-score of 0 is averagez-score 1.96 or more is unusually above averagez-score of -1.96 or less is unusually below average

z-scores

Page 25: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

The same test prep company claims that its private tutoring can boost scores to an average of 2000. In a random sample of 49 students who were privately tutored, the average was 1910, with a standard deviation of 150. Is there enough evidence to reject the claim?

The z–value is –4.2, and | z | > 1.96. So, there is enough evidence to reject the null hypothesis. You can say with 95% confidence that the company’s claim about private tutoring is false.

Find the z-score:Compare the z-score to 1.96 or -1.96 and make your decision to reject the claim or not.

= _________

Page 26: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

A tax preparer claims an average refund of $3000. In a random sample of 40 clients, the average refund was $2600, and the standard deviation was $300. Is there enough evidence to reject his claim?

Find the z-score:

= _________ Compare the z-score to 1.96 or -1.96 and make your decision to reject the claim or not.

Page 27: Objectives Use simulations and hypothesis testing to compare treatments from a randomized experiment

2. To disprove a previous study that claims that college graduates make an average salary of $46,000, a researcher records the salaries of 50 graduates and finds that the sample mean is $43,000, with a standard deviation of $4,500. What is the z-value, and can she reject the null hypothesis?

–4.71; yes