10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

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.

Analysis of variance 311Figure 11.4 Birth weight by smokinghistoryPerhaps the assumption of normality isn’t correct, but we ignore that. If the test is valid, itlooks like level 1 (smokes now) has a smaller mean. Is this due to sampling? We fit themodel as follows:> res=1m(wt factor(smoke), data=df)> summary(res)…Coefficients:Estimate Std. Error t value Pr(>|t|)(Intercept) 122.778 0.760 161.60 < 2e−16 ***factor (smoke) 1 -8.668 1.107 −7.83 1.1e-14 ***factor (smoke) 2 0.307 1.970 0.16 0.88factor (smoke) 3 1.659 1.904 0.87 0.38factor (smoke) 9 3.922 5.655 0.69 0.49--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1‘’Residual standard error: 17.7 on 1231 degrees offreedomMultiple R-Squared: 0.0588, Adjusted R-squared:0.0557F-statistic: 19.2 on 4 and 1231 DF, p-value: 2.36e-15The marginal t-tests indicate that the level 1 of the smoke factor is important, whereas theothers may not contribute. That is, this is strong evidence that a mother’s smoking duringpregnancy decreases a baby’s birth weight. The treatment coding quantifies this in termsof differences from the reference level of never smoked. The estimate, −8.668, says thatthe birth weight of a baby whose mother smoked during her pregnancy is predicted to be8.688 grams less than that of a baby whose mother never smoked.

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

Saved successfully!

Ooh no, something went wrong!