(A) Using the Z-Test to Check If P = 0.5

Total Page:16

File Type:pdf, Size:1020Kb

(A) Using the Z-Test to Check If P = 0.5

Statistics Yue March 8, 2010 Assignment #1, Due 2010/03/22

1. In class we mentioned that the chi-square test is one of the frequently used methods and many tests are related (or equivalent) to this test. Suppose we tossed a coin 500 times and observed “Head” 220 times. We want to know if this is a fair coin with a significance level  = 0.01. (a) Using the Z-test to check if p = 0.5. H0 : p = 0.5 , H1 :p 0.5 Z test: 220- 250 z = = -2.683282 500*0.5*0.5 � p-value = (0.0037*2) 0.05 Do not reject H0 (b) Repeat (a) but use the chi-square instead. (oi- ei )2 Test statistic : c 2 = ei (220- 250)2 (280 - 250) 2 x2 = + = 7.2 250 250

Under H0, c2 ~ c 2 (1) 2 Since c0.05 (1) = 3.845<7.2 , Reject H0

2. A professor believes that the final examination scores in statistics are normally distributed. A sample of 40 final scores has been taken, shown as below.

55 85 72 99 48 71 88 70 59 98 80 74 93 85 82 90 71 83 60 95 77 84 73 63 72 95 79 51 76 81 78 65 75 87 86 70 80 64 74 85

(a) State the null and alternative hypotheses. H0: The final scores are normal distributed. Ha: The final scores are not normal distributed. (b) Compute the test statistic for the goodness of fit test. Group = 40/5 = 8 , each probability of interval = 0.125 Breakpoints : ( 62.54, 68.50, 72.98, 76.83, 80.68, 85.16, 91.12) Chi-square GOF : x2 = 2 (c) The hypothesis is to be tested at the 5% level. What is the critical value from the table for the test?

Under H0 : c2 ~ c 2 (8- 2 - 1), 2 Therefore, c0.05 (5)= 11.07, Reject region: (11.07, )

(d) What do you conclude about the distribution of final examination scores?

Do not reject H0, The final scores are normal distributed. 3. We can use the following steps to test if random numbers follow a uniform distribution, using the chi-square goodness-of-fit test. Step 1. Using Minitab to generate 200 random numbers from U(0,1). Step 2. Separate these into 5 equal spaced intervals: (0, 0.2), (0.2, 0.4), (0.4, 0.6), (0.6, 0.8), and (0.8, 1). Count the numbers of observations in each interval. Step 3. The expected numbers of observations in each interval should be 40. Then, 5 2 2 (Oi  40) 2 apply the chi-square test    and see if is greater than 0.05 (4). i1 40 Continue these steps 5 times and see how many times you reject these numbers are from U(0,1). (Note: You can separate (0,1) into other numbers of equal spaced intervals and the testing procedure shall be similar.) The answer demonstrates one simulation only. The rests are same as the answer.

H0 : X~U(0,1) , H1 : Not H0 (36- 40)2 (41 - 40) 2 (32 - 40) 2 (47 - 40) 2 (44 - 40) 2 x2 = + + + + 40 40 40 40 40 = 3.65 Under H0, c2 ~ c 2 (4) 2 So, 3.65

4. The table below gives beverage preferences for random samples of teens and adults. Teens Adults Total Coffee 50 200 250 Tea 100 150 250 Soft Drink 200 200 400 Other 50 50 100 400 600 1,000

We are asked to test for independence between age (i.e., adult and teen) and drink preferences. First of all, apparently, different customer behavior exists on Coffee and Tea. H0: Independence between age and drink preferences , Ha: Not H0 Chi-square test is the appropriate test to test H0. Note that d.f. = (3 x 1) = 3 The output is produced by Minitab..

Using alpha=0.05, we reject H0. There are dependence between age and drink preferences. 5. The data below represents the fields of specialization for a randomly selected sample of undergraduate students. Test to determine whether there is a significant difference in the fields of specialization between regions of the country. Use a .05 level of significance. Northeast Midwest South West Total Business 54 65 28 93 240 Engineering 15 24 8 33 80 Liberal Arts 65 84 33 98 280 Fine Arts 13 15 7 25 60 Health Sciences 3 12 4 21 40 150 200 80 270 700

(a) State the critical value of the chi-square random variable for this test of independence of categories. H0 : Independence between fields and regions. Ha: Not H0 Under H0, c2 ~ c 2 (12) , Reject H0 if c 2> c 2 (12) = 21.045 0.05 Hence , rejection region = (21.045, ) (b) Calculate the value of the test statistic. Using Minitab, the test statistic is 8.674, and p-value is 0.731 (Note that: 1 cells with expected counts less than 5, which is 4.57, However, it wouldn’t violate the test too much.) (c) What is the conclusion for this test? Do not reject H0.

6. Use the data file “NCCUCommerce(2002).MTB” on my web page. Do the following chi-square tests and comment on your results. (a) Check if the sample collected (320 respondents) has a similar structure as the population ( 即 樣 本 代 表 性 ). Use  = 0.05 to test if the sex ratio and department proportions in the sample are the same as in the population, assuming that sex ratio is 2:3 for Male/Female and 1:2 for single/double classes department in the population. Gender : H0: Ratio of sex is 2:3 Ha: Not H0 (106- 128)2 (214 - 194) 2 x2 = + = 5.843 128 194 Under H0, c2 ~ c 2 (1) 2 Since c0.05 (1) = 3.845<5.843 , Reject H0

Single/double : H0: Ratio of sinlge/double is 1:2 Ha: Not H0 (186- 213.333)2 (134 - 106.667) 2 x2 = + = 10.5063 213.333 106.667 Under H0, c2 ~ c 2 (1) 2 Since c0.05 (1) = 3.845<10.5063 , Reject H0 (b) Check if the frequency of classrooms of courses taken in the Commerce building (#7) and the satisfactory level (#8) are independent, given  = 0.05. (Note: You may need to combine the cells.) There are several ways to combine the cells. Note that the following solution is only one of them. Row : class. Columns : satisfaction 1 2

1 54 38 92

(62.10) (29.90)

2 49 30 79

(53.33) (25.68)

3 51 20 71

(47.93) (23.07)

4 62 16 78

(52.65) (25.35)

216 104 320

** The numbers with bracket are expected counts.

H0: Independent between two variable Ha: Not H0 x2 =10.046 Under H0, c2 ~ c 2 (3) 2 Since c0.05 (3) = 7.85<10.046 , Reject H0

Recommended publications