Transcription of Using R for Introductory Statistics - SJTU
1 Using R for Introductory Statistics Using R for Introductory Statistics John Verzani CHAPMAN & HALL/CRC. A CRC Press Company Boca Raton London New York Washington, This edition published in the Taylor & Francis e-Library, 2005. To purchase your own copy of this or any of Taylor & Francis or Routledge's collection of thousands of eBooks please go to . Library of Congress Cataloging-in-Publication Data Verzani, John. Using R for introductiory Statistics /John Verzani. p. cm. Includes index. ISBN 1-58488-4509 (alk. paper) 1. Statistics . Data processing . 2. R (Computer program language) I.
2 Title 2004 dc22. 2004058244. This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. Neither this book nor any part may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, microfilming, and recording, or by any information storage or retrieval system, without prior permission in writing from the publisher.
3 The consent of CRC Press does not extend to copying for general distribution, for promotion, for creating new works, or for resale. Specific permission must be obtained in writing from CRC Press for such copying. Direct all inquiries to CRC Press, 2000 Corporate Blvd., Boca Raton, Florida 33431. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation, without intent to infringe. Visit the CRC Press Web site at 2005 by Chapman & Hall/CRC Press No claim to original Government works ISBN 0-203-49989-1 Master e-book ISBN.
4 ISBN 0-203-59470-3 (Adobe e-Reader Format). International Standard Book Number 1-58488-4509 (Print Edition). Library of Congress Card Number 2004058244. Contents 1 Data 1. 2 Univariate data 31. 3 Bivariate data 67. 4 Multivariate Data 102. 5 Describing populations 138. 6 Simulation 161. 7 Confidence intervals 178. 8 Significance tests 207. 9 Goodness of fit 239. 10 Linear regression 264. 11 Analysis of variance 298. 12 Two extensions of the linear model 327. A Getting, installing, and running R 343. B Graphical user interfaces and R 348. C Teaching with R 354.
5 D More on graphics with R 356. E Programming in R 369. Index 392. Preface What is R? R is a computer language for statistical computing similar to the S language developed at Bell Laboratories. The R software was initially written by Ross Ihaka and Robert Gentleman in the mid 1990s. Since 1997, the R project has been organized by the R. Development Core Team. R is open-source software and is part of the GNU project. R is being developed for the Unix, Macintosh, and Windows families of operating systems. The R home page ( ) contains more information about R and instructions for downloading a copy.
6 R is excellent software to use while first learning Statistics . It provides a coherent, flexible system for data analysis that can be extended as needed. The open-source nature of R ensures its availability. R's similarity to S allows you to migrate to the commercially supported S-Plus software if desired. Finally, despite its reputation, R is as suitable for students learning Statistics as it is for researchers Using Statistics . The purpose of this book This book started as a set of notes, titled simpleR, that were written to fill a gap in documentation for Using R in an Introductory Statistics class.
7 The College of Staten Island had been paying a per-seat fee to use a commercial Statistics program. The cost of the program precluded widespread installation and curtailed accessibility. It was determined that the students would be better served if they could learn Statistics with a software package that taught them good computer skills at the outset, could be installed all over campus and at home with relative ease, and was free to use. However, no suitable materials were available to accompany the class text. Hence, the basis for simpleR a set of notes to accompany an in-class text.
8 Now, as R gains wider acceptance, for pedagogic, style, and economic rea-sons, there is an increase, but no abundance, in available documentation. The adoption of R as the statistical software of choice when learning Statistics depends on Introductory materials. This book aims to serve the needs of students in Introductory applied- Statistics classes that are based on precalculus skills. An emphasis is put on finding simple-looking solutions, rather than clever ones. Certainly, this material could be covered more quickly (and is in other books such as those by Dalgaard, Fox, and Venables and Ripley).
9 The goal here is to make it as accessible to student-learners as possible. This book aims to serve a hybrid purpose: to cover both statistical topics and the R. software. Though the material stands alone, this book is also intended to be useful as an accompaniment to a standard Introductory Statistics book. Description of this book The pacing and content of this book are a bit different from those in most Introductory texts. More time is spent with exploratory data analysis (EDA) than is typical, a chapter on simulation is included, and a unified approach to linear models is given.
10 If this book is being used in a semester-long sequence, keep in mind that the early material is conceptually easier but requires that the student learn more on the computer. The pacing is not as might be expected, as time must be spent learning the software and its idiosyncrasies. Chapters 1 through 4 take a rather leisurely approach to the material, developing the tools of data manipulation and exploration. The material is broken up so that users who wish only to analyze univariate data can safely avoid the details of data frames, lists, and model formulas covered in Chapter 4.