# Two means, independent (and large) samples. # Birth weights, babies with smoker vs nonsmoker mothers. xb1=6.78 # smoker s1=1.43 n1=50 xb2=7.18 # nonsmoker s2=1.60 n2=100 # 95% CI for mu2-mu1 me=1.96*sqrt(s1^2/n1+s2^2/n2) xb2-xb1-me xb2-xb1+me # Hypothesis test of Ho: mu2-mu1=0 vs Ha: mu2-mu1>0 z=(xb2-xb1-0)/sqrt(s1^2/n1+s2^2/n2) p=1-pnorm(z) z p