Presentation is loading. Please wait.

Presentation is loading. Please wait.

Second Period: PROC TABULATE Jill Casey. Example 1: Simple 2D Table.

Similar presentations


Presentation on theme: "Second Period: PROC TABULATE Jill Casey. Example 1: Simple 2D Table."— Presentation transcript:

1 Second Period: PROC TABULATE Jill Casey

2 Example 1: Simple 2D Table

3 Simple 2D Table : PROC TABULATE DATA=FINAL FORMAT=PCT.; CLASS HYPER REGION; WEIGHT PWGTQ; TABLES HYPER, REGION="Region of Residence"*PCTN =“ “ ; RUN;

4 Simple 2D Table : Example 1: Hypertension Risk by Region ( showing column percent) Region of Residence WesternEasternNorthernCentral Hypertensive Risk Factor 73%65%68%74% No Yes27%35%32%26%

5 Example 2: A Little More Complicated …

6 Table with Nested Class Variables : PROC TABULATE DATA=FINAL FORMAT=PCT.; CLASS BMICAT SEX AGEGRP; WEIGHT PWGTQ ; TABLES SEX=""*AGEGRP=""*PCTN ="", BMICAT="BMI Distribution“ ; RUN;

7 Table with Nested Class Variables : BMI Distribution Under Wt.Normal Wt.OverweightObese Female18-344%53%22%21% 35-642%40%28%29% 65+5%38%33%24% Male18-341%46%34%20% 35-641%24%46%29% 65+2%33%47%18% Example 2: Body Mass Index Distribution by Sex and Age Group (showing row percent)

8 Example 3: Multiple Statistics

9 Table with Multiple Statistics : PROC TABULATE DATA=FINAL FORMAT=8.1; CLASS REGION; VAR CHOL LDL HDL TRIG; WEIGHT PWGTC; TABLES REGION*(MIN MAX MEAN MEDIAN), CHOL LDL HDL TRIG ; RUN;

10 Example 3: Blood Lipids Statistics by Region Chol Result (mmol/L) LDL Result (mmol/l) HDL Result (mmol/l) Triglyceride Result (mmol/l) HEALTH REGION WHERE RESPONDENT LIVES 2.20.90.50.4 WesternMin Max 8.86.22.99.6 Mean 5.33.21.21.8 Median 5.23.21.21.5 EasternMin 2.20.50.60.4 Max 10.46.42.526.6 Mean 5.43.31.31.9 Median 5.33.21.21.5 Table with Multiple Statistics:

11 Example 4: Adding Subtotals

12 Table with Subtotals : PROC TABULATE DATA=FINAL FORMAT=PCT.; CLASS REGION AGEGRP CVDRISK; WEIGHT PWGTC; TABLES (REGION ALL="Nova Scotia")* (AGEGRP="" ALL="Region Total")* PCTN ="“, CVDRISK="Cardiovascular Disease Risk" ; RUN;

13 Example 4: Adding Subtotals Cardiovascular Disease Risk Low Risk Moderate Risk High Risk HEALTH REGION WHERE RESPONDENT LIVES 73%19%8% Northern18-34 35-64 37%36%27% 65+ 31%39%30% Region Total46%32%23% Eastern18-34 70%23%6% 35-64 34%40%26% 65+ 33%39%29% Region Total44%35%21% Nova Scotia18-34 73%20%8% 35-64 39%37%24% 65+ 33%38%29% Region Total48%32%20%

14 Advantages  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)

15 For More Information:  Proc Tabulate by Example, by Lauren E. Haworth  SUGI and SAS Global Forum Proceedings ( http://support.sas.com/events/sasglobalforum/previous/online.html)


Download ppt "Second Period: PROC TABULATE Jill Casey. Example 1: Simple 2D Table."

Similar presentations


Ads by Google