***********************************************************; * Research Computing Services *; * Introduction to SAS *; ***********************************************************; ***********************************************************; * SAS Univariate procedure *; * *; * 1. Execute the code as is and explore the output *; * 2. Change the variable in var and where statements *; * and examine how output changes; *; * *; ***********************************************************; * Read more: ; * univariate: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_univariate_syntax01.htm *; * means and univariate: https://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Winnipeg-User-Group/MarjorieSmith-PROC-UNIVARIATE-PROCMEANS.pdf ; * univariate examples: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_univariate_examples.htm * ; /* Include sas program that sets input library */ %include "setup.sas"; /* deatiled information about the distribution of a numeric variable */ proc univariate data=mydata.med_visits; title "Distribution of the Height Variable"; var Height ; run; /* detailed summary for a specific variable */ proc univariate data=mydata.med_visits; title "Distribution of the Height Variable grouped by Sex for Age < 50"; var Height ; class Sex; where Age < 50; run; /* plot histogram */ proc univariate data=mydata.med_visits; title "Histogram of DBP"; var DBP; histogram; run; /* add normal curve */ proc univariate data=mydata.med_visits; title "Histogram of DBP"; var DBP; histogram /normal; run;