Statistical Programming in SAS
Home > Computing and Information Technology > Business applications > Mathematical and statistical software > Statistical Programming in SAS
Statistical Programming in SAS

Statistical Programming in SAS

|
     0     
5
4
3
2
1




Out of Stock


Notify me when this book is in stock
About the Book

Statistical Programming in SAS Second Edition provides a foundation for programming to implement statistical solutions using SAS, a system that has been used to solve data analytic problems for more than 40 years. The author includes motivating examples to inspire readers to generate programming solutions. Upper-level undergraduates, beginning graduate students, and professionals involved in generating programming solutions for data-analytic problems will benefit from this book. The ideal background for a reader is some background in regression modeling and introductory experience with computer programming. The coverage of statistical programming in the second edition includes Getting data into the SAS system, engineering new features, and formatting variables Writing readable and well-documented code Structuring, implementing, and debugging programs that are well documented Creating solutions to novel problems Combining data sources, extracting parts of data sets, and reshaping data sets as needed for other analyses Generating general solutions using macros Customizing output Producing insight-inspiring data visualizations Parsing, processing, and analyzing text Programming solutions using matrices and connecting to R Processing text Programming with matrices Connecting SAS with R Covering topics that are part of both base and certification exams.

Table of Contents:
Contents Preface ..............................................................................................................................................ix Acknowledgments ...................................................................................................................... xiii Author .............................................................................................................................................xv 1. Structuring, Implementing, and Debugging Programs to Learn about Data ...........1 1.1 Statistical Programming ................................................................................................1 1.2 Learning from Constructed, Artificial Data ...............................................................2 Processing a Particular Data Set—Extracting Variable Names from a Column of an Input Data Set.........................................................................................2 Learning More about Unfamiliar Statistical Methods—Linear Mixed Effects Models .................................................................................................................5 Improving Your Intuition about Statistical Theory— Sampling Distribution of Means ...........................................................................................................................8 1.3 Good Programming Practice ...................................................................................... 11 Document Your Programs! .......................................................................................... 11 Use Meaningful Variable Names ................................................................................ 13 Use a Variety of CaSeS in Program Statements ........................................................ 14 Indent Program Statements That Naturally Go Together ....................................... 14 1.4 SAS Program Structure ................................................................................................ 15 1.5 What Is a SAS Data Set? ............................................................................................... 21 1.6 Internally Documenting SAS Programs ....................................................................22 1.7 Basic Debugging ...........................................................................................................23 1.8 Getting Help ..................................................................................................................27 Using Help in SAS ........................................................................................................27 Getting Help from a Web Browser Search .................................................................29 1.9 Exercises .........................................................................................................................29 2. Reading, Creating, and Formatting Data Sets ................................................................ 31 2.1 What Does a SAS DATA Step Do? .............................................................................. 31 2.2 Reading Data from External Files ..............................................................................33 Reading Data Directly as Part of a Program—Anyone for Datalines? .................34 Reading Data Sets Saved as Text—INFILE Can Be Your Friend (PROC IMPORT Too!) ................................................................................................................38 Sometimes, Variables Are in Particular Columns or in Particular Formats .........40 2.3 Reading CSV, Excel, and TEXT Files .......................................................................... 41 2.4 Temporary versus Permanent Status of Data Sets ...................................................43 2.5 Formatting and Labeling Variables ............................................................................46 Using Formats to Read and Display Variable Values ..............................................46 Internal Representations and Output Displays ........................................................49 Character, Numeric, Time, and Date Formats ..........................................................53 2.6 User-Defined Formatting .............................................................................................58 Saving Formats for Later Use ......................................................................................63 2.7 Recoding and Transforming Variables in a DATA Step ........................................66 Indicator Variables ......................................................................................................68 2.8 Writing Out a File or Making a Simple Report ......................................................73 Simple Report Generation .........................................................................................73 Exporting a File ...........................................................................................................77 2.9 Exercises .......................................................................................................................80 3. Programming a DATA Step ................................................................................................83 3.1 Writing Programs by Subdividing Tasks ................................................................83 Estimate the Probability That a Randomly Selected 30- to 39-Year-Old Male Is Taller than a Randomly Selected Female of the Same Age .....................83 Conditional Execution ...........................................................................................84 Looping to Repeat a Task ......................................................................................86 Returning to the Height Probability Simulation ............................................... 87 3.2 Ordering How Tasks Are Done ................................................................................90 Missing Data in Functions .........................................................................................92 3.3 Indexable Lists of Variables (Also Known as Arrays) ...........................................93 Defining Values in the Variable List .........................................................................93 Inputting Values in the Variable List ........................................................................94 Reassign Missing Value Codes for Numeric Variables “.” ...................................95 Recoding Missing Values for All Numeric and Character Variables ..................95 3.4 Functions Associated with Statistical Distributions .............................................96 3.5 Generating Variables Using Random Number Generators ................................ 102 3.6 Remembering Variable Values across Observations ........................................... 105 Processing Multiple Observations for a Single Observation .............................. 106 3.7 Case Study 1: Is the Two-Sample t-Test Robust to Violations of the Heterogeneous Variance Assumption? ................................................................. 109 Case Study 1 (Revisited with DATA Step Programming) .................................. 118 3.8 Efficiency Considerations—How Long Does It Take? .........................................122 3.9 Case Study 2: Monte Carlo Integration to Estimate an Integral ........................ 123 3.10 Case Study 3: Simple Percentile-Based Bootstrap ................................................ 128 3.11 Case Study 4: Randomization Test for the Equality of Two Populations ......... 130 3.12 Exercises ..................................................................................................................... 134 4. Combining, Extracting, and Reshaping Data ............................................................... 137 4.1 Adding Observations by SET-ing Data Sets.......................................................... 137 4.2 Adding Variables by MERGE-ing Data Sets ......................................................... 140 4.3 Working with Tables in PROC SQL ....................................................................... 148 4.4 Converting Wide to Long Formats ......................................................................... 161 4.5 Converting Long to Wide Formats ......................................................................... 164 4.6 Case Study: Reshaping a World Bank Data Set .................................................... 166 4.7 Building Training and Validation Data Sets ......................................................... 175 4.8 Exercises ..................................................................................................................... 179 4.9 Self-study Lab ............................................................................................................ 180 5. Macro Programming .......................................................................................................... 191 5.1 What Is a Macro and Why Would You Use It? ..................................................... 191 5.2 Motivation for Macros: Numerical Integration to Determine P(0 < Z < 1.645) ......................................................................................................... 191 5.3 Processing Macros .................................................................................................... 195 5.4 Macro Variables, Parameters, and Functions........................................................ 195 5.5 Conditional Execution, Looping, and Macros ...................................................... 198 More Complicated Macro Variable Construction ................................................203 Changing Locations in a Macro during Execution ..............................................204 5.6 Debugging Macro Code and Programs.................................................................206 Write Out Values of Macro Variables .....................................................................206 Useful SAS Options for Debugging Macros ......................................................... 207 5.7 Saving Macros ........................................................................................................... 211 5.8 Functions and Routines for Macros ....................................................................... 211 5.9 Case Study: Macro for Constructing Training and Test Data Set for Model Comparison ............................................................................................................... 216 5.10 Case Study: Processing Multiple Data Sets ...........................................................223 5.11 Exercises .....................................................................................................................227 6. Customizing Output and Generating Data Visualizations .......................................229 6.1 Using the Output Delivery System ........................................................................229 Basic Ideas ..................................................................................................................229 Destinations—RTF, HTML, PDF, and More! .........................................................230 What’s Produced and How to Select It ..................................................................235 Another Destination That Stat Programmers Should Visit—OUTPUT ............ 243 6.2 Graphics in SAS ......................................................................................................... 249 6.3 ODS Statistical Graphics ..........................................................................................250 6.4 Modifying Graphics Using the ODS Graphics Editor ......................................... 257 6.5 Graphing with Styles and Templates .....................................................................260 6.6 Statistical Graphics—Entering the Land of SG Procedures ............................... 266 SGPLOT ...................................................................................................................... 266 SGPANEL ................................................................................................................... 269 SGSCATTER .............................................................................................................. 271 6.7 Case Study: Using the SG Procedures ................................................................... 273 6.8 Enhancing SG Displays—Options with SG Procedure Statements .................. 279 6.9 Using Annotate Data Sets to Enhance SG Displays ............................................284 6.10 Using Attribute Maps to Enhance SG Displays ................................................... 287 6.11 Exercises .....................................................................................................................290 7. Processing Text .................................................................................................................... 293 7.1 Cleaning and Processing Text Data ....................................................................... 293 7.2 Starting with Character Functions ......................................................................... 293 7.3 Processing Text .......................................................................................................... 298 7.4 Case Study: Sentiment in State of the Union Addresses .....................................302 7.5 Case Study: Reading Text from a Web Page .........................................................309 7.6 Regular Expressions ................................................................................................. 315 7.7 Case Study (Revisited)—Applying Regular Expressions ................................... 319 7.8 Exercises ..................................................................................................................... 321 8. Programming with Matrices and Vectors ..................................................................... 323 8.1 Defining a Matrix and Subscripting ...................................................................... 323 8.2 Using Diagonal Matrices and Stacking Matrices ................................................. 329 8.3 Using Elementwise Operations, Repeating, and Multiplying Matrices ........... 332 8.4 Importing a Data Set into SAS/IML and Exporting Matrices from SAS/IML to a Data Set .............................................................................................333 Creating Matrices from SAS Data Sets and Vice Versa ........................................333 8.5 Case Study 1: Monte Carlo Integration to Estimate π ..........................................336 8.6 Case Study 2: Bisection Root Finder ...................................................................... 337 8.7 Case Study 3: Randomization Test Using Matrices Imported from PROC PLAN ..........................................................................................................................340 8.8 Case Study 4: SAS/IML Module to Implement Monte Carlo Integration to Estimate π ..............................................................................................................342 8.9 Storing and Loading SAS/IML Modules ..............................................................344 8.10 SAS/IML and R .........................................................................................................345 8.11 Exercises .....................................................................................................................350 References ...................................................................................................................................355 Index ............................................................................................................................................. 357


Best Sellers


Product Details
  • ISBN-13: 9781000735420
  • Publisher: Taylor & Francis Ltd
  • Publisher Imprint: Chapman & Hall/CRC
  • Language: English
  • ISBN-10: 1000735427
  • Publisher Date: 28 Jan 2020
  • Binding: Digital (delivered electronically)


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Statistical Programming in SAS
Taylor & Francis Ltd -
Statistical Programming in SAS
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Statistical Programming in SAS

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!