Thank you so much for sharing! I tried the macro but encountered some errors, and the SD was not being calculated for one of my variables, so it turned up as missing. Regarding my data structure, here is an example where I would like to get the SD of the continuous variables and the proportions. Thank you so much for all your help so far with this. What am I missing? Please help me understand why it's not working. Variable TRT1 TRT2 TRT3 SD Age 72.5 (5.9) 73.1 (6.1) 72.5 (5.8) Gender, n (%) . Female 406 9.09 1256 28.12 2804 62.79 . Male 403 9.03 1183 26.50 2878 64.47 Race, n (%) . Asian 10 8.26 26 21.49 85 70.25 . Black 184 8.90 580 28.06 1303 63.04 . Hispanic 5 8.77 12 21.05 40 70.18 . White 610 9.12 1821 27.24 4254 63.64 I got the SMD for everything but race categories. What would be the issue? var lvl ALL ALL_2 TRT_1 TRT_1_2 TRT_2 TRT_2_2 TRT_3 TRT_3_2 test_stat test_stat_val pval has_missing SMD_MNA2_2_vs_MNA2_1 SMD_MNA2_3_vs_MNA2_1 SMD_MNA2_3_vs_MNA2_2 Pop 8758 1 784 0.089518 2382 0.27198 5592 0.638502 . Gender Chi2 2.637272 0.2675 -0.03101 0.008678663 0.039693716 Female 4414 0.503996 394 0.502551 1234 0.518052 2786 0.498212 . Male 4344 0.496004 390 0.497449 1148 0.481948 2806 0.501788 . Race Chi2 5.701208 0.4575 0.041915 0.023022193 0.058672359 Asian 121 0.013816 10 0.012755 26 0.010915 85 0.0152 . Black 1949 0.222539 172 0.219388 558 0.234257 1219 0.21799 . Hispanic 57 0.006508 5 0.006378 12 0.005038 40 0.007153 . White 6631 0.757136 597 0.76148 1786 0.74979 4248 0.759657 . Age Mean (StdDev) 72.63896 5.883168 72.52296 5.937476 73.08564 6.039716 72.46495 5.798456 . 0.093956 -0.009885058 -0.104841103 Here is the macro call: /* Call the %table1 macro */ /* Include the macro file */ %INCLUDE 'C:\FOLDER\table 1 macro.txt'; %table1( personfile=test, /* Input dataset */ stratvars=trt, /* Stratify only by mna2 */ rowvars= gender | /* Gender as a row variable */ race | /* Race as a row variable */ age/mean std | /* Age as a continuous variable with mean and std */ uselabels=1, /* Use variable labels if available */ pvalues=1, /* Include p-values for group comparisons */ printSMD=1 /* Calculate and display standardized mean differences */ );
... View more