Exam Questions and CORRECT Answers
Statistical Analysis with SAS - CORRECT ANSWER - -input Data
-Refine data
-Statistical Analysis
-Generate output
SAS first released - CORRECT ANSWER - 1971
SAS developed - CORRECT ANSWER - NC State University
SAS stands for: - CORRECT ANSWER - Statistical Analysis System
5 Main Windows of SAS: - CORRECT ANSWER - -Editor window
-Log Window
-Output/results Viewer
-Results Window
-Explorer Window
Editor window: - CORRECT ANSWER - Used to edit, execute and save SAS programs
Log Window: - CORRECT ANSWER - Displays status messages created when SAS
executes (runs a program)
Output/results Viewer: - CORRECT ANSWER - -Displays the results of he SAS
procedures
-output window: results as a text listing
,-results viewer: results in HTML or PDF format
-Output is directed to HTML results viewer by default
Results window: - CORRECT ANSWER - provides bookmarks to each section of SAS
output
Explorer window: - CORRECT ANSWER - allows you to navigate to libraries, datasets
and other SAS objects
Opening and saving files: - CORRECT ANSWER - • FileTypes
- .sas (a SAS program, i.e., executable statements)
- .log (contents of the Log window)
- .lst (contents of the Output window)
Command line - CORRECT ANSWER - - Allows execution of program commands
(Submit, Recall, Include)
Context-sensitive Help - CORRECT ANSWER - Highlight a keyword and press F1
Each statement starts with a keyword - CORRECT ANSWER - proc, var, options, input
....and always end in a semicolon (;)
Comment lines start with an asterisk ___
Create multiple-line comments using ____ - CORRECT ANSWER - ("*"), /* and */
Two Parts of a SAS Program - CORRECT ANSWER - Data Step
Proc Step
Data Step - CORRECT ANSWER - -read in a data file
,- assign variable names, label and formats
- select specific observations
Proc Step - CORRECT ANSWER - - perform "Utility" operations on a data set (like Print
or Sort)
- analyze data
- output results or reports
SAS Libraries - CORRECT ANSWER - - A reference or nickname for storing SAS files
- Points to a location on a disk drive
- You assign most library names, except: SASUSER - permanent library; WORK - temporary
library
-Library reference (libref) must be: 8 characters or less
- Start with a letter or underscore
libname command Ex: - CORRECT ANSWER - libname data1 "X:\PSTAT 130\airlines
one";
SAS Datasets - CORRECT ANSWER - - Data are stored in SAS format
- Each dataset has a:
Descriptor portion - information about the overall dataset;
Variable attributes - information about each variable (name & label, type, length, position, label,
informat, format)
- SAS datasets can be read by SAS but not most other programs
How to get Data into SAS - CORRECT ANSWER - Data Sources:
1. Data entry using SAS Table Editor
2. Include raw data within SAS Program ("datalines")
3. Read in raw data from an external file ("infile")
, 4. Import data from another software product (e.g. Excel)
5. Read in a pre-existing SAS dataset (permanent or created within the program)
proc print ex: (3) - CORRECT ANSWER - - Simple Version:
proc print;
run;
- With Data File:
proc print data=data1.empdata;
run;
- With Variable Selection
proc print data=data1.empdata;
var JobCode EmpID Salary;
run;
PROC PRINT Default Output: - CORRECT ANSWER - - Use variable names as column
headings
- Display all variables contained in data set
- Display all observations contained in data set
- Display variable values in their "native" format
title and footnote ex: - CORRECT ANSWER - - title1 'PSTAT 130 Homework #1';
- footnote2 'Confidential';