Preface |
|
ix | |
Author |
|
xi | |
|
Chapter 1 Basic Components of SAS |
|
|
1 | (8) |
|
|
1 | (2) |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
1.2 Organizing a Basic SAS Code File |
|
|
3 | (2) |
|
|
3 | (1) |
|
|
4 | (1) |
|
1.3 SAS Data Directory and Storage |
|
|
5 | (1) |
|
1.4 Types of SAS Variables, INFORM AT and FORMAT |
|
|
6 | (1) |
|
1.5 Good Practices for Naming SAS Files and Variables |
|
|
7 | (2) |
|
1.5.1 Naming SAS Code Files |
|
|
7 | (1) |
|
1.5.2 Naming SAS Data Variables |
|
|
8 | (1) |
|
Chapter 2 SAS in Windows Environment |
|
|
9 | (8) |
|
2.1 Running SAS in Windows Environment |
|
|
9 | (5) |
|
2.2 Understanding SAS Data Existence, Storage, and Directory Structure |
|
|
14 | (3) |
|
Chapter 3 Feeding Data to SAS |
|
|
17 | (34) |
|
3.1 Preparing Data for Analysis |
|
|
17 | (1) |
|
3.2 Types of Variables Used by SAS |
|
|
18 | (21) |
|
3.2.1 Character Variables |
|
|
18 | (5) |
|
|
23 | (8) |
|
|
31 | (5) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
3.3 Embedding Your Data with Your Code File |
|
|
39 | (2) |
|
3.4 Inputting Data from an External Data File to SAS |
|
|
41 | (3) |
|
3.4.1 Inputting Data Stored in SAS Data Format (.sas7bdat) |
|
|
42 | (1) |
|
3.4.2 Reading a Comma (,)-Separated Text File (.csv) |
|
|
42 | (1) |
|
3.4.3 Reading a Tab Key-Separated Text File (.txt or tab) |
|
|
43 | (1) |
|
3.4.4 Reading a Vertical Bar Symbol (|)-Separated Text File (.txt) |
|
|
43 | (1) |
|
3.4.5 Reading a Text Data File with Fixed Starting and Ending Column Locations and Widths |
|
|
44 | (1) |
|
3.5 Importing Data to SAS |
|
|
44 | (4) |
|
3.5.1 Importing an Excel Data File |
|
|
45 | (1) |
|
3.5.2 Importing a Comma Q-Separated Data File |
|
|
45 | (1) |
|
3.5.3 Importing a Tab-Delimited File |
|
|
46 | (1) |
|
3.5.4 Importing a Period (.)-Delimited File |
|
|
46 | (1) |
|
3.5.5 Importing a DBF File |
|
|
47 | (1) |
|
3.5.6 Importing an SPSS Data File |
|
|
47 | (1) |
|
3.5.7 Importing a STATA Data File |
|
|
48 | (1) |
|
3.6 Reading Other Less Structured Data |
|
|
48 | (2) |
|
3.7 Listing Input Variables Alternatively |
|
|
50 | (1) |
|
Chapter 4 Data Manipulation |
|
|
51 | (52) |
|
4.1 Exporting a Data File |
|
|
51 | (2) |
|
4.1.1 Exporting a SAS Data File (.sas7bdat) to a Comma-Delimited File |
|
|
51 | (1) |
|
4.1.2 Exporting a SAS Data File (.sas7bdat) to an Excel File |
|
|
52 | (1) |
|
4.2 Splitting/Subsetting a Data File |
|
|
53 | (6) |
|
4.2.1 Dividing a SAS Data File by Number of Rows |
|
|
53 | (4) |
|
4.2.2 Dividing a SAS Data File Based on Data Attributes |
|
|
57 | (2) |
|
4.3 Joining Data Files Sequentially (Vertically) |
|
|
59 | (9) |
|
4.3.1 Joining Data Files with Identical Variables (Columns) |
|
|
59 | (6) |
|
4.3.2 Joining Files Having Different Variables (Columns) |
|
|
65 | (3) |
|
4.4 Joining Files Horizontally (Left/Right) |
|
|
68 | (13) |
|
|
68 | (4) |
|
|
72 | (4) |
|
4.4.3 Tracking Source of Data when Merging by Using the "IN=" Statement |
|
|
76 | (5) |
|
4.5 Variables - Drop, Keep, and Rename |
|
|
81 | (3) |
|
4.6 Creating New Data Variables |
|
|
84 | (19) |
|
|
84 | (4) |
|
|
88 | (2) |
|
4.6.3 If-Then, If-Then-Else, and Where |
|
|
90 | (2) |
|
4.6.4 Concatenation - CAT, CATS, CATT, and CATX |
|
|
92 | (3) |
|
4.6.5 Substring (Substr) and Length |
|
|
95 | (4) |
|
4.6.6 ANY Functions - Locating the Starting Point of a Substring |
|
|
99 | (4) |
|
Chapter 5 Basic Data Analysis |
|
|
103 | (56) |
|
5.1 Using the by Statement to Group and Sort Data |
|
|
103 | (3) |
|
5.2 Understanding FIRST.variable and LAST.variable |
|
|
106 | (3) |
|
5.3 Removing Duplicate Records (Rows) |
|
|
109 | (7) |
|
5.3.1 Repeated (Identical) Rows - NODUP |
|
|
109 | (2) |
|
5.3.2 Customized Duplicate Criteria - NODUPKEY |
|
|
111 | (2) |
|
5.3.3 Using FIRST.var and LAST.var for Duplicate Identification |
|
|
113 | (3) |
|
5.4 Using FIRST.variable and LAST.variable to Count and Quantify |
|
|
116 | (5) |
|
5.5 Using PROC SQL for Subtotals and Percentages |
|
|
121 | (25) |
|
5.6 Computing Moving Average by Using LAG and LAGn |
|
|
146 | (2) |
|
5.7 Producing Total for Each BY-group Variable |
|
|
148 | (4) |
|
5.8 Retaining Previous Values and Sum with Original Data |
|
|
152 | (3) |
|
5.9 Collapsing Observations with New Output Data |
|
|
155 | (4) |
|
Chapter 6 Common Statistical Procedures |
|
|
159 | (52) |
|
6.1 p Value and Alpha Level |
|
|
159 | (2) |
|
|
159 | (1) |
|
6.1.2 p Value Interpretation |
|
|
160 | (1) |
|
|
161 | (1) |
|
6.2 Data Distribution and Descriptive Statistics - PROC Univariate |
|
|
161 | (8) |
|
6.3 Mean and Descriptive Statistics - PROC MEANS |
|
|
169 | (6) |
|
6.4 Determining the Difference between Two Means: PROC TTEST |
|
|
175 | (10) |
|
6.5 Correlation Determination - PROC CORR |
|
|
185 | (4) |
|
6.6 Regression Analysis - PROC REG |
|
|
189 | (9) |
|
6.7 Performing the General Linear Modeling - PROC GLM |
|
|
198 | (6) |
|
6.8 Analysis of Variance - PROC ANOVA |
|
|
204 | (7) |
|
|
211 | (48) |
|
|
211 | (5) |
|
7.1.1 Title, Footnote, and Note |
|
|
212 | (1) |
|
|
212 | (2) |
|
|
214 | (1) |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
216 | (23) |
|
|
239 | (20) |
|
Chapter 8 ODS, Title, and Footnotes |
|
|
259 | (16) |
|
8.1 Output Delivery System (ODS) |
|
|
259 | (11) |
|
|
270 | (5) |
|
Chapter 9 Behind the Scenes Logic on Data Reading |
|
|
275 | (4) |
Index |
|
279 | |