Copyright
The correct bibliographic citation for this manual is as follows: Cody, Ron. 2011. SAS® Statistics by Example. Cary, NC: SAS Institute Inc.
SAS® Statistics by Example
Copyright © 2011, SAS Institute Inc., Cary, NC, USA
ISBN 978-1-61290-012-4 (electronic book)
ISBN 978-1-60764-800-0
All rights reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc.
For a Web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrighted materials. Your support of others’ rights is appreciated.
U.S. Government Restricted Rights Notice: Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227-19, Commercial Computer Software-Restricted Rights (June 1987).
SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513-2414
1st printing, August 2011
SAS® Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/publishing or call 1-800-727-3228.
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are registered trademarks or trademarks of their respective companies.
Contents
Chapter 1 An Introduction to SAS
Statistical Tasks Performed by SAS
Variable Types in SAS Data Sets
Temporary versus Permanent SAS Data Sets
Creating a SAS Data Set from Raw Data
Data Values Separated by Delimiters
Excel Files with Invalid SAS Variable Names
Chapter 2 Descriptive Statistics – Continuous Variables
Computing Descriptive Statistics Using PROC MEANS
Descriptive Statistics Broken Down by a Classification Variable
Computing a 95% Confidence Interval and the Standard Error
Producing Descriptive Statistics, Histograms, and Probability Plots
Changing the Midpoint Values on the Histogram
Generating a Variety of Graphical Displays of Your Data
Displaying Multiple Box Plots for Each Value of a Categorical Variable
Chapter 3 Descriptive Statistics – Categorical Variables
Introduction
Computing Frequency Counts and Percentages
Computing Frequencies on a Continuous Variable
Using Formats to Group Observations
Histograms and Bar Charts
Creating a Bar Chart Using PROC SGPLOT
Using ODS to Send Output to Alternate Destinations
Creating a Cross-Tabulation Table
Changing the Order of Values in a Frequency Table
Conclusions
Chapter 4 Descriptive Statistics – Bivariate Associations
Introduction