Muutke küpsiste eelistusi

SAS® Coding Primer and Reference Guide [Kõva köide]

  • Formaat: Hardback, 296 pages, kõrgus x laius: 254x178 mm, kaal: 453 g, 3 Tables, black and white; 200 Illustrations, black and white
  • Ilmumisaeg: 30-Sep-2020
  • Kirjastus: CRC Press
  • ISBN-10: 0367537052
  • ISBN-13: 9780367537050
Teised raamatud teemal:
  • Formaat: Hardback, 296 pages, kõrgus x laius: 254x178 mm, kaal: 453 g, 3 Tables, black and white; 200 Illustrations, black and white
  • Ilmumisaeg: 30-Sep-2020
  • Kirjastus: CRC Press
  • ISBN-10: 0367537052
  • ISBN-13: 9780367537050
Teised raamatud teemal:
Although the web and online SAS® communities can provide volumes of information for programmers, these resources are often overwhelming and lack a simple path to guide coding SAS. This reference, however, does provide such a path from a data users standpoint vs. seeing things as a code writer. Written by an experienced SAS programmer, this book lets SAS coders easily find explanations and clarification to typical programming problems. This book presents practical real-world data analysis steps encountered by analysts in the field. These steps include the following:











Getting to know raw data





Understanding variables





Getting data into SAS





Creating new data variables





Performing data manipulations, including sorting, ranking, grouping, subtotal, total, and percentage





Statistical testing under a broad range of logical and conditional settings





Data visualization

Throughout this book, statements and codes are accompanied by thorough annotation. Line-by-line explanations ensure that all terms are clearly explained. Code examples and sample codes have broad usages. All the examples are related to highway transportation where the use of big data is exploding and presenting new challenges and opportunities for growth.

Clear and precise practical introductory material on statistics is integrated into the relevant SAS procedures to bolster users confidence in applying such methods to their own work.

Comprehensive and foundational coverage, systematic introduction of programming topics, thoroughly annotated code examples, and real-world code samples combine to make SAS® Coding Primer and Reference Guide an indispensable reference for beginners and experienced programmers.
Preface ix
Author xi
Chapter 1 Basic Components of SAS
1(8)
1.1 SAS Files
1(2)
1.1.1 SAS Code File
1(1)
1.1.2 Data Input File
2(1)
1.1.3 SAS Log File
2(1)
1.1.4 SAS Output File
2(1)
1.2 Organizing a Basic SAS Code File
3(2)
1.2.1 Syntax
3(1)
1.2.2 Basic SAS Grammar
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)
3.2.2 Numeric Data
23(8)
3.2.3 Date/Time/Datetime
31(5)
3.2.4 Missing Value
36(1)
3.2.5 SAS Date
37(1)
3.2.6 Summary
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)
4.4.1 One-to-One Merge
68(4)
4.4.2 One-to-Many Join
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)
4.6.1 Simple Assignment
84(4)
4.6.2 SAS Functions
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)
6.1.1 p Value
159(1)
6.1.2 p Value Interpretation
160(1)
6.1.3 Alpha Level
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)
Chapter 7 Visualization
211(48)
7.1 Overview
211(5)
7.1.1 Title, Footnote, and Note
212(1)
7.1.2 Axis
212(2)
7.1.3 Legend
214(1)
7.1.4 Pattern
215(1)
7.1.5 GOPTIONS
216(1)
7.2 PROCGPLOT
216(23)
7.3 PROC GCHART
239(20)
Chapter 8 ODS, Title, and Footnotes
259(16)
8.1 Output Delivery System (ODS)
259(11)
8.2 Title and Footnote
270(5)
Chapter 9 Behind the Scenes Logic on Data Reading
275(4)
Index 279
Connie Tang is a graduate of New York University, Abu Dhabi with a BA in Economics. She also holds a masters degree in Applied Economics from the University of Maryland. She has learned and utilized SAS in her private consulting after graduating from NYU in 2014. Since then, she has provided technical assistance to a wide range of activities and programs related to data including her near three years of service as an on-site consultant to the Office of the Secretary, the U.S. Department of Transportation. Currently, Connie Tang is the Research and Outreach Coordinator at the Maryland Transportation Institute, University of Maryland, where she supports and leads a broad range of research and development activities.