Transcription of Computing Primer for Applied Linear Regression, 4th ...
1 Computing Primer for AppliedLinear regression , 4th Edition,Using RVersion of October 27, 2014 Sanford WeisbergSchool of StatisticsUniversity of MinnesotaMinneapolis, Minnesota 55455 Copyrightc 2014, Sanford WeisbergThisPrimeris best viewed using a pdf viewer such as Adobe Reader with bookmarks showing atthe left, and in single page view, selected byView Page Display Single Page cite this Primer , use:Weisberg, S. (2014). Computing Primer for Applied Linear regression , 4th Edition, UsingR. Online, GettingRand Getting Started.
2 Packages You Will Need .. Using This Primer .. If You Are New toR.. Getting Help .. The Very Basics .. a Data File .. Your Own Data intoR.. Excel Files .. Text and Graphs .. ,F,tand 2tables .. xiviCONTENTSii1 Scatterplots and Scatterplots .. Summary Graph .. Tools for Looking at Scatterplots .. Scatterplot Matrices .. Problems ..82 Simple Linear Least Squares Criterion .. Estimating the Variance 2.. Estimated Variances.
3 Confidence Intervals andt-Tests .. The Coefficient of Determination,R2.. The Residuals .. Problems ..203 Multiple Adding a Term to a Simple Linear regression Model .. Variability .. Plots .. The Multiple Linear regression Model .. Regressors and Predictors .. Ordinary Least Squares .. Predictions, Fitted Values and Linear Combinations .. Problems ..314 Interpretation of Main Understanding Parameter Estimates .. of Change .. Depends on Other Terms in the Mean Function.
4 In Logarithmic Scale .. Problems ..385 Complex Factors .. Models .. a Continuous Predictor .. Main Effects Model .. Polynomial regression .. with Several Predictors .. Splines .. Principal Components .. Missing Data ..526 Testing and Analysis of TheanovaFunction .. TheAnovaFunction .. ThelinearHypothesisFunction .. Comparisons of Means .. Power .. Simulating Power ..697 Weighted Least Squares .. Misspecified Variances .. Misspecified Variance.
5 Test for Constant Variance .. General Correlation Structures .. Mixed Models .. The Delta Method .. The Bootstrap ..778 Transformation Basics .. Transformations .. Only the Predictor Variable .. One Predictor Variable .. A General Approach to Transformations .. the Response .. Transformations of Nonpositive Variables .. Additive Models .. Problems ..869 regression The Residuals .. Hat Matrix .. and the Hat Matrix with Weights .. Testing for Curvature.
6 Nonconstant Variance .. Outliers .. Influence of Cases .. Normality Assumption ..9810 Variable Variable Selection and Parameter Assessment .. Variable Selection for Discovery .. Information Criteria .. Stepwise regression .. Regularized Methods .. Model Selection for Prediction .. Cross Validation .. Problems .. 10411 Nonlinear Estimation for Nonlinear Mean Functions .. Starting Values .. Bootstrap Inference .. 11212 Binomial and Poisson Binomial regression .
7 Poisson regression .. 124A Estimating E(Y|X) Using a Smoother .. A Brief Introduction to Matrices and Vectors .. The QR Factorization .. Spectral Decomposition .. 131 CHAPTER0 IntroductionThis computer Primer supplementsApplied Linear regression , 4th Edition(Weisberg, 2014), abbrevi-atedalrthought this Primer . The expectation is that you will read the book and then consult thisprimer to see how to apply what you have learned Primer often refers to specific problems or sections inalrusing notation likealr[ ]oralr[ ], for a reference to Section or Appendix ,alr[ ]for Problem ,alr[ ]forFigure ,alr[ ]for an equation andalr[ ]for a table.
8 The section numbers in the primercorrespond to section numbers inalr. An index ofRfunctions and packages is included at the end ofthe 0. GettingRand Getting StartedIf you don t already haveR, go to the website for the follow the directions Packages You Will NeedWhen you installRyou get the basic program and a common set of packages that give the programadditional functionality. Three additional packages not in the basic distribution are used extensivelyinalr:alr4, which contains all the data used inalrin both text and homework problems,car, acomprehensive set of functions added toRto do almost everything inalrthat is not part of the basicR,and finallyeffects, used to draw effects plots discussed throughout thisPrimer.
9 The website includesdirections for getting and installing these Using This PrimerComputer input is indicated in thePrimerinthis font, while output is inthis font. The usualcommand prompt > and continuation + characters inRare suppressed so you can cut and pastedirectly from thePrimerinto anRwindow. Beware, however that a current command may depend onearlier commands in the chapter you are reading!You can get a copy of this Primer while runningR, assuming you have an internet connection. Hereare examples of the use of this function:library(alr4)alr4 Web() # opens the website for the book in your browseralr4 Web(" Primer ") # opens the Primer in a pdf viewerCHAPTER 0.
10 INTRODUCTION viiiThe first of these calls toalr4 Webopens the web page in your browser. The second opens the latestversion of thisPrimerin your browser or pdf viewer. This Primer is formatted for reading on thecomputer screen, with aspect ratio similar to a tablet like an iPad in landscape you use Acrobat Reader to view thePrimer, setView Page Display Single Page , bookmarks should be visible to get a quick table of contents; if the bookmarks are not visible,click on the ribbon in the toolbar at the left of the Reader If You Are New toR.