STAT 362 / IT 362: Introduction to Computer Statistical Packages

Fall, 2003

Tuesday and Thursday, 3:00-4:15, Innovation Hall, room 137.

Instructor: James Gentle

If you send email to the instructor, please put "Stat 362" or "IT 362" in the subject line.


Although the general schedule of the course will remain essentially as shown below, this web page and the links to notes will evolve as the semester progresses. In particular, links to solutions to assignments and quizzes will be posted at appropriate times (after the fact, of course!).

These notes are copyrighted by their author, James E. Gentle, and are intended for the use of students currently registered for STAT 362 or IT 362. They may not be copied or used for any other purpose without permission of the author.

The general description of the course is available at www.scs.gmu.edu/~jgentle/stat362/


There are three versions of the text book, The Little SAS Book: the first edition, the "Second Edition", and the "Revised Second Edition". The contents are very similar, but there are some additional sections and chapters in the Revised Second Edition that are not in the Second Edition.

The Revised Second Edition has a new chapter inserted between Chapters 4 and 5 of the Second Edition. Therefore, Chapter 6 in the Revised Second Edition is Chapter 5 in the Second Edition, and so on.

The references below refer to pages, sections, and chapters in Revised Second Edition. Where they are different in the Second Edition, the pages, sections, or chapters are shown in brackets following the places in the Revised Second Edition. For example, " The Little SAS Book , Chapter 1 and Section 9.3 [Section 8.3]" means Chapter 1 in either version, Section 9.3 in the Revised Second Edition and Section 8.3 in the Second Edition.


The final exam is December 16 at 1:30.
This is right at the end of the exam period, and of course we'd all like to take the exam earlier, so don't even ask! (although I'm sure your excuse is good)



Week 1: Aug 26, 28

  • Computer systems and organization; applications software.
  • Data organization for statistical analysis.
    The "standard" rectangular array
    • Observations; rows ("cases", "instances", "records", etc.)
    • Variables; columns ("features", "attributes", "fields", etc.)
  • Introduction to the SAS software system (reference: The Little SAS Book , Chapter 1 and Section 9.3 [Section 8.3]).
    • Starting SAS
    • The SAS DATA step
    • Defining variables and entering data
    • Types of data; numeric data, character data
    • Creating new variables; the assignment statement
    • Simple SAS PROCs: PRINT, FREQ, CORR, and CHART
      (reference: The Little SAS Book , Sections 4.4, 4.11, 8.3 [7.3], and 8.4 [7.4]).
  • Assignment 1 (due following Tuesday)
  • Solution

Week 2: Sep 2, 4

  • Review of basic statistics
    • Descriptive statistics
    • Populations and parameters; Samples and statistics:
    • Statistical inference
      • Hypothesis testing (t tests); one-sided tests, two-sided tests
      • Estimation: confidence intervals
  • The SAS DATA step and more PROCs (reference: The Little SAS Book , Chapter 2).
    • Missing values
    • Input from ASCII data file; more on the INPUT statement
    • DROP/KEEP
    • Input from another SAS dataset; the SET statement
    • Conditional execution (reference: The Little SAS Book , Sections 3.4 and 3.5)
    • The WHERE statement (reference: The Little SAS Book , pages 274-275 [pages 242-243])
    • PROC SORT (reference: The Little SAS Book , Section 4.3).
      • Sortkeys
      • The BY statement
    • PROC MEANS (reference: The Little SAS Book , Sections 4.9, and 8.2 [7.2]).
      • SAS statements
      • t tests in SAS
  • Assignment 2 (due following Tuesday)
  • Solution

Week 3: Sep 9, 11

  • More on SAS datasets (reference: The Little SAS Book , Section 2.9).
    • External files
    • Saving and reusing SAS datasets
    • Additional statements in the SAS DATA step:
      • Simple functions (SQRT, LOG, RANUNI, etc.)
      • Functions to compute statistics within observations
      • OUTPUT/DELETE, DROP/KEEP, RENAME, LABEL
    • Multiple datasets within one DATA step
    • Working with subsets of a dataset; OBS, FIRSTOBS
  • Making programs work correctly; reading assignment: The Little SAS Book , Chapter 9 [Chapter 8]
  • Assignment 3 (due following Tuesday)
  • Solution

Week 4: Sep 16, 18


Week 5: Sep 23, 25

  • Review of Quiz 1
  • Still more on the DATA step (reference: The Little SAS Book , Chapters 2, 3, and 4).
    • Lagged variables
    • Automatic variables
    • Arrays
    • DO loops
    • Labels
    • More on the INPUT statement and controlling output
    • Character data
    • PUT and FILE statements
    • PROC FORMAT; custom formats; recoding
  • The Output Delivery System (reference: The Little SAS Book, Chapter 5 [Sections 4.15 and 4.16]).
  • Assignment 5 (due following Tuesday)
  • Solution

Week 6: Sep 30, Oct 2

  • Review of regression analysis
    • Simple regression models
    • Basic model fitting
    • AOV table and F test
    • Coefficient estimates and t tests
  • Regression in SAS (reference: The Little SAS Book , Sections 8.5 [7.5] and 8.6 [7.6]).
    • PROC REG statements
      • MODEL statement
      • P option
      • BY statement
      • PLOT statement
      • P. keyword
      • OVERLAY option
    • Output of PROC REG
  • Assignment 6 (due following Tuesday)
  • Solution

Week 7: Oct 7, 9


Week 8: Oct 16 (no class Oct 14)


Week 9: Oct 21, 23


Week 10: Oct 28, 30

  • Review of Quiz 2.
  • More on SAS datasets and data types.
    • The pointer in the INPUT statement
    • Informats/Formats
    • Conversion of data types
    • Date data (reference: The Little SAS Book , Sections 3.7, 3.8).
    • SQL (reference: The Little SAS Book , Appendix F).
    • Importing and exporting SAS datasets (reference: The Little SAS Book , Sections 2.6, 2.12, and 2.15--2.19).
  • Assignment 10 (due following Tuesday)
  • Solution

Week 11: Nov 4, 6


Week 12: Nov 11, 13

  • SAS macros (reference: The Little SAS Book , Chapter 7 [Chapter 6])
  • Regression models for nomimal response data
    • Binary data; logistic regression
    • Logistic regression in SAS
  • Assignment 12 (due following Tuesday)
  • Solution

Week 13: Nov 18, 20


Week 14: Nov 25 (no class Nov 27)


Week 15: Dec 2, 4


Exam: December 16, 1:30 - 4:15

The final is comprehensive; it is not limited to material that has appeared on previous quizzes. We have covered a lot of material in this course, and so the exam can only be a sampling of what was covered.
Here's a sample from a previous year. Of course yours will be different!!