CSL 7A: Binomial Distribution Activity
In today's CSL you will be exploring and learning about the binomial distribution. You will learn how
- to generate a sequence of Bernoulli Trials (observations of phenomena/experiments which have exactly two outcomes: success (coded as '1') and failure (coded as '0')
- compute binomial probabilities (individual and cumulative)
- use the binomial distribution to determine the rejection region for testing a null hypothesis about a proportion
- compute p-values
- and determine the power of a test about a proportion.
To illustrate the above, we will look at responses to the following question:
'According to your religious beliefs, do you believe that sex before marriage is wrong?'
0: No 1:Yes
Please write your answer on the blank half sheet of paper, fold it in half, and give to the ug intern who will take the results to be tabulated. We will obtain the responses of the 55/60 students here.
While the results are being tabulated, let us look at the following null hypothesis. 50% of ug students taking Stat 200 believe sex before marriage is wrong (that is, they would say 'Yes' to the question above). Previous studies indicate that the percentage is likely to be less than 50%. Thus, we wish to test the following:
H0 : p = .50 vs H1 : p < .50.
What would a set of responses look like if the null hypothesis is true, that is, if the proportion is .50?
a. Generate a random sequence of 0's and 1's with the chance of a 1 being p = .5:
Click Calc, Random Data, Bernoulli. Type in 60 for the number of rows, store in C!, and type in .50 as the probability of success. Here is what I got:
C1
1 0 0 1 0 1 0 1 1 0 1 0
0 1 1 1 0 1 1 0 1 1 0 0
0 1 1 1 0 1 0 0 0 0 0 0
1 0 0 0 0 1 1 0 1 1 1 0
1 1 1 0 1 1 1 1 0 1 1 0
- How many 'successes' (1's) are there? Use Stat, Tables, Tally, C1 to get the number--I got 32 1's and 28 0's.
- What is the probability distribution of X = Number who respond 'Yes'? We obtain it as follows:
- First, put the numbers 0, 1, 2, …, 60 in C2, as follows: click Calc, Make Patterned Data, Simple Set of Numbers. Store patterned data in C2, from first value 0, last value 60, and click OK. Then type in 'x' as the name of C2.
- Next, click Calc, Probability Distributions, Binomial. The small circle with a period in it across from Probability should appear, type in 60 as the number of trials .5 as the probability of success. Select Input Column to be C2 and Optional Storage C3.
- The individual probabilities of X are in column C3. To get the cumulative probabilities do the same as above but click on the circle across from Cumulative Probability and store in C4.
- For what values of X should be H0 be rejected? Obviously, we should reject it if we observe small values of x--how small? Select a value x0 of X such that P(X£ x0) is around (but smaller than) .05--I think x0 = 24 works well! Actually, P(X£ 24) = ..04623. This makes the rejection region ' reject if X £ 24' with a = Prob(type I error) = .04623. what would be the decision for the data you generated? For mine, I would not reject since I observed x = 32, which is not in the rejection region.
Your decision: reject ____ don't reject ____
- Now find the p-value of the test: find the probability of getting the value you got or something smaller. Answer: _____. (I observed x=32 and P(X£ 32) =.65056)
- Let's now look at what the class number was: _____. What is the decision? ____
- What is the p-value of the test based on results of the class? __________.
- For what values of X will the p-value be less than a = Prob(type I error) = .04623?
Answer: _____________________
Now I want to discuss the concept 'Power of the Test'. 'Power' is the probability (chance) of rejecting the null hypothesis when the null hypothesis is actually not true. When is the null hypothesis not true? Answer: whenever the actual value of p is less than p0 = .50. for example, suppose the true proportion is p = .40--then the null hypothesis is not true. Let's now find the power of our test for various values of p.
- Suppose p = .40. What is the probability we'd reject H0 ? Answer: P(X£ 24) !!! Recall we decided we'd reject H0 if X£ 24. To find this probability, we do the following: click Calc, Probability Distributions, Binomial Distribution, click on Cumulative Distribution, change Probability of Success to .4, click on Input Constant, and type in 24.
- Find the power of the test for p = .3, p=.25, and p= .2. How does the power change? Answer: Power for: p=.3 _____ ; p=.25 ____ ; for p=.2 _____.