SAS Assignment 4: Data Processing and Analysis - Prof. James Davenport, Assignments of Statistics

An assignment for a stat 321 class, where students are required to use sas software to read data, create temporary datasets, and perform data analysis. The assignment involves two parts: in the first part, data for ten individuals with their age, gender, and survey scores are provided, and students must decide on a method and format to enter the data. In the second part, data for several hospitals are provided, and students must create variables for idcode, dob, gender, and hospital. The document also includes instructions on how to read the date of birth using a 'date' informat and how to code gender as 1=male and 2=female. The assignment concludes with students producing the required variables and printing the data set using proc print.

Typology: Assignments

Pre 2010

Uploaded on 02/10/2009

koofers-user-n4p
koofers-user-n4p 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Stat 321 - Assignment 4
For each problem (a & b) you are to create a data step that will read the data and create a temporary
SAS data set. Use whatever input style you desire. Use informats, formats, and labels freely.
Create a printing (using PROC PRINT) of the data set's variable values making use of titles.
a. Data for ten persons are presented below. Recorded for each person is their age (in years),
gender, and survey score. Decide upon a method and format to use in entering the data.
Person 1 2 3 4 5 6 7 8 9 10
Age 26 32 21 23 27 31 29 25 23 21
Gender M M F M F F M F M F
Score 1.2 3.4 1.4 2.0 3.3 1.2 2.3 1.8 3.1 2.6
b. The data below should be entered as is.
c...:....1....:....2....:....3....:....4....:....5....:....6
JOHR0223451
Riverside Hospital
23432
ADRS1212602
Fairfax/Herndon Memorial Hospital
22411
SMIJ0130581
Colfax General Hospital
11234
In the data set above you should produce the following variables:
Variable Name Line Columns
IDCODE 1 1-11
DOB 1 5-10
GENDER 1 11
HOSPITAL 2 1-?
QUES1 3 1
QUES2 3 2
QUES3 3 3
QUES4 3 4
QUES5 3 5
Read Date of Birth with a “Date
Informat” (see documentation). The
gender data are coded as 1=Male and
2=Female – add labels.
Note: the IDCODE is the “Hogben Code”

Partial preview of the text

Download SAS Assignment 4: Data Processing and Analysis - Prof. James Davenport and more Assignments Statistics in PDF only on Docsity!

Stat 321 - Assignment 4

For each problem (a & b) you are to create a data step that will read the data and create a temporary SAS data set. Use whatever input style you desire. Use informats, formats, and labels freely. Create a printing (using PROC PRINT) of the data set's variable values making use of titles.

a. Data for ten persons are presented below. Recorded for each person is their age (in years), gender, and survey score. Decide upon a method and format to use in entering the data.

Person 1 2 3 4 5 6 7 8 9 10 Age 26 32 21 23 27 31 29 25 23 21 Gender M M F M F F M F M F Score 1.2 3.4 1.4 2.0 3.3 1.2 2.3 1.8 3.1 2.

b. The data below should be entered as is.

c...:....1....:....2....:....3....:....4....:....5....:....

JOHR Riverside Hospital 23432 ADRS Fairfax/Herndon Memorial Hospital 22411 SMIJ Colfax General Hospital 11234

In the data set above you should produce the following variables:

Variable Name Line Columns IDCODE 1 1- DOB 1 5- GENDER 1 11 HOSPITAL 2 1-? QUES1 3 1 QUES2 3 2 QUES3 3 3 QUES4 3 4 QUES5 3 5

Read Date of Birth with a “Date Informat” (see documentation). The gender data are coded as 1=Male and 2=Female – add labels.

Note: the IDCODE is the “Hogben Code”