![](https://csdnimg.cn/release/download_crawler_static/8953433/bg11.jpg)
i
i
“book” — 2009/6/16 — 16:53 — page xviii — #18
i
i
i
i
i
i
xviii PREFACE
Using the book
The book has three indices, in addition to the comprehensive table of contents. These
include: 1) a detailed topic (subject) index in English; 2) a SAS index, organized by SAS
syntax; and 3) an R index, describing R syntax. SAS users can use the SAS index to look
up a task for which they know the SAS code and turn to a page with that code as well as
the associated R code to carry out that task. R users can use the dictionary in an analogous
fashion using the R index.
Extensive example analyses are presented; see Table C.1 (p. 277) for a comprehensive
list. These employ a single dataset (from the HELP study), described in Appendix C.
Readers are encouraged to download the dataset and code from the book website. The
examples demonstrate the code in action and facilitate exploration by the reader.
Differences between SAS and R
SAS and R are so fundamentally distinct that an enumeration of their differences would
be counter-productive. However, some differences are important for new users to bear in
mind.
SAS includes data management tools that are primarily intended to prepare data for
analysis. After preparation, analysis is performed in a distinct step, the implementation
of which effectively cannot be changed by the user, though often extensive options are
available. R is a programming environment tailored for data analysis. Data management
and analysis are integrated. This means, for example, that calculating the BMI from weight
and height can be treated as a function of the data, and as such is as likely to appear within
a data analysis as in making a “new” piece of data to keep.
SAS Institute makes decisions about how to change the software or expand the scope of
included analyses. These decisions are based on the needs of the user community and on cor-
porate goals for profitability. For example, when changes are made, backwards-compatibility
is almost always maintained, and documentation of exceptions is extensive. SAS Institute’s
corporate conservatism means that techniques are sometimes not included in SAS until
they have been discussed in the peer-reviewed literature for many years. While the R Core
Team controls base functionality, a very large number of users have developed functions
for R. Methodologists often release R functions to implement their work concurrently with
publication. While this provides great flexibility, it comes at some cost. A user-contributed
function may implement a desired methodology, but code quality may be unknown, docu-
mentation scarce, and paid support nonexistent. Sometimes a function which once worked
may become defunct due to a lack of backwards-compatibility and/or the author’s inability
to, or lack of interest in, updating it.
Other differences between SAS and R are worth noting. Data management in SAS is
undertaken using row by row (observation-level) operations. R is inherently a vector-based
language, where columns (variables) are manipulated. R is case-sensitive, while SAS is
generally not.
Where to begin
We do not anticipate that the book will be read cover to cover. Instead, we hope that
the extensive indexing, cross-referencing, and worked examples will make it possible for
readers to directly find and then implement what they need. A user new to either SAS
or R should begin by reading the appropriate Appendix for that software package, which
includes a sample session and overview.
© 2010 by Taylor and Francis Group, LLC