proc tabulate data=WORK.FILTER_FOR_ADSL_SAS7BDAT order=data missing format=5.1; * List of all continuous variables; var age; *height weight; * Apply formats as needed; * format age agegrp.; * format age mypct.; * List all categorical variables with the PRELOADFMT and PRINTMISS option to display all possible values even if missing in data; * MLF option with MULTILABEL Proc Format option if values overlap; * Can have separate CLASS statements for different variables for different options; class sex trt01a race; * Assign all statistics labels; keylabel N='N' PCTN='%' COLPCTN='%' MEAN='Mean' MEDIAN='Median' MIN='Min' MAX='Max' STD='Std' Q1='Q1' Q3='Q3' ALL='Subtotal'; * PRINTMISS with PRELOADFMT option to display all values; * MISSTEXT to display 0 instead of '.' for zero counts; * Note that for categorical variables with missing values, the percentages may be incorrect because the denominator include missing counts; * ALL for grand total else grouping variable to create columns; * TABLE statement has a combination of continuous and categorical variables in the order of the table to qc; * Use variable labels as default but can override, ex. age='Age (yrs)'; * Add more row variables as needed as new lines; * For continuous variables, keep standard list and order of statistics - n mean std median min max q1 q3; * For continuous variables, can select other stats also - nmiss; * For categorical variables, keep n and COLPCTN to calculate column percentages, ALL is added as subtotals - sex*(n colpctn) all; * For categorical variables, can select any percent direction calculation - COLPCTN, ROWPCTN, REPPCTN or PAGEPCTN; * For nesting, cross two or more variables in row or column dimension; * For indenting, apply nesting and INDENT=4 option; * Valid TABLE statment assures number of columns is the same for each variable syntax; tables ( age*(n*f=3. nmiss*f=3. mean std median min max q1 q3) (sex all)*(n*f=3. colpctn*f=5.1) (race all)*(n*f=3. colpctn*f=5.1) /* height*(n*f=3. mean std median min max q1 q3) weight*(n*f=3. mean std median min max q1 q3) */ ), (trt01a='Treatment') (all='Total')/ rts=75 printmiss misstext='Missing'; run;