50 likes | 71 Views
Learn to create quick data summaries in SAS using Proc Tabulate to generate written output with statistics like mean, n, standard deviation, and more. Explore essential syntax and useful options to enhance table formatting for better insights.
E N D
Quick Data Summaries in SAS • Start by bringing in data • Use permanent data set for these examples • Proc Tabulate • Produces summaries very quickly and easily • Designed to produce “written” output, but not a table that can be manipulated further
Quick Data Summaries in SAS • Basic Tabulate Syntax: Proc tabulate; Class variable1 variable2; Var variable3; Table row_variable , analysis_variable*statistic; Run; Proc tabulate; Class variable1 variable2; Var variable3; Table row_variable , column_variable*analysis_variable*statistic; Run; Important to recognize function of comma, space and asterisk!
Quick Data Summaries in SAS • Useful options – after procedure statement • Formchar “ “ removes column separators • Noseps removes row separators • Format=6.2 format output to 6 spaces with two decimal places • Useful options – after table statement • RTS=6 narrows column headers • Misstext=“0” fills in miss. obs. with zero
Statistics available in Tabulate • Mean, n, standard deviation, standard deviation, variance, coefficient of variation • Minimum, maximum, number of missing observations • Percentages of totals (can be tricky). Depends if you want percentage of n or of total, and if you want total of a row, column, or grand total.
Homework • Try to develop the appropriate tabulate statements to produce tables emulating those in the handouts • Also think about the data structure needed to support these analyses