Basic Introduction to SAS Programming above discussed
the basics of programming a PROC step in SAS, which is the foundation
of SAS statistical analyses. The rest of this book gives various examples
of core SAS statistical analyses in the context of business.
Just a few more general
points apply to thinking about SAS data analyses:
-
Knowing which analysis is the appropriate
one for your situation is obviously critical. This book discusses
many introductory analyses to help you begin this journey. However,
especially when you are entering into more complex modelling, you
should first carefully investigate the general ideas behind what the
correct analysis is. Thereafter, you can read up on how SAS implements
that specific analysis through code.
-
You can easily find prior examples
of SAS code for your desired analysis in the SAS helpfiles, online
through SAS User Group articles or the like, or in books like this
one. Then, you can copy the code developed in those sources and simply
change the names of the dataset and variables for your particular
analysis. In a similar vein, SAS Studio has pre-written code in the
Tasks section.
-
Often, in the same SAS program,
we will first manipulate data and then – immediately below
the DATA step – place the PROC step that references and analyses
the dataset created above. We can then run the set together, change
the data or analysis steps again if required, and so on.
Example Code 6.2 Example of running DATA and PROC steps together is an example.
Example Code 6.2 Example of running DATA and PROC steps together
Data Transformed;
Set MBA.Profits;
LogRevenue = Log(Revenue);
Run;
Proc Means data=Transformed;
Var LogRevenue Cost Profit;
Run;