DOC PREVIEW
UW-Madison STAT 371 - R for Introductory Statistics

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

R for Introductory StatisticsBret LargetSeptember 25, 2002The aim of this document is to help you, an undergraduate student in an introductory statistics course, learnto use the software R as part of your learning of statistics. If you find that it reads like the rough draft ofsomething that could be more useful and better written, that is because it is a rough draft that could bemore useful and better written. This document will evolve on a weekly basis as the semester progresses. Iwill add new material as we cover it in class and edit old material based on feedback from you to make itclearer for you and future students. I suggest that you do not print new versions but merely replace yourelectronic copy from time to time. Good luck as you begin your quest to master introductory statisticalconcepts and their application!1 What is R?R is powerful software for interacting with data. With R you can create sophisticated graphs, you cancarryout statistical analyses, and you can create and run simulations. R is also a programming languagewith an extensive set of built-in functions, so you can, with some experience, extend the language and writeyour own code to build your own statistical tools. Advanced users can even incorporate functions written inother languages, such as C, C++, and Fortran.The S language has been around for more than twenty years and has been the most widely-used statisticalsoftware in departments of statistics for most of that time, first as S and then as the commercially availableS-PLUS. R is an open source implementation of the S language that is now a viable alternative to S-PLUS,and in fact, has many advantages. A core team of statisticians and many other contributors work to updateand improve R and to make versions that run well under all of the most popular operating systems. Mostimportantly to you, R is free, high-quality statistical software that will be useful as you learn statistics eventhough it is also a first-rate tool for professional statisticians.Why use R for introductory statistics?There are several reasons that make R an excellent choice of statistical software for an introductory statisticalcourse. First, R is free and available on the Web. You can use it on your home computers and are not tiedto campus labs. Second, R is powerful, widely-used software. The knowledge of R you gain during thecourse potentially translates to a marketable skill. You will learn to use a tool that has many practical usesoutside the classroom. Third, even though it is not the simplest statistical software, the basics are easyenough to master that learning to use R need not interfere overly much with learning the statistical conceptsencountered in an introductory course. Fourth, did I mention that it is free and you can use it at home?The primary drawback to using R in an introductory course is that most existing documentation for R1is written for an audience that is knowledgable about statistics and has experience with other statisticalcomputing programs. In contrast, this document intends to make R accessible to the typical student in anintroductory statistics course who is new to both statistical concepts and statistical computing. The aim is toteach you how to install R on your home computer and to teach you to use R to learn the statistical conceptsusually included in an introductory course with explanations and examples aimed at the appropriate level.This document purposely does not attempt to teach you about R’s advanced features. The intention is toteach you enough R to enhance your learning of introductory statistics and to point you in the direction ofmore information should you find a desire to learn more.2 Installing RInstalling R on your computer is simple if you have clear directions you can find that tell you exactly what todo in a way that is easy to understand. Directions exist at the R website (http://cran.r-project.org/)for installing R, but many students may have difficulty determining which files they need to download andthen how to install them. Here are more explicit instructions that tell you what to do.Obtaining the softwareThere are two options for installing the software: downloading it from the Web or installing from a preparedCD. If you have a fast Internet connection (a direct campus connection, cable modem, or DSL), I recommendthat you download the software. If you have no Internet connection or are limited to a regular modem Irecommend that you borrow a CD from me. In either case, there is only one file that you need to obtain(different depending on the operating system). Running this file begins the installation process which isstraight-forward.Downloading R from the WebGo the R homepage at http://cran.us.r-project.org/.Windows (95 or later) Click on the link Windows (95 and later), then click on the link base/, andfinally click on SetupR.exe which begins the download. After the download is complete, double click on thedownloaded file and follow the on screen installation instructions.Macintosh Click on the link MacOS (System 8.6 to 9.1 and MacOS X), then click on the link base/,and finally click on rm151.sit which begins the download. After the download is complete, double click onthe downloaded file and follow the on screen installation instructions.Loading R from a CDInsert the CD into the drive, open the CD (from My Computer in Windows) and double click on theSetupR.exe icon to begin installation. Follow the on screen installation instructions.23 A First Session with RStarting and QuittingBecause most students in the course are running R under Windows, these instructions will assume that youare using the Windows version. (Apologies to the few Mac users.) I actually run R most often under Linux.If you notice differences in what I write and how R actually performs under Windows, please let me know.Begin R by double clicking on the shortcut (if you added a shortcut to your Desktop) or from the Startbutton followed by the Program menu. R will open with a command window with a prompt > that awaitsyour first command. R is a command line program. You interact with the software by typing in commandswhich the program then interprets and acts on.When you are done with your R session, you can quit from the File menu or by typing q() in the commandwindow at the prompt >.Several ExamplesHere is a demonstration of several functions you will use frequently. A later section will provide more details.In these examples I will look at a data set


View Full Document

UW-Madison STAT 371 - R for Introductory Statistics

Documents in this Course
HW 4

HW 4

4 pages

NOTES 7

NOTES 7

19 pages

Ch. 6

Ch. 6

24 pages

Ch. 4

Ch. 4

10 pages

Ch. 3

Ch. 3

20 pages

Ch. 2

Ch. 2

28 pages

Ch. 1

Ch. 1

24 pages

Ch. 20

Ch. 20

26 pages

Ch. 19

Ch. 19

18 pages

Ch. 18

Ch. 18

26 pages

Ch. 17

Ch. 17

44 pages

Ch. 16

Ch. 16

38 pages

Ch. 15

Ch. 15

34 pages

Ch. 14

Ch. 14

16 pages

Ch. 13

Ch. 13

16 pages

Ch. 12

Ch. 12

38 pages

Ch. 11

Ch. 11

28 pages

Ch. 10

Ch. 10

40 pages

Ch. 9

Ch. 9

20 pages

Ch. 8

Ch. 8

26 pages

Ch. 7

Ch. 7

26 pages

Load more
Download R for Introductory Statistics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view R for Introductory Statistics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view R for Introductory Statistics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?