Here's my dataset
Column 1: Lipid level
Column 2: Age
Column 3: Fat content category
Column 4: Gender (1=male)
0.73 1 1 1
0.67 1 2 1
0.15 1 3 1
0.86 2 1 1
0.67 2 2 1
0.15 2 3 1
0.94 3 1 1
0.81 3 2 1
0.26 3 3 1
0.23 4 1 2
1.40 4 1 1
1.32 4 2 1
0.15 4 3 1
1.62 5 1 1
1.41 5 2 1
0.78 5 3 1
9.78 5 1 1
Here's a few different analysis I'm running with this code but I'm not so sure why SAS is not compiling.
Before doing anything else, I set up a permanent library manually.
libname di ‘c:\diet’;
data di.HW3 Data;
infile hw3 data.sas;
input Lipidlevel Age Fatcontent Gender;
run;
Is there any way that I can stratify the data as follows? I want to create labels and formats for both the Age Group and Fat Content Category variables. The age groups are coded 1 to 5 and correspond to: 15-24; 25-34; 35-44; 45-54; 55-64. The fat content categories are coded 1 to 3 and correspond to: extremely low; fairly low; moderately low. I have no idea how to do this. The only way I can think of is to go into the original dataset and sort them out manually.
I mean of course if I were given a much larger dataset then it would be impractical to do so. Can I get some help here?
INFILEstatement is wrong. Either include a fileref (ie alias) likehw3or a physical path like"data.sas", but not both. Also watch out for those not quote character quotes that WORD or something has generated in yourlibnamestatement. SAS does not understand those fancy quotes. Just normal"or'quotes. - TomPROC FORMATto create them. You can then use aFORMATstatement to tell SAS which formats to use with which variables. - Tom