AMS572.01 Final Exam Fall, 2013

Name______ID ______Signature______

Instruction: This is a close book exam. Anyone who cheats in the exam shall receive a grade of F. Please provide complete solutions for full credit. The exam goes from 11:15am - 1:45pm. (*Extended time at the DSS as required.*) Calculator is allowed. Please use the given statistical tables. Good luck!

  1. Reed Auto periodically has a special week-long sale. As part of the advertising campaign Reed runs one or more television commercials during the weekend preceding the sale. Data from a sample of 5 previous sales are shown below.

Number of TV Ads / 1 / 3 / 2 / 1 / 3
Number of Cars Sold / 14 / 24 / 18 / 17 / 27

(a)Find the least squares regression line.

(b)Test at whether there is a significant linear relationship between these two variables.

(c)What percentage of variation in numbers of cars sold is explained by the number of TV ads?

(d)Please write up the entire SAS code necessary to answer questions (a), (b), (c) above. In addition, please write up a SAS program to compute the sample correlation coefficient between the two variables and to test whether the corresponding population correlation is zero or not.

Solution: This is a simple linear regression problem.

(a)

The fitted least square regression line is:

(*Dear students, many of you forgot to add the hat to Y – then I realized that we had such a typo in the homework solutions. So you are forgiven and no point was taken. But please do remember the hat for the future.)

(b)The mean square error estimate of is:

The hypotheses are: versus

Test statistic:

Therefore we reject the null hypothesis at and conclude that there is a significant linear relationship between these two variables.

(c)

Therefore we claim that 87.7% of variation in number of cars sold is explained by the number of TV ads. .

(d)

Datacarsell;

inputxy;

datalines;

114

324

218

117

327;

run;

procregdata= carsell;

modely = x;

run;

proccorrdata= carsell;

varx y;

run;

  1. A firm wishes to compare four programs for training workers to perform a certain manual task. Twenty new employees are randomly assigned to the training programs, with 5 in each program. At the end of the training period, a test is conducted to see how quickly trainees can perform the task. The number of times the task is performed per minute is recorded for each trainee, with the following results:

Observation / Program 1 / Program 2 / Program 3 / Program 4
1 / 9 / 10 / 12 / 9
2 / 12 / 6 / 14 / 8
3 / 14 / 9 / 11 / 11
4 / 11 / 9 / 13 / 7
5 / 13 / 10 / 11 / 8

(a)Using the hypothetical data provided below, test atwhether the four training programs are equally effective. What assumptions are necessary for your test?

(b)Please write up the entire SAS code necessary to answer question (a) above.

(c)Please compare training programs 3 and 4 using the usual pooled-variance t-test at the significance level

(d)At please compare training programs 3 and 4 using an optimal test – that is, the best test you can find based on the given data– this test should be better than the pooled variance t-test in part (c).

(e)Please derive your optimal test in part (d) using the pivotal quantity method under the same assumptions mentioned in part (a), and for the following general setting, at the significance level.

Observation / Program 1 / Program 2 / / Program k
1 / X11 / X21 / / Xk1
2 / X12 / X22 / / Xk2
n / X1n / X2n / / Xkn

(f)(extra credit) Please derive your optimal test in part (d) using the likelihood ratio test method using the same assumptions and general setting given in (e). Prove whether the tests in (e) and (f) are equivalent.

Solution: This is a one-way ANOVA problem with 4 independent samples.

(a)We need to perform an ANOVA F-test. The first assumption is that all four populations are normal. The second is that all four population variances are unknown but equal.

Analysis of Variance
Source / SS / d.f. / MS / F
Training Program / 54.95 / 3 / 18.32 / 7.04
Error / 41.6 / 16 / 2.6
Total / 96.55 / 19

Since , we reject the null hypothesis, and claim that the four training programs are not equally effective.

.(b)

datatraining;

inputprogramspeed;

datalines;

;

1 9

112

114

111

113

210

26

29

29

210

312

314

311

313

311

49

48

411

47

48

;

run;

procanovadata = training;

classprogram;

modelspeed = program;

run;

(c) By the ANOVA assumption, we assume that both populations are normal, and the population variances are unknown but equal().

Now we perform the pooled variance t-test to test whether the two population means are equal.

versus

Test Statistic :

(p-value = 0.00384, 2-sided)

We reject the null hypothesisat , and conclude that there is evidence of a difference in mean speed between these two training programs.

(b)Derivation of the pooled-variance t-test (2-sided test) using the pivotal quantity approach

Suppose we have k independent random samples each of size n from k normal populations with unknown but equal population variances: Here is a simple outline of the derivation of the test: versus , where using the pivotal quantity approach.

[1]. We start with the point estimator for the parameter of interest:. Its distribution is using the mgf for which is , and the independence properties of the random samples. From this we have . Unfortunately, Z can not serve as the pivotal quantity because σ is unknown.

[2]. We next look for a way to get rid of the unknown σ following a similar approach in the construction of the pooled-variance t-statistic. We found that using the mgf for which is , and the independence properties of the random samples.

[3]. Then we found, from the theorem of sampling from the normal population, and the independence properties of the random samples, that Z and W are independent, and therefore, by the definition of the t-distribution, we have obtained our pivotal quantity: , where is the pooled sample variance from all k samples.

[4]. The rejection region is derived from , where . Thus . Therefore at the significance level of α, we reject in favor of iff

For the given problem, we have: versus

Test statistic:

(p-value = 0.00278, 2-sided -- we can see that this p-value is indeed smaller than the pooled-variance t-test in part (c) because this t-test is more optimal, with the largest degree of freedom possible.)

We reject the null hypothesisat , and conclude that there is evidence of a difference in mean speed between these two training programs.

(c)Derivation of the pooled-variance t-test (2-sided test) using the likelihood ratio test approach

Given that we have two independent random samples from two normal populations with equal but unknown variances. Now we derive the likelihood ratio test for:

--- Without loss of generality, for the sake of simplicity, we will set for the derivation of the likelihood ratio test.

Let, then,

={},

,

and there are k parameters .

, for it contains k parameters, we do the partial derivatives with respectively and let the partial derivatives equal to 0. Then we have:

,

and there are parameters.

We do the partial derivatives with and respectively and let them all equal to 0. Then we have:

At this time, we have done all the estimation of parameters. Then, after some cancellations/simplifications, we have:

where is the test statistic in the pooled variance t-test. Therefore, is equivalent to ||. Thus at the significance level, we reject the null hypothesis in favor of the alternative when c =. This test is identical to the test we have derived in part (b).

3. In order to test the accuracy of speedometers purchased from a subcontractor, the purchasing department of an automaker orders a test of a sample of speedometers at a controlled speed of 55 mph. At this speed, it is estimated that the variance of the readings is 1.

(a) How many speedometers need to be tested to have a 95% power to detect a bias of 0.5 mph or greater using a 0.01 level test?

(b) A sample of the size determined in (a) has a mean of 55.2 and standard deviation of 0.8. Can you conclude that the speedometers have a bias?

(c) Calculate the power of the test if 50 speedometers are tested and the actual bias is 0.5 mph. Assume a population standard deviation of 0.8.

Solution:

(a)

.

(*Note, if , )

Hence, 64 packages of cereal speedometers need to be tested. (*Note, only 41 packages are needed if )

(b)

. .

. (*Note, -- This is the large sample z-test by the central limit theorem that is suitable even if the population distribution is not normal.)

Since , we can notconclude that the speedometers have a bias.

(**Note: Here you can also use the t-test – but remember to mention that the t-test is suitable if we assume the population distribution is normal!)

(c)

  1. You are an epidemiologist for the US Department of Health and Human Services. You are studying the prevalence of a certain disease in two states (MA and CA). In MA, 74 of 1500 people surveyed were diseased and in CA, 129 of 1500 were diseased.

(a)At the significance level of.05, can you conclude that the prevalence rates are different?

(b)Can you test the hypotheses mentioned in (a) using another test?

(c)Are the two tests in parts (a) and (b) equivalent or not? Please justify your claim in a general setting – that is, suppose we have diseased subjects among a total of people surveyed in MA, and diseased subjects among a total of people surveyed in CA. Furthermore, the significance level is.

Solution:

(a)

Diseased / Not-Diseased / Total
MA / a (74) / b (1500-74) / 1500
CA / c (129) / d (1500-129) / 1500

We not reject at and conclude that based on the given data, the prevalence of this disease is different between CA and MA.

(b)& (c) Now we denote the probabilities of the four table cells as follows:

Diseased / Not-Diseased
MA / /
CA / /

The original hypotheses of equal population proportions (versus not equal):

are equivalent to the hypotheses for the homogeneity test for a two-way contingency table:

the above is not true

The (large sample) test statistic is:

Where and

At the significance level α, we reject the null hypothesisiff which is equivalent to rejecting the null hypothesis iff . This is because: , and therefore: . Thus we claim that these two tests are entirely equivalent. So we have done part (c).

Now back to part (b), we can simply plug in the values (or you can do part (c) first and then use its general result to perform part (b), either way is Ok with me) and obtain the chi-square statistic as follows:

Since, we reject the null hypothesis and claim that the prevalence rates are different between MA and CA.

  1. We have two independent samplesand, where (the variance is unknown), and . For the hypothesis of

(a)Please derive the general formula for power calculation for the pooled variance t-test based on an effect size of EFF at the significance level of α.

Recall - Definition: Effect size = EFF = (e.g. Eff=1)

(b)With a sample size of 26 per group, α = 0.05, and an estimated effect size ranging from 1 to 1.5, please calculate the power of your pooled variance t-test.

Solution:

(a)T.S : =

At α=0.05, reject in favor of iff

Power=1-β=P(reject |)=

=

=

≈ (Effect size=)

(b)With n = 26, α = 0.05, Eff = 1 to 1.5, the power is calculated as follows:

Power (Eff = 1) =

=

By our t-table, we estimate that the above power is between 95% and 97.5%.

(In fact if you check with R, the above power is about 97%)

Power (Eff = 1.5) =

=

By our t-table, we estimate that the above power is greater than 99.95%.

(In fact if you check with R, the above power is about 99.98%)

Note: the T statistic above follows a t-distribution with 50 (=26+26-2) degrees of freedom.

Therefore we conclude that the power will range from 95% to 99.95% for a given effect size ranging from 1 to 1.5.

1