28.07.2014 Views

Answers to Homework #5 - Statistics

Answers to Homework #5 - Statistics

Answers to Homework #5 - Statistics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# code <strong>to</strong> simulate the null distribution of Fmax when the<br />

# sample sizes are 12, 8, 10, 10, 14.<br />

svec=1:5<br />

nloop=100000<br />

fmax=1:nloop*0<br />

nj=c(12,8,10,10,14)<br />

for(i in 1:nloop){<br />

for(j in 1:5){<br />

x=rnorm(nj[j])<br />

svec[j]=var(x)<br />

}<br />

fmax[i]=max(svec)/min(svec)<br />

}<br />

0 10 20 30 40<br />

4. The fit using two parabolas with vertex at the origin is shown in (a), with the<br />

residuals in (b). The hypothesis test gives p = .044, which is significant at α = .05<br />

but just barely. Because the residual variance seems <strong>to</strong> be growing in time, and<br />

because we expect the rust measurements <strong>to</strong> be more variable if the metal sits<br />

longer, we decide <strong>to</strong> use a weighted model. If we assume that the variance of y is<br />

proportional <strong>to</strong> x, the fit is shown in (c). It is not noticeably different than the<br />

unweighted fit; however, the p-value is now p = .074. The residuals look better, but<br />

now let’s assume that the variance of y is proportional <strong>to</strong> x 2 . The fit again looks<br />

very similar, but now we get p = .141.<br />

(a)<br />

res<br />

-5 0 5<br />

(b)<br />

y<br />

0 10 20 30 40<br />

(c)<br />

restr<br />

-4 -2 0 2 4<br />

(d)<br />

restr<br />

-2 -1 0 1 2<br />

(e)<br />

1.0 1.5 2.0 2.5 3.0 3.5 4.0<br />

1.0 1.5 2.0 2.5 3.0 3.5 4.0<br />

1.0 1.5 2.0 2.5 3.0 3.5 4.0<br />

1.0 1.5 2.0 2.5 3.0 3.5 4.0<br />

1.0 1.5 2.0 2.5 3.0 3.5 4.0<br />

To explain why the results are not significant after we weight the analysis, we point<br />

out <strong>to</strong> the scientists that most of the difference in the data is seen at month 4, where<br />

the paint A measurements (green dots) are smaller than the paint B measurements.<br />

If we don’t account for the fact that the variance is also higher here, these differences<br />

seem more significant. Notice that for the first month’s measurements, the means<br />

are about the same. When we weight these values more, the differences in paint are<br />

not significant.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!