Probability and Statistics for Engineering and the Sciences (with CD-ROM and InfoTrac )

This preview shows page 1 out of 1 page.

Stat 312: Lecture 17Two samplettestMoo K. Chung[email protected]November 9, 20041. LetX1,· · ·, XnandY1,· · ·, Ymbe two indepen-dent samples from normal distributions withthe same population variance, i.e.XiN(μX, σ2) andYjN(μY, σ2).The pooled estimator ofσisS2p=(n-1)S2X+ (m-1)S2Yn+m-2.The test statistic for testingH0:μX=μYvs.H1:μX6=μYT=¯X-¯Y-(μX-μY)Spp1/n+ 1/mtn+m-2.RejectH0if|T|> tα/2,n+m-2.Example.A study was conducted to comparethe weights of cats and dogs. Weights of cats:20, 21, 35, 13, 21, 10. Weights of dogs: 31, 10,20, 40. Assume normality and equal variancefor both cats and dogs. Is there any differencebetween the weights of cats and dogs?> x<-c(20,21,35,13,21,10)> y<-c(31,10,20,40)> Sp<-sqrt((5*var(x)+3*var(y))/8)[1] 10.52824> t=(mean(x)-mean(y))/(Sp*sqrt(1/5+1/3))> t[1] -0.6827026> qt(0.05,8)[1] -1.8595482. Checking the equality of variance.This topicwill be discussed later in detail.> var(x)[1] 75.2> var(y)[1] 170.25> var.test(x,y)
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Chung

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture