Question: Hello, please help with this SAS coding assignment. I am unsure of why SAS cant read in the files. The files are tab delimited. Thank
Hello, please help with this SAS coding assignment. I am unsure of why SAS cant read in the files. The files are tab delimited. Thank you!
Problem 1 (15 Points) The text file "ASS3A.TXT" is a tab delimiter file that contains four variables: AGE, RACE, SMOKER, and DPC.AGE is an integer.RACE has two values "C" and "A", where "C" stands for Caucasian and "A" stands for African American.SMOKER has two values "Y" and "N", where "Y" stands for smoker and "N" stands for "Non-Smoker".DPC, response from an experiment, is a real number.This data set has 46 observations and the first 21 observations are from control group and the rest are from treatment group.
(a)Write a PROC FORMAT to define format for variable RACE, variable SMOKER, and variable TREAT (defined in part (b)). (6 Points)
(b)Write exact one "data step" to read the file "ASS3A.TXT". (9 Points)In your data step, you need to create a new variable that has value "C" for the first 21 observations and value "T" for the other observations.
Problem 2 (15 Points)
a.The file medical.txt contains the cholesterol readings of 4 patients over an eight week period. This data gives the date, patient name, cholesterol level, and high and low blood pressure readings for 4 patients in a study of the effect of a cholesterol reducing drug. A code of 999 was used whenever a reading was missing. Write a SAS program to read the text file medical.txt and convert it to a SAS data set with standard SAS missing value for numerical variable. (10 Points)
b.Create a new data set containing 3 variables: patient name, first cholesterol reading, and last cholesterol reading. The first. and last. functions should be used on a sorted version of the original data set. You may also want to use retain. (5 Points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
