##DESCRIPTION ##KEYWORDS('statistics','Inference about a population') ## ## CMMK tagged this problem ## DBchapter('Inference About a Population') ## DBsection() ## Date('07/12/2005') ## Author('Cristina Murray-Krezan') ## Institution('UVa') ## TitleText1('Statistics for Management and Economics') ## EditionText1('6') ## AuthorText1('Keller, Warrack') ## Section1() ## Problem1() ##ENDDESCRIPTION DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGgraphmacros.pl", "PGnumericalmacros.pl", "PGstatisticsmacros.pl", "extraAnswerEvaluators.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 0; install_problem_grader(~~&std_problem_grader); $pval = 0; while ($pval < 0.005) { $mu1 = random(63,68,1); $mu2 = random(73,78,1); $p1[1] = $mu1 + random(-5,5,1); $p1[2] = $mu1 + random(-5,5,1); $p1[3] = $mu1 + random(-5,5,1); $p1[4] = $mu1 + random(-5,5,1); $p1[5] = $mu1 + random(-5,5,1); $p1[6] = $mu1 + random(-5,5,1); $p1[7] = $mu1 + random(-5,5,1); $n1 = 7; $p2[1] = $mu2 + random(-5,5,1); $p2[2] = $mu2 + random(-5,5,1); $p2[3] = $mu2 + random(-5,5,1); $p2[4] = $mu2 + random(-5,5,1); $p2[5] = $mu2 + random(-5,5,1); $p2[6] = $mu2 + random(-5,5,1); $p2[7] = $mu2 + random(-5,5,1); $p2[8] = $mu2 + random(-5,5,1); $n2 = 8; $xbar1 = ($p1[1]+$p1[2]+$p1[3]+$p1[4]+$p1[5]+$p1[6]+$p1[7])/$n1; $xbar2 = ($p2[1]+$p2[2]+$p2[3]+$p2[4]+$p2[5]+$p2[6]+$p2[7]+$p2[8])/$n2; $s1 = sqrt( (($p1[1]-$xbar1)**2 + ($p1[2]-$xbar1)**2 + ($p1[3]-$xbar1)**2 + ($p1[4]-$xbar1)**2 + ($p1[5]-$xbar1)**2 + ($p1[6]-$xbar1)**2 + ($p1[7]-$xbar1)**2)/($n1-1)); $s2 = sqrt( (($p2[1]-$xbar2)**2 + ($p2[2]-$xbar2)**2 + ($p2[3]-$xbar2)**2 + ($p2[4]-$xbar2)**2 + ($p2[5]-$xbar2)**2 + ($p2[6]-$xbar2)**2 + ($p2[7]-$xbar2)**2 + ($p2[8]-$xbar2)**2)/($n2-1)); $df = $n1 + $n2 - 2; $sp2 = (($n1-1)*$s1**2 + ($n2-1)*$s2**2)/$df; $alpha = random(0.02, 0.08, 0.005); $tstat = ($xbar1 - $xbar2)/sqrt($sp2*(1/$n1 + 1/$n2)); $tcrit = tdistr($df,$alpha); $pval = tprob($df,-$tstat); } $mc = new_multiple_choice(); @ans = ("Reject \(H_0\).", "Do Not Reject \(H_0\).", "Reject \(H_1\).", "Do Not Reject \(H_1\)."); if ($pval < $alpha) {$tag = 0;} else {$tag = 1;} $mc -> qa('D. Your decision for the hypothesis test:', $ans[$tag]); $mc -> extra($ans[1-$tag],$ans[2],$ans[3]); BEGIN_TEXT $PAR Random samples of resting heart rates are taken from two groups. Population 1 exercises regularly, and Population 2 does not. The data from these two samples is given below: $PAR Population 1: $p1[1], $p1[2], $p1[3], $p1[4], $p1[5], $p1[6], $p1[7] $PAR Population 2: $p2[1], $p2[2], $p2[3], $p2[4], $p2[5], $p2[6], $p2[7], $p2[8] $PAR Is there evidence, at an \(\alpha = $alpha\) level of significance, to conclude that there those who exercise regularly have lower resting heart rates? (Assume that the population variances are equal.) Carry out an appropriate hypothesis test, filling in the information requested. $PAR A. The value of the standardized test statistic: \{ ans_rule(25) \} $PAR $BBOLD Note:$EBOLD For the next part, your answer should use interval notation. An answer of the form \((-\infty, a)\) is expressed (-infty, a), an answer of the form \((b, \infty)\) is expressed (b, infty), and an answer of the form \((-\infty, a) \cup (b, \infty)\) is expressed (-infty, a)U(b, infty). $PAR B. The rejection region for the standardized test statistic: \{ ans_rule(25) \} $PAR $PAR C. The p-value is \{ ans_rule(25) \} $PAR \{ $mc ->print_q() \} $BR \{ $mc ->print_a() \} END_TEXT ANS(num_cmp($tstat)); ANS(interval_cmp("(-infty,-$tcrit)", sloppy=>'yes')); ANS(num_cmp($pval,tol=>0.005)); ANS(radio_cmp($mc->correct_ans)); ENDDOCUMENT(); # This should be the last executable line in the problem.