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.

Linear regression 275Figure 10.5 Four diagnostic plots <strong>for</strong>the maximum-heart-rate dataproduced by the extractor functionplot ()10.2.2 Statistical inferencesIf the linear model seems appropriate <strong>for</strong> the data, statistical inference is possible. What isneeded is an understanding of the sampling distribution of the estimators.To investigate these sampling distributions, we per<strong>for</strong>med simulations of the modelY i =x i +ε i , using x=rep(1:10,10) and y=rnorm(100,x,5). Figure 10.6 shows the resultingregression lines <strong>for</strong> the different simulations. For reference, a single result of thesimulation is plotted using a scatterplot. There is wide variation among the regressionlines. In addition, histograms of the simulated values of and are shown.We see from the figure that the estimators are random but not arbitrary. Both andare normally distributed, with respective means β 0 and β 1 . Furthermore,has a χ 2 -distribution with n−2 degrees of freedom.We will use the fact that the following statistics have a t-distribution with n−2 degreesof freedom:

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

Saved successfully!

Ooh no, something went wrong!