R is a powerful and free software system for data analysis and graphics, with over 1,200 add-on packages available. This book introduces R using SAS and SPSS terms with which you are already familiar. It demonstrates which of the add-on packages are most like SAS and SPSS and compares them to R's built-in functions. It steps through over 30 programs written in all three packages, comparing and contrasting the packages' differing approaches. The programs and practice datasets are available for download. The glossary defines over 50 R terms using SAS/SPSS jargon and again using R jargon. The table of contents and the index allow you to find equivalent R functions by looking up both SAS statements and SPSS commands. When finished, you will be able to import data, manage and transform it, create publication quality graphics, and perform basic statistical analyses. 'This is a really great book. It is easy to read, quite comprehensive, and would be extremely valuable to both regular R users and users of SAS and SPSS who wish to switch to or learn about R! An invaluable reference' - David Hitchcock, University of South Carolina. 'Thanks for writing R for SAS and SPSS Users - it is a comprehensible and clever document. The graphics chapter is superb!' - Tony N. Brown, Vanderbilt University. 'This is a Rosetta Stone for SPSS and SAS users to start learning R quickly and effectively' - Ralph O'Brien, ASA Fellow. 'I am a professional SAS and SPSS programmer and found this book extremely useful' - Tony Chu, Public Policy Research Data Analyst.
1 Introduction 1
2 The Five Main Parts of SAS and SPSS 5
3 Programming Conventions 7
4 Typographic Conventions 9
5 Installing and Updating R 11
6 Running R 21
7 Help and Documentation 41
8 Programming Language Basics 49
9 Data Acquisition 77
10 Selecting Variables - Var, Variables = 103
11 Selecting Observations - Where, If, Select If, Filter 123
12 Selecting Both Variables and Observations 141
13 Converting Data Structures 143
14 Data Management 147
15 Value Labels or Formats (and Measurement Level) 225
16 Variable Labels 239
17 Generating Data 245
18 How R Stores Data 259
20 Graphics Overview 273
21 Traditional Graphics 281
22 Graphics with ggplot2 (GPL) 341
23 Statistics 403
24 Conclusion 441
App. A A Glossary of R Jargon 443
App. B A Comparison of SAS and SPSS Products with R Packages and Functions 449
App. C Automating Your Settings 453
App. D A comparison of the major attributes of SAS and SPSS to R 457