This is the result (or similar) I'm trying achieve.
Array
Perhaps there is an easier way of accomplishing this task but I also wanted to work more with the table and collect commands to have some additional experience with them.
Please see the sample code below that I've tried:
Code:
webuse nhanes2, clear // Create a table for the general sample in the dataset -- Table 1 table race (diabetes agegrp), statistic(median bpsystol) total(diabetes#race) // Exclude all but those in "Poor" health (hlthstat == 5) and recreate the table above -- Table 2 table race (diabetes agegrp) if hlthstat==5, statistic(median bpsystol) total(diabetes#race) append // Rename "race" for the "poor health" table collect label levels var race "Poor Health", modify // Set the new layout Table 1 first then Table 2 collect layout (race race) (result)
Thanks in advance for the the assistance.
Chris.
0 Response to Appending tables using collect
Post a Comment