
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 1
This page cannot be seen from the preview
Don't miss anything!

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”