Download Solved Lab 8: Questions - Statistics Applied to Natural Sciences | MATH 338 and more Lab Reports Mathematics in PDF only on Docsity! Math 338, Solutions for Lab 8 (1) We have worked on these types of simulations for awhile now. So here I’m just adding the underlying code: C=matrix(nrow=10000,ncol=2,byrow=T) for(i in 1:10000) { u=rbinom(100,1,0.6) u=sum(u)/100 C[i,1]=u-1.96*(sqrt(u*(1-u))/sqrt(100)) C[i,2]=u+1.96*(sqrt(u*(1-u))/sqrt(100)) } counter=0 for(i in 1:10000) { if( C[i,1]<=0.6 & C[i,2]>=0.6) counter=counter+1 } counter/10000 (2) This problem is easy and can be done either directly using the Binomial distribution or can be addressed via the central limit theorem’s result. I prefer the Binomial solution mainly because np is not significantly lage, in fact it is smaller than 10. On the other hand, it is not drastically small. – X ∼ Binom(35, .25). So for 7 or fewer, we have: > pbinom(7,35,.25) [1] 0.3222818 – Between 3 to 5: > pbinom(5,35,.25)-pbinom(3,35,.25) [1] 0.08400892 – At least 4: > 1-pbinom(3,35,.25) [1] 0.9863887 – At most 10 are married. Be careful about problem’s wording. For married, you have: y ∼ Binom(35, .75). Therefore: > pbinom(10,35,.75) [1] 1.050349e-08 (3) This is an easy problem! (a) What are the degrees of freedom for t? d = 29 (b) Locate the closest critical value tcritical from the t-table to tobs. What is the right-tail probability for this value? tcritical = 1.311, p = 0.10. (c) Relying on your answer to the previous section, how would you report the P−value for this test? p-value> 0.10. (d) Is the value t = 1.12 statistically significant at the 10% level? Yes. At the 5% level? No (e) Find the exact P−value using R. > 1-pt(1.12,29) [1] 0.1359521 (4) (Moore and McCabe, 1998) A study examined the effect of exercise on how students perform on their final exam in statistics. The P−value was given as 0.87. (a) Exercise has no effect on statistics score. Let µ be the underlying mean of statistics grade-improvement. Then, we are actually testing: H0 : µ = 0 Ha : µ > 0 (b) Do not reject. Very large p-value. (c) Exercise has no significant affect on statistics score. (d) Sample size, the underlying normality of the population from which data are extracted. The latter emphasizes the potentially significant effect that outliers would make on our statistical inference. (5) H0 : µ = 475 Ha : µ > 475 Note that tobs increases simply as the sample size gets larger. This means that by observing more data, we tend to automatically reject the null hypothesis (declare significance): > t.obs=(478-475)/(100/sqrt(100)) > t.obs [1] 0.3 > t.obs=(478-475)/(100/sqrt(1000)) > t.obs [1] 0.9486833 > t.obs=(478-475)/(100/sqrt(10000)) > t.obs [1] 3 2