# Applied Statistics and the SAS Programming Language (5e)

##### Description

Suitable for use by departments ranging from statistics and Engineering to Psychology and Education when the objective of the course is to learn to use the SAS programming language to perform statistical analysis.

As the SAS© programming language continues to evolve, this new edition follows suit with up-to-date coverage of this combination statistical package, database management system, and high-level programming language. Using examples from business, medicine, education, psychology, and other disciplines,

*Applied Statistics and the SAS Programming Language*is an invaluable resource for both students and applied researchers, giving them the capacity to perform statistical analyses with SAS without wading through pages of technical documentation.

##### Table of contents

Note: All chapters open with an Introduction.

**Chapter 1: A SAS Tutorial**

Computing With SAS: An Illustrative Example.

Enhancing the Program. SAS Procedures. Overview of

the SAS DATA Step. Syntax of SAS Procedures. Comment

Statements. References.

**Chapter 2: Describing Data**

Describing Data. More Descriptive Statistics. Histograms, QQ Plots, and Probability Plots. Descriptive Statistics Broken Down by Subgroups. Frequency Distributions. Bar Graphs. Plotting Data.

** **

**Chapter 3: Analyzing Categorical Data**

Questionnaire Design and Analysis. Adding Variable Labels. Adding “Value Labels” (Formats). Recoding Data. Using a Format to Recode a Variable. Two-way Frequency Tables.

**Chapter 4: Working with Date and Longitudinal Data**

Processing Date Variables. Working with Two-digit

Year Values (The Y2K Problem. Longitudinal Data.

Selecting the First or Last Visit per Patient.

Computing Differences between Observations in a

Longitudinal Data Set. Computing the Difference

between the First and Last Observation for each

Subject. Computing Frequencies on Longitudinal Data

Sets. Creating Summary Data Sets with PROC MEANS or

PROC SUMMARY. Outputting Statistics Other Than Means.

**Chapter 5: Correlation and Simple Regression**

Correlation. Significance of a Correlation

Coefficient. How to Interpret a Correlation

Coefficient. Partial Correlations. Linear Regression.

Partitioning the Total Sum of Squares. Producing a

Scatter Plot and the Regression Line. Adding a

Quadratic Term to the Regression Equation.

Transforming Data.

** **

**Chapter 6: T-tests and Nonparametric Comparisons**

T-test: Testing Differences between Two Means. Random

Assignment of Subjects. Two Independent Samples:

Distribution Free Tests. One-tailed versus Two-tailed

Tests. Paired T-tests (Related Samples).

**Chapter 7: Analysis of Variance**

One-way Analysis of Variance. Computing Contrasts.

Analysis of Variance: Two Independent Variables.

Interpreting Significant Interactions. N-way

Factorial Designs. Unbalanced Designs: PROC GLM.

Analysis of Covariance.

**Chapter 8: Repeated Measures Designs**

One-factor Experiments. Using the REPEATED Statement

of PROC ANOVA. Using PROC MIXED to Compute a Mixed

(random effects) Model. Two-factor Experiments with a

Repeated Measure on One Factor. Two-factor

Experiments with Repeated Measures on Both Factors.

Three-factor Experiments with a Repeated Measure on

the Last Factor. Three-factor Experiments with

Repeated Measures on Two Factors.

**Chapter 9: Multiple Regression Analysis**

Designed Regression. Nonexperimental Regression.

Stepwise and Other Variable Selection Methods.

Creating and Using Dummy Variables. Using the

Variance Inflation Factor to Look for

Multicollinearity. Logistic Regression. Automatic

Creation of Dummy Variables with PROC LOGISTIC.

** **

** **

** **

** **

**Chapter 10: Factor Analysis**

Types of Factor Analysis. Principal Components

Analysis. Oblique Rotations. Using Communalities

Other Than One. How to Reverse Item Scores.

**Chapter 11: Psychometrics**

Using SAS Software to Score a Test. Generalizing the Program for a Variable Number of Questions. Creating a Better Looking Table Using PROC TABULATE. A Complete Test Scoring and Item Analysis Program. Test Reliability. Interrater Reliability.

**Chapter 12: The SAS INPUT Statement**

List Input: Data values separated by spaces.

Comma-delimited Data. Using INFORMATS with List

Input. Column Input. Pointers and Informats.

More Than One Line per Subject. Changing the Order

and Reading a Column More Than Once. Informat Lists.

“Holding the Line”–Single- and Double-trailing @’s.

Suppressing the Error Messages for Invalid Data.

Reading “Unstructured” Data.

**Chapter 13: External Files: **

Data in the Program Itself. Reading Data from An

External Text File (ASCII or EBCDIC). INFILE Options. Reading Data from Multiple Files (using wildcards). Writing ASCII or

Raw Data to An External File. Writing CSV (comma

separated variables) Files Using SAS. Creating a

Permanent SAS Data Set. Reading Permanent SAS Data

Sets. How to Determine the Contents of a SAS Data

Set. Permanent SAS Data Sets with Formats.

Working with Large Data Sets.

**Chapter 14: Data Set Subsetting, Concatenating, Merging, and Updating**

Subsetting. Combining Similar Data from Multiple SAS

Data Sets. Combining Different Data from Multiple SAS

Data Sets. “Table Look Up”. Updating a Master Data Set

from An Update Data Set.

**Chapter 15: Working with Arrays**

Substituting One Value for Another for a Series of

Variables. Extending Example 1 to Convert All Numeric

Values of 999 to Missing. Converting the Value of N/A

(Not Applicable) to a Character Missing Value.

Converting Heights and Weights from English to Metric

Units. Temporary Arrays. Using a Temporary Array to

Score a Test. Specifying Array Bounds. Temporary

Arrays and Array Bounds. Implicitly Subscripted

Arrays.

**Chapter 16: Restructuring SAS Data Sets Using Arrays**

Creating a New Data Set with Several Observations per

Subject from a Data Set with One Observation per

Subject. Another Example of Creating Multiple

Observations from a Single Observation. Going from

One Observation per Subject to Many Observations per

Subject Using Multi-dimensional Arrays. Creating a

Data Set with One Observation per Subject from a Data

Set with Multiple Observations per Subject. Creating

a Data Set with One Observation per Subject from a

Data Set with Multiple Observations per Subject Using

a Multi-dimensional Array.

**Chapter 17: A Review of SAS Functions**

Arithmetic and Mathematical Functions. Random Number

Functions. Time and Date Functions. The INPUT and PUT

Functions: Converting Numerics to Character, and

Character to Numeric Variables. The LAG and DIF

Functions.

**Chapter 18: A Review of SAS Functions**

**Part II. Character Functions**

How Lengths of Character Variables are Set in a SAS

DATA Step. Working with Blanks. How to Remove

Characters from a String. Character Data Verification

Substring Example. Using the SUBSTR Function on the Left-Hand Side of the Equals Sign. Doing the Previous Example Another Way. Unpacking a String. Parsing a String. Locating the Position of One String Within Another String. Changing Lower Case to Upper Case and Vice Versa. Substituting One Character for Another. Substituting One Word for Another in a String

Concatenating (Joining) Strings. Soundex Conversion.

Spelling Distance: The SPEDIS Function.

**Chapter 19: Selected Programming Examples**

Expressing Data Values as a Percentage of the Grand

Mean. Expressing a Value as a Percentage of a Group

Mean. Plotting Means with Error Bars. Using a Macro

Variable to Save Coding Time. Computing Relative

Frequencies. Computing Combined Frequencies on

Different Variables. Computing a Moving Average.

Sorting Within an Observation. Computing Coefficient

Alpha (or KR-20) in a DATA Step.

** **

** **

** **

** **

**Chapter 20: Syntax Examples**

PROC ANOVA. PROC APPEND. PROC CHART. PROC CONTENTS.

PROC CORR. PROC DATASETS. PROC FACTOR. PROC FORMAT.

PROC FREQ. PROC GCHART. PROC GLM. PROC GPLOT. PROC

LOGISTIC. PROC MEANS. PROC NPAR1WAY. PROC PLOT.

PROC PRINT. PROC RANK. PROC REG. PROC SORT. PROC

TTEST. PROC UNIVARIATE.

##### New to this edition

**NEW — SAS Version 9 — **The entire text is entirely up-to-date with SAS Version 9

**NEW — SAS Graph™ - **The text features the use of SAS Graph™ to replace older non-graphics procedures

** **

**NEW — Doubled the Number of Problems — **featuring half with answers in text and half with answers available to the instructor on the Prentice Hall website

** **

**NEW** — **Expanded Chapter on Longitudinal Data** - featuring new sections on Working with two-digit year values (The Y2K Problem), Computing differences between observations in a longitudinal data set, Computing the differences between the first and last observation for each subject, Creating summary data sets with PROC MEANS or PROC SUMMARY, Outputting statistics other than means

**NEW — Expanded Chapter on Multiple Regressions** — featuring new sections using the variance inflation factor to look for multicollinearity and Automatic creation of dummy variables with PROC LOGISTIC

**NEW — Expanded Chapter on Character Functions** — featuring the new SAS

Version 9 Function

##### Features & benefits

**• Comprehensive coverage of key SAS elements –** Includes the necessary SAS statements to run programs for most of the commonly used statistics, explanations of the computer output, interpretations of results, and examples of how to construct tables and write up results for reports and journal articles.

**• Logical, easy-to-follow examples –** Provide readers with ample models for developing programming skills and learning to write their own programs.

**• Highly respected authorship –** Lead author Ron Cody, a longtime professor and researcher at the Robert Wood Johnson Medical School, now acts as a private consultant and serves as a national instructor for the SAS Institute. He has authored or coauthored numerous books such as SAS Functions by Example, Cody's Data Cleaning Techniques Using SAS Software, The SAS Workbook, and The SAS Workbook: Solutions.