SAS Programming for R Users (Course Materials)
This project contains the learning materials for the free SAS programming course, SAS Programming for R Users.
SAS Training offers a free e-Learning version of this course, which includes lecture, demos, and exercises. There are also occasionally instructor-led sessions of this course in the "Live Web" format for no charge; see the SAS training web site for the schedule and the Self-paced e-Learning link.
The course materials supplied here contain everything you need for self-paced learning or (for experts) to teach the course to other students. Materials include:
- PDF version of the course notes (over 600 pages)
- Sample data files in CSV, XLSX, text, and SAS code formats
- Over 80 SAS programs for course exercises
About The Course
This course is for experienced R users who want to apply their existing skills and extend them to the SAS environment. Emphasis will be placed on programming and not statistical theory or interpretation. Students of this course should have knowledge of plotting, manipulating data, iterative processing, creating functions, applying functions, linear models, generalized linear models, mixed models, stepwise model selection, matrix algebra, and statistical simulations.
Learn how to
- read and write SAS programs
- import various forms of data
- subset and merge data tables
- do iterative processing and simulate new data
- create new variables and functions
- create and enhance plots of all types
- apply descriptive and inferential procedures including regression, logistic regression, analysis of variance, stepwise model selection, and mixed models
- conduct matrix algebra and statistical simulations in the interactive matrix language (IML)
- call R from SAS to use as a complimentary resource.
Lab Machine Configuration
The Live Web version of this course uses a virtual lab environment. The lab environment features SAS for Windows, SAS Enterprise Guide, and SAS Studio. Any of these can be used as the programming environment. A small part of the course addresses the use of SAS Enterprise Miner.
Self-paced learners or anyone using this material in a classroom setting can adapt the course to use their own instance of Base SAS (Display Manager), SAS Enterprise Guide, or SAS Studio. SAS can run on Windows or any supported variety of UNIX or Linux.
The SAS program examples assume a home directory of "
s:\workshop" for the
SAS programs and data files. To adapt to your own environment, simply
change those path references to a location that works for your own
machine. If using SAS University Edition, you can use the
/folders/myfolder shared folder structure
as a "home base" for the code and data.
The following SAS products are used for the bulk of the course:
- Base SAS
These products are all included with SAS University Edition, a free SAS programming environment that you can download from SAS.
Integration with R
Chapter 8 of this course (chapter title: "A Bridge between SAS and R")
shows examples of integrating R with SAS.
The integration with R requires an installed version of R, plus a few additional configuration settings within your SAS environment. These settings are described in Chapter 8 of the course notes.
Note: Because you cannot modify its configuration, SAS University Edition does not support integration with R. You will still be able to complete Chapters 1 through 7 without the R integration.
You can obtain a copy of the license at LICENSE.txt
Copyright SAS Institute.