170 likes | 358 Views
Second Period: PROC TABULATE. Jill Casey. Example 1:. Simple 2D Table. Simple 2D Table :. PROC TABULATE DATA=FINAL FORMAT=PCT.; CLASS HYPER REGION; WEIGHT PWGTQ; TABLES HYPER, REGION="Region of Residence"*PCTN<HYPER>=“ “ ; RUN ;. Simple 2D Table :. Example 2:.
E N D
Second Period: PROC TABULATE Jill Casey
Example 1: Simple 2D Table
Simple 2D Table : PROC TABULATEDATA=FINAL FORMAT=PCT.; CLASSHYPER REGION; WEIGHTPWGTQ; TABLESHYPER, REGION="Region of Residence"*PCTN<HYPER>=“ “ ; RUN;
Example 2: A Little More Complicated …
Table with Nested Class Variables : PROC TABULATEDATA=FINAL FORMAT=PCT.; CLASSBMICAT SEX AGEGRP; WEIGHTPWGTQ; TABLESSEX=""*AGEGRP=""*PCTN<BMICAT>="", BMICAT="BMI Distribution“ ; RUN;
Example 3: Multiple Statistics
Table with Multiple Statistics: PROC TABULATEDATA=FINAL FORMAT=8.1; CLASSREGION; VARCHOL LDL HDL TRIG; WEIGHTPWGTC; TABLESREGION*(MIN MAX MEAN MEDIAN), CHOL LDL HDL TRIG ; RUN;
Table with Multiple Statistics: Example 3: Blood Lipids Statistics by Region
Example 4: Adding Subtotals
Table with Subtotals : PROC TABULATEDATA=FINAL FORMAT=PCT.; CLASSREGION AGEGRP CVDRISK; WEIGHTPWGTC; TABLES(REGION ALL="Nova Scotia")* (AGEGRP="" ALL="Region Total")* PCTN<CVDRISK>="“ , CVDRISK="Cardiovascular Disease Risk" ; RUN;
Include data from many variables • Compute a variety of statistics in one table (all the basic stats available in Proc Means) • Compute summary statistics for categorical variables (N, NMISS, PCTN) Advantages
Proc Tabulate by Example, by Lauren E. Haworth • SUGI and SAS Global Forum Proceedings (http://support.sas.com/events/sasglobalforum/previous/online.html) For More Information: