
Automated Table Production for Clinical Trials Reporting Using Report.ado
"Learn how to use Report.ado command to automate table production in XML format for clinical trials reporting. See examples of generating tables from citytemp2 dataset and enhancing reporting with row percentages and two-way frequency analysis."
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Report.ado Prof. Adrian Mander Cardiff University Centre for Trials Research
Introduction Report.ado is a command that produces tables in XML Most of the code uses -putdocx- commands to construct tables The automation of table production is really useful for clinical trials reporting Going to use the citytemp2 data set to demonstrate webuse citytemp2, clear
The basic table (listing unique values) report, rows(region) nofreq file(test) replace The file test.docx contains this table Census Region NE N Cntrl South West
Adding a title and row percentages with test.docx report, rows(region) title(Frequency and row percentages) file(test) row Frequency and row percentages Total 166 17.36% 284 29.71% 250 26.15% 256 26.78% Census Region NE N Cntrl South West Row percentages
Frequency table with two variables report, rows(region agecat) file(test) row Total 46 4.81% 83 8.68% 37 3.87% 162 16.95% 92 9.62% 30 3.14% 139 14.54% 68 7.11% 43 4.50% 160 16.74% 73 7.64% 23 2.41% Census Region NE agecat 19-29 30-34 35+ N Cntrl 19-29 30-34 35+ South 19-29 30-34 35+ West 19-29 30-34 35+
Two way frequency table with column percentages report, rows(region) cols(agecat) column totals file(test) agecat 19-29 30-34 35+ Total Census Region NE 46 9.07% 83 26.27% 37 27.82% 166 N Cntrl 162 31.95% 92 29.11% 30 22.56% 284 South 139 27.42% 68 21.52% 43 32.33% 250 West 160 31.56% 73 23.10% 23 17.29% 256 Total 507 316 133
agecat 19-29 22 0 0 0 24 0 0 0 0 112 0 0 0 50 0 0 0 0 58 0 0 0 33 0 0 0 48 0 0 0 0 58 0 0 0 102 30-34 43 0 0 0 40 0 0 0 0 82 0 0 0 10 0 0 0 0 16 0 0 0 13 0 0 0 39 0 0 0 0 3 0 0 0 70 35+ 4 0 0 0 33 0 0 0 0 12 0 0 0 18 0 0 0 0 41 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 23 Census Division N. Eng. Census Region NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West Mid Atl E.N.C. report, rows(division region) cols(agecat) W.N.C. S. Atl. E.S.C. W.S.C. Mountain Pacific
Summary statistics report, rows(tempjan, mean %5.2f | tempjan, sd %5.2f| tempjan, count | tempjuly, mean %5.2f| tempjuly, median %5.2f) cols(region agecat) font(,8) file(test) Census Region NE N Cntrl South West agecat 19-29 30-34 35+ 19-29 30-34 35+ 19-29 30-34 35+ 19-29 30-34 35+ Average January temperature Mean sd N 23.16 2.51 46 29.00 1.50 83 31.46 0.22 35 18.09 4.81 162 25.40 1.39 92 29.77 1.36 30 38.59 4.24 139 50.13 3.59 68 64.28 2.88 43 40.24 9.70 160 54.53 1.08 73 61.50 7.12 23 Average July temperature Mean median 70.80 70.85 73.60 73.50 76.11 76.70 72.32 73.00 73.81 72.90 78.62 78.65 79.72 79.30 82.80 82.30 82.23 82.20 71.39 71.25 73.20 73.30 73.63 74.10
Summary statistics with adjacent by columns report, rows(tempjan, mean %5.2f | tempjan, sd %5.2f| tempjan, count | tempjuly, mean %5.2f| tempjuly, median %5.2f) cols(region agecat) font(,8) file(test) adjacentcolumns Census Region agecat NE N Cntrl South West 19-29 30-34 35+ Average January temperature mean sd N 27.89 3.54 164 21.69 5.73 284 46.15 10.39 250 46.23 11.25 256 31.16 12.00 507 38.40 12.92 316 47.12 16.77 131 Average July temperature mean median 73.35 73.50 73.47 73.10 80.99 81.70 72.11 72.55 73.92 73.30 75.55 74.00 78.26 78.00
Summary statistics by a row variable report, rows(tempjan, mean %5.2f | tempjan, sd %5.2f| tempjan, count | tempjuly, mean %5.2f| tempjuly, median %5.2f) cols(agecat) rowsby(region) font(,8) file(test) agecat Census Region 19-29 30-34 35+ Average January temperature Mean NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West NE N Cntrl South West 23.16 18.09 38.59 40.24 2.51 4.81 4.24 9.70 46 162 139 160 70.80 72.32 79.72 71.39 70.85 73.00 79.30 71.25 29.00 25.40 50.13 54.53 1.50 1.39 3.59 1.08 83 92 68 73 73.60 73.81 82.80 73.20 73.50 72.90 82.30 73.30 31.46 29.77 64.28 61.50 0.22 1.36 2.88 7.12 35 30 43 23 76.11 78.62 82.23 73.63 76.70 78.65 82.20 74.10 sd N Average July temperature Mean median
Conclusions The report- command is able to produce most frequency and summary statistics tables Can be used in conjunction with other -putdocx- commands to create a complete document This is still a work in progress and I am happy to handle different table formats