Advanced Statistical Tests

The previous example showed how to add a statistic not generated by PROC TABULATE to your table. You can use this approach to add more complex statistical test results to your table. For example, suppose that you have a table that shows mean income for males and females in a variety of occupations. What you want to know is whether the means vary within each occupation.
You can set up a table easily that shows the two means for each occupation. What you cannot do is display the appropriate statistical test result. What you need is a column that shows the p-values for the F statistic from an ANOVA comparing the two means.
The way to do this is to use a DATA step trick to attach the F-test results to each row. Here ...

Get PROC TABULATE by Example, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.