SAS Resources

What is SAS?

SAS is a software system for managing data, performing statistical analyses, and creating graphs and reports. Students can use SAS to develop skills in statistical computing, research, and data analysis.

What can you do with SAS?

  • Manage data: Import files, combine datasets, select observations, and create new variables.
  • Summarize data: Calculate descriptive statistics and create frequency tables.
  • Perform statistical analyses: Conduct hypothesis tests, analysis of variance (ANOVA), and regression analyses.
  • Communicate results: Create graphs, tables, and reports that explain statistical findings.

Get started with SAS

SAS OnDemand for Academics provides free access to SAS for teaching and learning. Students, educators, and independent learners can use SAS Studio, a browser-based interface for writing programs, running analyses, and viewing results. No local SAS installation is required.

Create a SAS profile and follow the registration instructions to get started. If you are using SAS for a course, follow your instructor’s instructions for accessing course materials.

Basic programming examples

SAS programs often use a DATA step to create or modify a dataset and a PROC step to analyze or display it. Most SAS statements end with a semicolon.

Create and display a dataset

This example creates a small dataset of fictional exam scores. Run it before the examples below.

data scores;
   input student $ exam;
   datalines;
Alex 85
Blair 92
Casey 78
Drew 88
Erin 97
;
run;

proc print data=scores noobs;
run;

The output displays the five students and their exam scores.

Calculate summary statistics

Use PROC MEANS to calculate the number of observations, mean, standard deviation, minimum, and maximum.

proc means data=scores n mean std min max;
   var exam;
run;

For these data, the mean exam score is 88, with scores ranging from 78 to 97.

Create a frequency table

The following DATA step creates a variable indicating whether each score is at least 90. PROC FREQ then counts the observations in each category.

data score_groups;
   set scores;
   length score_group $ 12;

   if exam >= 90 then score_group = "90 or higher";
   else score_group = "Below 90";
run;

proc freq data=score_groups;
   tables score_group;
run;

Two students scored 90 or higher, and three scored below 90.

Learning resources