Assignment #6:   Due  Date :  10/24/2016.

(Use R as much as possible to do all calculations to answer questions but do not submit R-codes. Arrange your answer sheets in the order of the questions listed here, staple upper left hand corner.)

 

Covers Topics from Chapters 8 and 9: 

     9.13, 9.14, 9.15, 91.6, 9.17, 9.18

DO NOT SGOW R CODE OR RESULT….WRITE CONCLUSION USING RESULTS

---

title: "STA 5206    Assignment#6    3623774     Danilo Martinez"

output: word_document

---

 

```{r setup, include=FALSE}

knitr::opts_chunk$set(echo = FALSE,message = FALSE,warning = FALSE,results ="hide")

```

 

9.13 Researchers conducted an experiment to compare the effectiveness of four new weight-reducing agents to that of an existing agent. The researchers randomly divided a random sample of 50 males into five equal groups with preparation A1 assigned to the first group, A2 to the second group, and so on. They then gave a prestudy physical to each person in the experiment and told him how many pounds overweight he was. A comparison of the mean numbers of pounds overweight for the groups showed no significant differences. The researchers then began the study program, and each group took the prescribed preparation for a fixed period of time. The

weight losses recorded at the end of the study period are given here:

A1 12.4 10.7 11.9 11.0 12.4 12.3 13.0 12.5 11.2 13.1

A2 9.1 11.5 11.3 9.7 13.2 10.7 10.6 11.3 11.1 11.7

A3 8.5 11.6 10.2 10.9 9.0 9.6 9.9 11.3 10.5 11.2

A4 12.7 13.2 11.8 11.9 12.2 11.2 13.7 11.8 12.2 11.7

S 8.7 9.3 8.2 8.3 9.0 9.4 9.2 12.2 8.5 9.9

The standard (existing) agent is labeled agent S, and the four new agents are labeled A1, A2, A3, and A4. Run an analysis of variance to determine whether there are any significant differences among the five weight-reducing agents. Use alpha = .05. Do any of the AOV assumptions appear to be violated?

We first need to check the conditions necessary for the ANOVA test to run an analysis of variance.  The boxplot shows that the data is very slightly skewed right so we can conclude that the data follows a normal distribution.

The next step is to check the equality of variance.  We will use the BFL test.  We set up the NULL and Research Hypthesis.

Ho : o1^2 = o2^2 = o3^2 = o4^2 = o5^2

Ha : population variances are NOT equal

The Barlett's Test assuming a normal distribution has a test statistic equalling 2.33 and a p value of .676

The Levene's Test assuming any continuous distribution has a test statistic equalling .26 and a p value of .90

The p value for the Levene's Test is .90 so it is greater than .05, which is the established alpha.  Therefore, we accept the null hypothesis and conclude that the variances are equal. 

The conditions for the ANOVA test are present.

```{r}

library(pairwiseCI)

library(multcomp)

library(stats)

wl <- read.csv(file = "9.13.csv", header = TRUE)

attach(wl)

S<-factor(s)

plot(wl)

anova1<-aov(wl~S)

```

 

What conclusions do you reach concerning the mean weight loss achieved using the five different agents?

We need to establish the NULL and Research Hypothesis for the ANOVA Test.

Ho : u1 = u2 = u3 = u4 = u5

Ha : population means are NOT equal

 

When we run the ANOVA test, the p value for the F test is .0001, which is less than alpha of .05.  Therefore, we reject the NULL hypothesis and conclude that there is significant difference among the mean weight reducing agents.

 

9.14 Refer to Exercise 9.13. Determine the significantly different pairs of means using the

Tukey’s W with alpha = .05.

The means of groups A1, A2, and A4 are NOT significantly different.  The means of groups A3 and A4 are NOT significantly different.  The means of groups A3 and S are NOT significantly different.  We can conclude from the previous that the means of group A1 and A4 is significantly different from the means of group A3 and S.

 

9.15 Refer to Exercises 9.13 and 9.14.

a. Use a Bonferroni t test to determine which pairs of means are significantly

different. Use alphaE = .05.

```{r}

pairwise.t.test(wl$a1,wl$a2,wl$a3,wl$a4,wl$s,p.adj = "bonferroni")

```

 

b. Use Scheffé’s S procedure to determine which pairs of means are significantly

different. Use alphaE = .05.

c. Which of the three procedures determined the largest number of significantly

different pairs of means? The fewest?

 

9.16 Refer to Exercise 9.13. The researcher wants to determine which of the new agents

produced

a significantly larger mean weight loss in comparison to the standard agent. Use alpha = .05

in making this determination.

9.17 Refer to Exercise 9.13. Suppose the new weight-loss agents were of the following form:

A1: Drug therapy with exercise and counseling

A2: Drug therapy with exercise but no counseling

A3: Drug therapy with counseling but no exercise

A4: Drug therapy with no exercise and no counseling

Construct contrasts to make comparisons among the agent means that will address the following:

a. Compare the mean for the standard agent to the average of the means for the

four new agents.

b. Compare the mean for the agents with counseling to those without counseling.

(Ignore the standard.)

c. Compare the mean for the agents with exercise to those without exercise.

(

Ignore the standard.)

d. Compare the mean for the agents with counseling to the standard.

9.18 Refer to Exercise 9.17. Use a multiple-testing procedure to determine at the alpha = .05 level

which of the contrasts is significantly different from zero. Interpret your findings relative to the

researchers’ question about finding the most effective weight-loss method.