Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Lu tells you he flipped a coin n times and recorded the number of heads he obser

ID: 3208869 • Letter: L

Question

Lu tells you he flipped a coin n times and recorded the number of heads he observed. He then repeated this experiment 1000 times and gives you the following observed table: Number of Heads 0 1 2 3 4 5 Frequency 34 141 277 261 179 108 We wish to test if Lu is telling the truth about how this data was collected (did the data really come from flipping a coin?) (a) Find the MLEs of n and p under Ho. Be sure to write out the hypotheses that you are testing. Using R to get numerical approximations is okay (b) Calculate the expected counts (c) Calculate the appropriate test statistic and state its distribution under Ho. (d) Calculate the p-value of this test and make you conclusions. Suppose that Y i id random variables with probability mass function given by 0,, if y j, j 1, 2, 3 0, otherwise where 0, are unknown parameters such that 01 02 03 1 and 0 0. We wish to test the null hypothesis Ho 01 02 03 against the alternative hypothesis H1 Ho is not true (a) Derive the unrestricted MLEs of 01, 02, and 63. (b) Derive the likelihood ratio test statistic and rejection region as a function (use the large sample approximation and be careful of the degrees of freedom). (c) Use R to simulate 100 observations from the null distribution and perform the test above at level a 0.05. Specify what seed you are using to generate your data. (d) Repeat part (c) 1000 times and calculate the proportion of times you reject Ho. Are you surprised by your answer? Explain

Explanation / Answer

141

a)

let x denote number of heads

for x=0, mle of n & p is (0,0.34)

for x=1,mle of n& p is (7,0.141)

for x=2,mle of n &p is(7,0.277)

for x=3,mle of n &p is(11,0.261)

for x=4,mle of n &p is(22,0.176)

for x>=5,mle of n and p is the highest value of n and 0.108

H0: all values of p are same

H1:atleast one p is significantly different

Expected number of count of heads=n*p= 7*0.141+0*0.34+7*.277+11*0.261+22*0.176=9.669(approx)

No. of heads(x) 0 1 2 3 4 >=5 Frequency 34

141

277 261 179 108 probability,p .34 .141 .277 .261 .179 .108