Assignment 2: First SAS programm
For my reasearch question codebook, the relevent data was defined to answer if any correlation between alcohol abuse and living region is related already.
To begin, I set my dataset to the NESARC-pds data.
To now check how the distribution of the variables is within the interesting variables I first labelled all the data accordingly and filtered only for subsets that are interesting for me (age between 25 and 55, Drank at least 12 alcoholic drinks last year: Yes)
To do so, I included LABEL statement and IF functions to my programm.
I then used the SORT procedure to sort the results by ID-Number and let SAS create distribution tables by using the PROC FREQ function with tables for all interesting variables.
Code looks the following:
By checking the results, I see it worked, as only data for age 25 to 55 is included and the table for S2AQ2 only includes data for the value of “1″, meaningt at least 12 alcoholic drinks were consumed in the last 12 month.
The percentages add up to 100%.
My program an successfully.


















