Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Statistics 517 Computing in Statistics © Fall 2004 Don Edwards and the University of South Carolina.

Similar presentations


Presentation on theme: "1 Statistics 517 Computing in Statistics © Fall 2004 Don Edwards and the University of South Carolina."— Presentation transcript:

1 1 Statistics 517 Computing in Statistics © Fall 2004 Don Edwards and the University of South Carolina

2 2 Course Goals lR (=Splus) programming lSAS programming (DATA step) Syllabus l lRead it carefully!

3 3 A Typical Class lDiscuss previous coding exercise (10 min) lCoding discussion and demonstration (25-40 min) lAssign coding exercise lTime spent on exercises is “built in” to class time

4 4 Learning R lDon Edward’s notes lSupplemental exercises lMany other R resources available online

5 5 Basics of R, Chapters 1-2.5 lIntro to R lObjects, Modes, Assignments lGetting Help

6 6 1. R: An Introduction lShareware version of S (  Splus) lVersion 2.7.1 for Windows lSteep learning curve (case sensitive, cryptic help and error messages, data import and export)

7 7 1. R: An Introduction lStarting and quitting lObject oriented lVectors, factors, matrices, data frames, lists, functions lR object names are flexible lBe careful of built-in R names lDon’t let objects accumulate

8 8 2.1 Vectors lStrings of data elements of the same mode lMajor modes: numeric, character, logical lExamples from R data sets

9 9 2.1 Vectors lComponent extraction lAssignments (beware copying over variables!) lObject attributes (e.g. names) llength(), c(), “:”, seq() functions lNo shorthand for increments in “:” statement lFunctions can be nested

10 10 2.2 Factors lDefines groups in data (looks like a character vector, but no quotes) lLevels lCoercing to a character vector lOther coercion functions

11 11 2.3 Matrices lTwo-dimensinal array; columns have same mode (usually numeric) lAttributes: dim and dimnames lCaution about length() lExtracting a single element, or an entire row or column

12 12 2.4 Data Frames lR’s standard “data set” lTwo-dimensional array but columns may have different modes lAttributes: names, row.names lReferencing columns with $ lConversion of character vectors to factor objects by data.frame()

13 13 2.5 Lists lGlued-together strings of diverse objects lOutput of many R functions lE.g., attributes of any object lExtraction with [[ ]] lExtraction with $


Download ppt "1 Statistics 517 Computing in Statistics © Fall 2004 Don Edwards and the University of South Carolina."

Similar presentations


Ads by Google