SAS Programming for Elementary Statistics
eBook - ePub

SAS Programming for Elementary Statistics

Getting Started

Carla L. Goad

Share book
  1. 328 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

SAS Programming for Elementary Statistics

Getting Started

Carla L. Goad

Book details
Book preview
Table of contents
Citations

About This Book

SAS for Elementary Statistics: Getting Started provides an introduction to SAS programming for those who have experience with introductory statistical methods. It is also an excellent programming supplement for an introductory statistics course. It is appropriate for the beginning programmer with no prior SAS experience and the researcher who would like to refresh SAS programming skills. These lessons are those the author has found successful in the classroom. Strengths of this book include the following:



  • Examples are easy to follow and understand.


  • Chapters have user-friendly text and objectives.


  • Each chapter has clear objectives with SAS syntax and output results given.


  • Objectives are stated as tasks with detailed step-by-step instructions.


  • Programming notes based on the author's experience occur throughout the book.


  • The author assists the reader in making sense of the error messages in the SAS log.


  • Brief reviews of statistical methods are included in chapters accompanying the corresponding SAS procedures.


  • Easy transition from user terminology to SAS terminology is provided.


  • The ability to select or suppress results using Output Delivery System (ODS) is made simple.


  • Reading and writing to external files are among the most used SAS skills, and these concepts are clearly presented. The IMPORT and EXPORT procedures and ODS are used to accomplish these tasks.


  • Statistical Graphics procedures and SAS/GRAPH can be quite challenging to learn, but these are presented in a very achievable format. Basic graph construction is first introduced then readers learn how to add color, pattern, and other enhancements to graphics images.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is SAS Programming for Elementary Statistics an online PDF/ePUB?
Yes, you can access SAS Programming for Elementary Statistics by Carla L. Goad in PDF and/or ePUB format, as well as other popular books in Volkswirtschaftslehre & Statistik für Volks- & Betriebswirtschaft. We have over one million books available in our catalogue for you to explore.

Information

1

Introduction to SAS Programming Environment

SAS is a statistical analysis software that has international recognition. SAS Institute has products for which users must write programming syntax, and other products which are point-and-click driven. In this book, SAS 9.4 is used to demonstrate data set management skills and introductory statistical methods primarily using programming code. Many of the topics included in this book are included in the Base SAS Certification exam.
Since SAS is a Windows compatible product, it is assumed that the reader knows how to use a mouse at the computer. There is a difference between using the left and right mouse buttons. Most of the “clicking” will be with the left mouse button. Additionally, items on the SAS screen that programmers should select appear in boldface in this book, or an image may be given to assist in identifying what item(s) should be selected for the task at hand. For example, File – Save As identifies that “File” should be selected from the pull-down menu at the top of the SAS screen and “Save As” as the selection from the resulting pull-down menu, and
identifies a Help button near the top center of the SAS screen.
The chapters of this book may briefly review statistical methods and then state particular objectives followed by the SAS programming code to achieve the stated objectives. Programming options and output results will be overviewed in these objectives. These exercises are intended to demonstrate some of the capabilities of the current SAS topic. The only objectives of this chapter are to show some very basic steps to assist in initiating a SAS session, editing and executing a SAS program, printing the results, and storing program and results files. Remaining chapters in this book address particular objectives in statistical analysis or data management and instruct the reader how to program SAS to achieve a particular goal.

1.1 Initiating a SAS Session

From the list of programs or applications on a computer, the SAS folder is located and from that folder SAS 9.4 (English) is selected.
See Figure 1.1. Each SAS installation may produce a slightly different list of SAS software products than those listed in Figure 1.1, but the current version of SAS should be selected. Selecting other options, such as, Enterprise Guide or Enterprise Miner should not be selected. These are other SAS software products not addressed in this book.
Figure 1.1
Figure 1.1
An example of SAS software products available in a listing of SAS folder contents (Microsoft Windows 10 operating system).
When SAS 9.4 (English) opens, a dialog box opens “in front of” the SAS programming environment. See Figure 1.2. Changes in SAS software are communicated in this dialog. For a first time SAS user, the Output Changes likely would not yet be meaningful. There is also a tutorial “Getting Started with SAS” one can select. For now, Close this dialog box.
Figure 1.2
Figure 1.2
Initial dialog window that appears when SAS 9.4 opens.
When SAS first starts, there are five windows open. They are: Results, Explorer, Output – (Untitled), Log – (Untitled), and Editor – Untitled1 windows. In Figure 1.3 note the window tabs or bars for each of these appear at the bottom of the SAS screen. At the top of the SAS screen there is a toolbar with buttons for quick actions such as Cut, Copy, Paste, etc. The blank in the upper left-hand corner of the screen is called the Command Line where SAS commands can be entered. The Command Line was utilized exclusively in older versions of SAS. The Command Line is still available in the current version though most current programmers prefer not to use it. SAS commands are generally accomplished using point-and-click actions or function keys, but a few SAS commands for the Command Line will be given in this book.
Figure 1.3
Figure 1.3
Appearance of the SAS Editor environment upon starting the SAS session.
In the initial Log window the version of SAS software and maintenance release (TS#M#) information are given. The holder of the SAS site license and site license number have been obscured or blurred in this screen capture (Figure 1.3). Another way this pertinent license information can be accessed is by selecting Help – About SAS 9 at the top of the SAS screen. Should SAS Technical Support need to be contacted with questions, the SAS user will be asked for site license information and other information found in this initial Log window or in the information window resulting from the Help – About SAS 9 selection.
Below the initial Log window is the Editor window. Data and program statements for analyzing data are written in the Editor. Hidden “behind” the Log and Editor windows is the Output window. This window is one of the locations where the results from a SAS program can be displayed. To the left of these three windows are the Results and Explorer windows. More information about these two windows will be given later.
Moving from window to window in SAS can be in any of the following ways:
  1. The Window pull-down menu at the top of the screen lists the available window environments in SAS. The computer mouse is used to select the name of the window to which to move. Window arrangement options for the Editor, Log, and Output windows are also given in this menu. Some programmers have an organizational preference for the windows in SAS.
  2. Depending on the manner in which the windows are arranged, moving from window to window can be done by clicking on any exposed part of the window to be viewed.
  3. At the bottom of the SAS screen there are window tabs or bars that can be selected by clicking on them to move to the desired window. The View pull-down menu also lists the available windows that can be viewed. On the View pull-down menu, the icon for the Enhanced Editor has a blue plus sign superimposed over a notepad
    . Though the View menu identifies the “Enhanced Editor” it is the same as the initial “Editor” window that opened. A notepad without the blue plus sign is the icon for the Program Editor used in other platforms and in older versions of SAS. Some current platforms may not open the Enhanced Editor but will instead open the Program Editor. Using the View – Enhanced Editor sequence, a new Editor window opens. If it does not, examine the log window. If, for some reason, the Enhanced Editor is not available the following error message will be displayed in the log window: ERROR: The Enhanced Editor Control is not installed. If this is the case, the programming steps can still be taken with the Program Editor. There is more on the Program Editor in Section 1.4.
  4. Some of the function keys on the keyboard also move from window to window. To find out what the function keys do, from the Tools pull-down menu at the top of the SAS screen, Options and then Keys are selected to obtain the definitions of the function keys, that is, Tools – Options – Keys. For example, F6 with Definition “log” will move to the Log window from any of the other windows. Close the Keys window by clicking on the X in upper right-hand corner of the Keys window.
The window size can be changed using familiar point-and-click actions used in other programs.
  1. Maximize any window by clicking on the large screen button in the upper right-hand corner of the window. When clicking on the icon in the upper left-hand corner of a window, a menu is given. One of the options available is Maximize.
  2. A window can be returned to its original size by clicking on the button in the upper right-hand corner of the window that shows two window sizes. Or, from the menu obtained by clicking on the icon in the upper left-hand corner of the menu, Restore can be selected.
  3. Minimize a window either on the menu (upper left corner) or by clicking _ (underscore) button in the upper right-hand corner of the window. When minimized, the window no longer appears on the screen. The window bar at the bottom of the SAS screen can be selected, or the correct function key can be used to restore that window.
  4. Should any of the windows be closed, they can be reopened using the View pull-down menu and selecting the window to reopen.

1.2 Entering and Executing a SAS Program

Presently, these instructions will introduce SAS Editor. The Editor is also referred to as the Enhanced Editor in the View menu and in online SAS documentation. The (Enhanced) Editor and the Program Editor both allow data or programming statements to be entered. Moving the cursor in either editor can be done by clicking on the new location or using the directional arrow keys on the keyboard. Page Up and Page Down keys function in each of the windows in SAS as in other software.
The Program Editor is the editor utilized by all current SAS platforms and in older versions of SAS. For the Window...

Table of contents