Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Low doses of the insecticide toxaphene may cause weight gain in rats. A treatmen

ID: 3206710 • Letter: L

Question

Low doses of the insecticide toxaphene may cause weight gain in rats. A treatment group n = 20 rats were given toxaphene in their diet, while a control group of m = 8 rats were not given toxaphene. The average weight gain among the treatment group was 60 kg and the standard deviation was 30 kg. The average weight gain among the control rats was 10 kg and the standard deviation was 50 kg.

(a) Construct a 95% condence interval for the difference in mean weight gain between the treatment and control groups.

(b) Now let X represent the weight gain of a rat from the treatment group and let Y represent the weight gain of a rat from the control group.

Assume we know that

Using simulation, create a condence interval for the difference in mean weight gain. There are several ways to implement the simulation. Here is an overview/pseudocode of how to use a simple for loop. (The simulation should have 10,000 iterations)

Create a vector to hold 10,000 numeric values

for Loop over an index variable 10,000 times do

Compute the difference in means and store it in the vector

end for

Find the .025 and .975 quantiles of the 10,000 differences

x <- rnorm(20, 60, 30)

Compare the condence interval from the simulation with the condence interval that you com- puted in part 4a. Are the two intervals roughly of the same width? Explain any difference that you observe.

Explanation / Answer

Answer:

Low doses of the insecticide toxaphene may cause weight gain in rats. A treatment group n = 20 rats were given toxaphene in their diet, while a control group of m = 8 rats were not given toxaphene. The average weight gain among the treatment group was 60 kg and the standard deviation was 30 kg. The average weight gain among the control rats was 10 kg and the standard deviation was 50 kg.

95% CI = (ar x1-ar x2) ± z*se

Hypothesis Test: Independent Groups (z-test)

g1

g2

60

10

mean

30

50

std. dev.

20

8

n

50.000

difference (g1 - g2)

18.908

standard error of difference

0

hypothesized difference

2.64

z

.0082

p-value (two-tailed)

12.942

confidence interval 95.% lower

87.058

confidence interval 95.% upper

37.058

margin of error

95% CI = (12.942, 87.058)

(b) Now let X represent the weight gain of a rat from the treatment group and let Y represent the weight gain of a rat from the control group.

Assume we know that

X N ( x = 60; x = 30)

Y N ( y = 10; y = 50)

Using simulation, create a condence interval for the difference in mean weight gain. There are several ways to implement the simulation. Here is an overview/pseudocode of how to use a simple for loop. (The simulation should have 10,000 iterations)

Create a vector to hold 10,000 numeric values

for Loop over an index variable 10,000 times do

Draw 20 samples from N ( x = 60; x = 30)

Draw 8 samples from N ( y = 10; y = 50)

Compute the difference in means and store it in the vector

end for

Find the .025 and .975 quantiles of the 10,000 differences

If you are using R, you can draw 20 random samples from the N ( x = 60; x = 30) distribution and store them in a vector called x like this

x <- rnorm(20, 60, 30)

x <- rnorm(20, 60, 30)

y <- rnorm(8, 10, 50)

t.test(x,y)

x <- rnorm(20, 60, 30)

> y <- rnorm(8, 10, 50)

> t.test(x,y)

        Welch Two Sample t-test

data: x and y

t = 5.9075, df = 20.583, p-value = 7.905e-06

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

( 37.28990, 77.88516)

sample estimates:

mean of x mean of y

64.126079 6.538549

Compare the condence interval from the simulation with the condence interval that you com- puted in part 4a. Are the two intervals roughly of the same width? Explain any difference that you observe.

Confidence interval from the simulation is narrow than part 4a. The difference is due to the simulation result is more appropriate.

Hypothesis Test: Independent Groups (z-test)

g1

g2

60

10

mean

30

50

std. dev.

20

8

n

50.000

difference (g1 - g2)

18.908

standard error of difference

0

hypothesized difference

2.64

z

.0082

p-value (two-tailed)

12.942

confidence interval 95.% lower

87.058

confidence interval 95.% upper

37.058

margin of error