STAT 475
HOMEWORK 4 SOLUTION
Exercises for Handout 19:
Quiz for Chapter 21 in the textbook: Questions 1-10.
1. A. This is an INCORRECT answer as other answers are also true about @.
B. This is an INCORRECT answer as other answers are also true about @.
C.
STAT 475
HOMEWORK 4 (due Monday, November 7)
Exercises for Handout 13 material: Explain the reason for selecting the correct answer, as well as
the reason for NOT selecting EACH of the wrong answers.
Quiz for Chapter 15 in the textbook: Questions 1 10.
A0
STAT 475
TAKE-HOME MIDTERM EXAM SOLUTION
Exercises for Handout 9 material:
Quiz for Chapter 8 in the textbook
Q1: Answer is A. The group option is used to get total values which are computed for all numeric variables for
different values of group variable
STAT 475
TAKE-HOME FINAL EXAM
(Due on Friday, December 16 by 9pm to my gmail account)
Exercises for Handout 26 material: Explain the reason for selecting the correct answer, as well as
the reason for NOT selecting EACH of the wrong answers.
Quiz for Chapt
STAT 475
HOMEWORK 1 (due Monday, September 19)
Exercises for Handout 1 material:
Exercise 1. Read the data stored in file NBA.xls into SAS by
(a) entering data directly into SAS code,
(b) referencing a SAS data file stored on external drive,
(c) importing
STAT 475
Chapter 8 MANAGING PROCESSING USING PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
There are several options that may be specified in the PROC SQL statement:
INOBS= that restricts the number of input rows that PRO
STAT 475
Chapter 5 CREATING AND MANAGING TABLES USING
PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
There are three methods to create a new table with PROC SQL:
Creating a table from a query result
Creating an empty tab
STAT 475
Chapter 4
COMBINING TABLES VERTICALLY
USING PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
PROC SQL may be used to select data from multiple tables and to combine the
tables vertically (that is, pasting one after
STAT 475
Chapter 3
COMBINING TABLES HORIZONTALLY
USING PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
A join in PROC SQL is a query that combines tables horizontally (that is, side by
side) by combining rows. There are two
STAT 475
INTRODUCTION TO SAS MACRO LANGUAGE
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
The SAS macro language is generally used to shorten SAS codes.
Macro language is composed of macro variables, macro functions and macro
prog
STAT 475
HOMEWORK 2 (due Monday, October 3)
Exercises for Handout 5 material: Explain the reason for selecting the correct answer, as well as
the reason for NOT selecting EACH of the wrong answers.
Quiz for Chapter 2 in the textbook: Questions 3 and 8.
Qu
STAT 475
HOMEWORK 5 (due Monday, December 5)
Exercises for Handout 23 material: Explain the reason for selecting the correct answer, as well as
the reason for NOT selecting EACH of the wrong answers.
Quiz for Chapter 3 in the advanced programming certific
STAT 475
HOMEWORK 5 SOLUTION
Chapter 3 Quiz
Question 1
A is the correct answer. A Cartesian product is constructed when join conditions are not
specified in a PROC SQL join. In this case, every row from the first table is combined with each
row from the s
STAT 475: Data Analysis with SAS
Spring 08: Final exam
NOTE: Example format for your answer code.
/*
STAT 475 Final Exam
YOUR NAME (YOUR ID)
*/
* PROBLEM #1 *;
YOUR SAS CODE HERE;
* OUTPUT *;
/*
PUT YOUR OUTPUT HERE (copy and paste from output window)
*/
STAT 475 : Data Analysis with SAS, Note 1
Sung E. Kim, California State University-Long Beach, Dept of Math and Statistics_
NOTE #1: DATA STEP: Basic
Syntax Basic:
DATA yourdataname;
< statements >
RUN;
Note:
a. SAS is not case sensitive
b. A data name mu
STAT 475 Data Analysis with SAS
ASSIGNMENT #2
NOTE: You need to show you programs and your output. Be sure to use proper SAS syntax.
Try not to waste paper. Use good variable names, data names etc. Be sure to include headers and
comments.
1) Suppose you w
STAT 475 : Data Analysis with SAS, Note 8
Sung E. Kim, California State University-Long Beach, Dept of Math and Statistics_
1
NOTE #8: SAS/IML
SAS/IML (Interactive Matrix Language) is flexible and powerful programming language that
operates on one or two
STAT 475 Data Analysis with SAS
Midterm I
Name_
1. Fill in the blanks
(a) Assume that we used the following Data step to calculate the value of
the account for 20 years if you deposit $5000 each year with a constant
interest rate of 5%. If theres any erro
STAT 475
Chapter 2
PERFORMING ADVANCED QUERIES
USING PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
To display all columns in the order in which they are stored in a table, use an
asterisk (*) in the SELECT statement.
Exa
STAT 475
Chapter 1
PERFORMING QUERIES USING PROC SQL
Reference
SAS Certification Prep Guide: Advanced Programming for SAS 9
PROC SQL step provides an efficient way to retrieve information from data sets. The
abbreviation SQL stands for Structured Query La
STAT 475
Chapter 21
CREATING MULTIPLE OBSERVATIONS
FROM A SINGLE RECORD
Sometimes multiple records appear on the same line. It reduces the size of the
entire data file.
READING REPEATING BLOCKS OF DATA
If each line contains values of the same variables fo
STAT 475
Chapters 1-2 BASIC CONCEPTS AND DEFINITIONS
There are two basic steps in every SAS program: a DATA step and a PROC
(procedure) step. A DATA step begins with the keyword DATA. A PROC step
begins with the keyword PROC. Each step consists of stateme
STAT 475
Chapters 5, 17 CREATING SAS DATA SETS: Advanced Options
There are several important options that may be used when creating a data set.
(1) When data are inputted in columns (called column input), then in INPUT
statement, besides variable names an
STAT 475
Chapters 7, 17 SAS INFORMATS AND FORMATS
SAS INFORMATS
Informats are used to read data from external files, assigning permanent formats
to variables. Typically, SAS informats are grouped into three categories: numeric,
character, and date/time. F
STAT 475
Chapters 2, 19 WORKING WITH DATES AND TIMES
HOW SAS STORES DATE AND TIME VALUES
When SAS reads a date, it converts it into the number of days from January
1, 1960. For example, January 5, 1960 SAS stores as number 4; December
16, 1989 as 10945; J
STAT 475
Chapters 2, 4 MODIFYING DEFAULT SAS OUTPUT
A default SAS output contains
a title The SAS System,
a header with date, time, and page number,
a column Obs with observation numbers.
Example. Consider the following SAS code.
data exercise;
input ID $
STAT 475
Chapters 4, 10 CREATING LIST REPORTS
By default, SAS produces a traditional listing output. A more presentable style of
SAS output is HyperText Markup Language (HTML) output.
Traditional Listing Output
ID
Age
Act
Level
Sex
HTML Output
ID
Age ActL
STAT 475
Chapter 1.
Chapters 1, 2, 5, and 7 MISCELLANEOUS
DESCRIPTOR AND DATA PORTIONS OF SAS DATA FILES
Conceptually, a SAS data set is a file that consists of two parts: a descriptor
portion and a data portion.
The descriptor portion of a SAS data set c
STAT 475
Chapter 8 CREATING ENHANCED LIST AND
SUMMARY REPORTS
A more sophisticated way to produce a listing of the report is to use PROC
REPORT. The syntax is
proc report data=dataname
<column statement>;
<where statement>;
<define statement>;
run;
<optio
STAT 475
Chapter 9 PRODUCING DESCRIPTIVE STATISTICS
To summarize descriptive statistics for numeric variables, use PROC MEANS.
By default, this procedure computes the n-count (the number of non-missing
values), mean, standard deviation, minimum and maximu