ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests Summary ISTA 116 Hypothesis Testing: Binary Data Part II November 14, 2013 Part II ISTA 116 Hypothesis Testing: Binary Data Two...
Author: Dwain Little
2 downloads 0 Views 506KB Size
Two-Tailed Tests

Summary

ISTA 116 Hypothesis Testing: Binary Data Part II

November 14, 2013

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Types of Errors Example H1 : Drug is better than a placebo H0 : Drug no better than a placebo I

We reject H0 if the data would be improbable on the assumption that H0 is true.

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Types of Errors Example H1 : Drug is better than a placebo H0 : Drug no better than a placebo I I

We reject H0 if the data would be improbable on the assumption that H0 is true. But improbable things happen sometimes! This means that we will occasionally reject H0 incorrectly!

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Types of Errors Example H1 : Drug is better than a placebo H0 : Drug no better than a placebo I I

We reject H0 if the data would be improbable on the assumption that H0 is true. But improbable things happen sometimes! This means that we will occasionally reject H0 incorrectly! I

E.g., we conclude that the drug works when in fact it doesn’t: reject H0 by mistake.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Types of Errors Example H1 : Drug is better than a placebo H0 : Drug no better than a placebo I

We could prevent this from ever happening by never rejecting H0

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Types of Errors Example H1 : Drug is better than a placebo H0 : Drug no better than a placebo I

We could prevent this from ever happening by never rejecting H0

I

But then we make it more likely that we make the opposite error (e.g., fail to discover valuable new drugs)

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Types of Errors I

We can summarize the possibilities in a contingency table, where one dimension is whether H0 or H1 is actually correct (does the student actually know stuff?), and the other is whether or not H0 is rejected (do we conclude that he knows stuff?).

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) False Negative False Positive No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Types of Errors I

False positives (H0 incorrectly rejected and H1 endorsed) and false negatives (H0 is incorrectly retained and H1 rejected) are called Type I Errors and Type II Errors, respectively.

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

The Type I Error Rate is the probability that we make a Type I Error out of the times that H0 is true.

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

The Type I Error Rate is the probability that we make a Type I Error out of the times that H0 is true.

I

The Type II Error Rate is the probability that we make a Type II Error out of the times that H0 is false.

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

The Type I Error Rate is the probability that we make a Type I Error out of the times that H0 is true.

I

The Type II Error Rate is the probability that we make a Type II Error out of the times that H0 is false.

I

These are

Truth

H0 is false H0 is true

probabilities. Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

The Type I Error Rate is the probability that we make a Type I Error out of the times that H0 is true.

I

The Type II Error Rate is the probability that we make a Type II Error out of the times that H0 is false.

I

These are conditional probabilities.

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

Type I Error Rate: P(Reject H0 |H0 true)

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Error Rates I

Type I Error Rate: P(Reject H0 |H0 true)

I

Type II Error Rate: P(Not Reject H0 |H0 false)

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Choosing a Significance Level I

Recall, we want to reject H0 when the data would have been unlikely if H0 were true.

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Choosing a Significance Level I

Recall, we want to reject H0 when the data would have been unlikely if H0 were true.

I

How unlikely is unlikely? We have a choice, as long as we set the threshold before we collect any data. We call this threshold α (it represents a probability).

Truth

H0 is false H0 is true

Action H0 rejected H0 not rejected No Error (Hit) Type II Error Type I Error No Error

Table: Possible outcomes of a null hypothesis significance test

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Choosing a Significance Level I

α is the Type I Error rate: the conditional proportion of the time that we expect to incorrectly reject H0 when it is true.

H0 is false H0 is true

Action H0 rejected H0 not rejected 1−β β α 1−α

1 1

Table: Conditional Error Probabilities associated with a NHST Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Choosing a Significance Level I I

α is the Type I Error rate: the conditional proportion of the time that we expect to incorrectly reject H0 when it is true. We call the Type II Error rate β. This is the conditional proportion of the time that we expect to fail to reject H0 when we should have.

H0 is false H0 is true

Action H0 rejected H0 not rejected 1−β β α 1−α

1 1

Table: Conditional Error Probabilities associated with a NHST Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Choosing a Significance Level I I

I

α is the Type I Error rate: the conditional proportion of the time that we expect to incorrectly reject H0 when it is true. We call the Type II Error rate β. This is the conditional proportion of the time that we expect to fail to reject H0 when we should have. The quantity 1 − β tells us the conditional probability that we will be able to endorse our initial hypothesis (H1 ) when it is true. This is also called the power of the test.

H0 is false H0 is true

Action H0 rejected H0 not rejected 1−β β α 1−α

1 1

Table: Conditional Error Probabilities associated with a NHST Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Step 3: Establish a Rejection Criterion

0.20

● ● ●

0.10

● ●



0.00

Probability | H0

How many does the student need to get correct for us to reject H0 ?

● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

Step 3: Establish a Rejection Criterion

0.20

● ● ●

0.10

● ●



0.00

Probability | H0

Enough so that we won’t have too many Type I Errors (false positives).

● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

Step 3: Establish a Rejection Criterion

0.20

● ● ●

0.10

● ●



0.00

Probability | H0

Convention: limit α to 5%. If we set the threshold to the 95th percentile of the H0 distribution, it will only be exceeded 5% of the time that H0 is true.

● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

1.0

Step 3: Establish a Rejection Criterion ●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●

0.6

●●●●●●●●●●

0.4

●●●●●●●●●●

●●●●●●●●●●

0.2

P(X ≥ x)

0.8

●●●●●●●●●●

●●●●●●●●●●

0.0

●●●●●●●●●● ●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

0

5

10

15

20

x

How high does c have to be so that P(X ≥ c|H0 ) is less than 5%? Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

1.0

Step 3: Establish a Rejection Criterion ●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●

0.6

●●●●●●●●●●

0.4

●●●●●●●●●●

●●●●●●●●●●

0.2

P(X ≥ x)

0.8

●●●●●●●●●●

●●●●●●●●●●

0.0

●●●●●●●●●● ●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

0

5

10

15

20

x

How high does c have to be so that P(X ≥ c|H0 ) is less than 5%? If we reject H0 when X ≥ 9, we will make a Type I Error less than 5% of the time. Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Step 4: Get the data, and check!

I

Suppose the student gets 8 correct. Then we would...

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Step 4: Get the data, and check!

I

Suppose the student gets 8 correct. Then we would...

I

Our rejection criterion was 9 and above, so we cannot reject H0 in this case.

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Type I vs. Type II Errors

I

We can set α to whatever we want. The lower it is, the less often we make Type I Errors.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Type I vs. Type II Errors

I

We can set α to whatever we want. The lower it is, the less often we make Type I Errors.

I

So why not make it really small?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Type I vs. Type II Errors

I

We can set α to whatever we want. The lower it is, the less often we make Type I Errors.

I

So why not make it really small?

I

Tradeoff: Fewer Type I Errors → More Type II Errors.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

Decreasing α moves the threshold out toward the tail of the H0 distribution. ●

α = 0.15, c = 8

● ● ● ●



● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

Decreasing α moves the threshold out toward the tail of the H0 distribution. ●

α = 0.05, c = 9

● ● ● ●



● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

Decreasing α moves the threshold out toward the tail of the H0 distribution. ●

α = 0.01, c = 11

● ● ● ●



● ●







0

5



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data









15











20

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

We will retain H0 when we do not exceed the threshold. But if H1 is correct, this is a Type II Error. The more stringent the threshold, the more likely Type II Errors become (and so we miss new discoveries). ●

α = 0.15, c = 8











● ●

● ●

0

● ●

● ●







● ●









5



● ●



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data







● ●

15

● ●









20

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

We will retain H0 when we do not exceed the threshold. But if H1 is correct, this is a Type II Error. The more stringent the threshold, the more likely Type II Errors become (and so we miss new discoveries). ●

α = 0.05, c = 9











● ●

● ●

0

● ●

● ●







● ●









5



● ●



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data







● ●

15

● ●









20

Two-Tailed Tests

Summary

Type I vs. Type II Errors

0.00 0.05 0.10 0.15 0.20

Probability

We will retain H0 when we do not exceed the threshold. But if H1 is correct, this is a Type II Error. The more stringent the threshold, the more likely Type II Errors become (and so we miss new discoveries). ●

α = 0.01, c = 11

● ●







● ●

● ●

0

● ●

● ●







● ●









5



● ●



10 Values

Part II ISTA 116 Hypothesis Testing: Binary Data







● ●

15

● ●









20

Two-Tailed Tests

Summary

Hypothesis Testing Procedure 1. Translate research question into quantitative null and alternative hypotheses (H0 and H1 ) about the population/long run. 2. Identify a test statistic (what quantity (random variable) are we going to use to summarize the data?) 3. Establish a rejection criterion. (a) Find the distribution that the test statistic would have if H0 (or the version of H0 closest to H1 ) is true. (b) Decide which data values would favor H1 over H0 . (c) Out of these, set a cutoff so that the (conditional) probability of a Type I Error rate is low enough (usually 5% or less).

4. Collect the data, compute the test statistic, and make the decision. Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” more often than it would if the die were fair.

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” more often than it would if the die were fair.

I

How could we test this?

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” more often than it would if the die were fair.

I

How could we test this?

I

We set up an experiment where we will roll the die 300 times.

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” more often than it would if the die were fair.

I

How could we test this?

I

We set up an experiment where we will roll the die 300 times.

I

What are our null and alternative hypotheses?

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Testing the Fairness of a Die I

Relevant aspect of the die is

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair →

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased toward 1 →

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased toward 1 → p1 > 1/6

I

Relevant quantity from the data (test statistic) is

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased toward 1 → p1 > 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a

Part II ISTA 116 Hypothesis Testing: Binary Data

distribution.

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased toward 1 → p1 > 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a B(300, 1/6) distribution.

I

A high number of 1s favor H1 . How high?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased toward 1 → p1 > 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a B(300, 1/6) distribution.

I

A high number of 1s favor H1 . How high?

I

We should reject H0 if we get a value which is above the 95th percentile of the B(300, 1/6) distribution.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Notice that we don’t actually need to find the exact cutoff in advance. If we get an observed test statistic, we can just compute its percentile in the H0 distribution.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Notice that we don’t actually need to find the exact cutoff in advance. If we get an observed test statistic, we can just compute its percentile in the H0 distribution.

I

If this percentile is

Part II ISTA 116 Hypothesis Testing: Binary Data

, then we can reject H0 .

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Notice that we don’t actually need to find the exact cutoff in advance. If we get an observed test statistic, we can just compute its percentile in the H0 distribution.

I

If this percentile is greater than 95, then we can reject H0 .

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Testing the Fairness of a Die I

Suppose we get 60 “1”s. How do we proceed?

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Suppose we get 60 “1”s. How do we proceed?

I

We need to determine the probability of 60 or a value more supportive of H1 in the B(300, 1/6) distribution.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Suppose we get 60 “1”s. How do we proceed?

I

We need to determine the probability of 60 or a value more supportive of H1 in the B(300, 1/6) distribution.

I

High values are more supportive in this case, so we want P(X ≥ 60).

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Suppose we get 60 “1”s. How do we proceed?

I

We need to determine the probability of 60 or a value more supportive of H1 in the B(300, 1/6) distribution.

I

High values are more supportive in this case, so we want P(X ≥ 60).

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Suppose we get 60 “1”s. How do we proceed?

I

We need to determine the probability of 60 or a value more supportive of H1 in the B(300, 1/6) distribution.

I

High values are more supportive in this case, so we want P(X ≥ 60).

1 - pbinom(59, 300, 1/6) [1] 0.07299

What’s our decision? We cannot reject H0 , because we get values this high more than 5% of the time under H0 . Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” less often than it would if the die were fair.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” less often than it would if the die were fair.

I

How could we test this?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” less often than it would if the die were fair.

I

How could we test this?

I

We set up an experiment where we will roll the die 300 times.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die

I

Suppose we suspect that a die is loaded to come up “1” less often than it would if the die were fair.

I

How could we test this?

I

We set up an experiment where we will roll the die 300 times.

I

What are our null and alternative hypotheses?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Testing the Fairness of a Die I

Relevant aspect of the die is

Part II ISTA 116 Hypothesis Testing: Binary Data

Summary

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair →

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased away from 1 →

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased away from 1 → p1 < 1/6

I

Relevant quantity from the data (test statistic) is

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased away from 1 → p1 < 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a

Part II ISTA 116 Hypothesis Testing: Binary Data

distribution.

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased away from 1 → p1 < 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a B(300, 1/6) distribution.

I

A low number of 1s favor H1 . How low?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

Testing the Fairness of a Die I

Relevant aspect of the die is the probability of a 1. Call this p1 .

I

H0 : Die is fair → p1 = 1/6

I

H1 : Die is biased away from 1 → p1 < 1/6

I

Relevant quantity from the data (test statistic) is the number of 1s rolled

I

If H0 is true, this test statistic has a B(300, 1/6) distribution.

I

A low number of 1s favor H1 . How low?

I

We should reject H0 if we get a value which is below the 5th percentile of the B(300, 1/6) distribution.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

R tip: the qbinom() function I

The pbinom(q, size, prob) function gives us the value of the CDF at the value q, in a binomial distribution with parameters n = size and p = prob.

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

R tip: the qbinom() function I

The pbinom(q, size, prob) function gives us the value of the CDF at the value q, in a binomial distribution with parameters n = size and p = prob.

I

What if we want the opposite? That is, we want to know what value is at the 5th percentile?

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

R tip: the qbinom() function I

The pbinom(q, size, prob) function gives us the value of the CDF at the value q, in a binomial distribution with parameters n = size and p = prob.

I

What if we want the opposite? That is, we want to know what value is at the 5th percentile?

I

We can use qbinom(p, size, prob).

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

R tip: the qbinom() function I

The pbinom(q, size, prob) function gives us the value of the CDF at the value q, in a binomial distribution with parameters n = size and p = prob.

I

What if we want the opposite? That is, we want to know what value is at the 5th percentile?

I

We can use qbinom(p, size, prob).

Part II ISTA 116 Hypothesis Testing: Binary Data

Two-Tailed Tests

Summary

R tip: the qbinom() function I

The pbinom(q, size, prob) function gives us the value of the CDF at the value q, in a binomial distribution with parameters n = size and p = prob.

I

What if we want the opposite? That is, we want to know what value is at the 5th percentile?

I

We can use qbinom(p, size, prob).

(x