Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT512

Assignment 2

Question 1 This question will cover the assessment of the model assumptions for a completely randomized design with a one-way treatment structure. The primary learning goal for this laboratory will be the ability to correctly assess and correct for violations of the model assumptions.

Kuehl (2000, Design of Experiments: Statistical Principles fo Research Design and Analysis, 2nd ed. Brooks/Cole, Pacific Grove, CA) presents an experiment on temperature-accelerated life testing performed on a  type of sheathed tubular heater.  Six heaters were tested at each of four temperatures: 1520oF, 1620oF, 1660oF and 1708oF.  The number of hours to failure was recorded for each of the 24 heaters in the study.

Test Temperature                              Hours to Failure

1520oF

1620oF

1660oF

1708oF

1953,  2135,  2471,  4727,  6134,  6314

1190,  1286,  1550,  2125,  2557,  2845   651,    837,    848,  1038,  1361,  1543   511,    651,    651,    652,    688,    729

The SAS code for the above data is shown below.

options pageno = 1 ls = 105;

data lifetest;

input Hours Temperature Replicate @@;

cards;

1953 1520 1 2135 1520 2 2471 1520 3 4727 1520 4 6134 1520 5 6314 1520 6

1190 1620 1 1286 1620 2 1550 1620 3 2125 1620 4 2557 1620 5 2845 1620 6

 651 1660 1  837 1660 2  848 1660 3 1038 1660 4 1361 1660 5 1543 1660 6

 511 1708 1  651 1708 2  651 1708 3  652 1708 4  688 1708 5  729 1708 6

;

proc print data = lifetest; run;

Using the provided code, you will need to write the necessary SAS code to perform the following tasks:

1) Assess the assumption of normality using SAS Proc GLM and SAS Proc Univariate.   Within the Proc GLM code you are also to incorporate the statement for computing Levene’s test.  Because this is a oneway treatment structure in a CRD, you can get Proc GLM to implement Levene’s (Brown-Forsythe) test by using the following statement:  means Temperature / hovtest=bf;.  You are also to plot the residuals vs the predicted values.

On the following page (2), report the results for the raw data {Hours}.

2) Modify the code to assess the assumptions of normality and constant variance for the following transformations: square-root {sqrt(Hours)}, logarithm {log(Hours)}, inverse-square-root {1/sqrt(Hours)} and inverse {1/Hours}.  Report the results on pages 2 and 3.

1. Assessing Validity of the Assumptions

For the analysis of the raw data perform the following:

1a)

Fill in the elements for the test for assessing the assumption of normality (Use Shapiro Wilk’s Test)

a) Ho: The errors are normally distributed

b) Ha: The errors are not normally distributed

c) P-value =

d) Reject Ho if P-value < .05

e) Conclusion: 

1b)

Fill in the elements for the test for assessing the assumption of constant variance using Levene’s test (Brown-Forsythe test)

a) Ho: The variances are equal across all treatments

b) Ha: The variances are not equal across all treatments

c) P-value =

d) Reject Ho if P-value < .05

e) Conclusion:

2. Correcting Violation of the Model Assumptions Using a Transformation

You now need to determine which transformation, if any, will produce an analysis where the assumptions are satisfied.  Modify the SAS code already used by adding the following statements between the Input and Cards statement:

input Hours Replicate Temperature @@;

Sqrt_Hours = sqrt(Hours);

Log_Hours = log(Hours);

InvSqrt_Hours = 1/sqrt(Hours); Inverse_Hours = 1/(Hours); cards;

Change the response in the model statement to the Proc GLM code starting with “Sqrt_Hours” and run the analyses for each transformation of the response variable.  For each run, report the results of the Shapiro-Wilk’s test for normality and Levene’s test for constant variance.  Report the P-values for each of these tests in the following:

2a)         Ho: The errors are normally distributed

  Ha: The errors are not normally distributed

P-value =  (Shapiro Wilks - Raw Data)

=  (Shapiro Wilks - Square-Root Transformation)

=  (Shapiro Wilks - Logarithm Transformation)

=  (Shapiro Wilks - Inverse Square-Root Transformation)

=  (Shapiro Wilks - Inverse Transformation)

Reject Ho if P-value < 0.05

Conclusions:

2b)       Ho: The variances are equal across all treatments

Ha: The variances are not equal across all treatments

P-value = (Raw Data)

(Square-Root Transformation)

(Logarithm Transformation)

(Inverse Square-Root Transformation)

(Inverse Transformation)

Reject Ho if P-value < 0.05

Conclusions:

2c) Summarize the results for parts 2a and 2b.

Question 2 In a nutrition experiment, an investigator studied the effects of different rations on the growth of young rats. Forty rats from the same inbred strain were divided at random into four groups of ten and used for the experiment. A different ration was fed to each group and, after a specified length of time, the increase in growth of each rat was measured (in grams).

RATION A

RATION B

RATION C

RATION D

10     6

13      9

12     10

15     21

8      6

15     10

16     12

13     18

12     9

14      8

13     10

15     20

11     5

13     10

11       9

10     19

9      6

17      8

15       9

12     22

Perform the following hypothesis tests by hand using either a t-test or an F test. Refer to Section 9.2 in your textbook and the lecture 7 notes on Blackboard. Compare your results with the results obtained using SAS and R.

a. H0: (mA+mB)/2 - (mC+mD)/2 = 0

Ha: (mA+mB)/2 - (mC+mD)/2  0

b. H0: (mA+mB+mC)/3 - mD = 0

Ha: (mA+mB+mC)/3 - mD  0

Question 3 Because many HMO’s either do not cover mental health costs or provide only minimal coverage, ministers and priests often need to provide counseling to persons suffering from mental illness. An interdenominational organization wanted to determine whether the clerics from different religions have different levels of awareness with respect to the causes of mental illness. Three random samples were drawn, one containing 10 Methodist ministers, a second containing 10 Catholic priests, and a third containing 10 Pentecostal ministers. Each of the 30 clerics was then examined, using a standard written test, to measure his or her knowledge about causes of mental illness. The tests scores are listed in the table below.

Cleric

Methodist

Catholic

Pentecostal

1

62

62

37

2

60

62

31

3

60

24

15

4

25

24

15

5

24

22

14

6

23

20

14

7

20

19

14

8

13

10

5

9

12

8

3

10

6

8

2

a. Assess the reasonableness of the normality and equal variance assumptions which are required for the analysis of variance F test.

b. Perform the Kruskal-Wallis test, a non-parametric alternative to the analysis of variance F test. This test does not require a normality assumption but it does require an assumption of equal variances. Perform multiple comparisons if necessary using either Dunn’s procedure or Dwass, Steel, Critchlow-Fligner (DSCF) procedure.

H0: There is no difference among the three groups with respect to knowledge about the causes of mental illness (i.e., the samples of scores were drawn from identical populations).

Ha: At least one of the three groups of clerics differs from the others with respect to knowledge about causes of mental illness.

In SAS:

proc npar1way data=priests wilcoxon dscf;

class group;

var score;

run;

In R:

kruskal.test(SCORE~RELGROUP, data = npar)

install.packages("FSA")

library(FSA)

PT = dunnTest(SCORE ~ RELGROUP,

              data=npar,

              method="hochberg")

PT