Hi
I've done a new package for Stata called basetable.
Most researchers where I work have to make at least one basetable comparing eg several possible confounders for each level of a risk factor or another categorical variable.
Building these tables is usually very tedious to do.
They are necessary for the upcoming article and they are often also bound to be changed during writing process.
This tools both eases the making of the table at the cost of some minor simplifications and also makes it possible to export the resulting table to excel using only one (1!) single command.
And hence if variable labels as well as value labels are set smart from the beginning then only minor changes are needed before using the table directly in the word document containing the upcoming article.
If you are interested please read the help file carefully. Only there is the full description of the functionality.
An example below using low as the categorical variable for the column comparing age, ftv2, race and smoke and then putting the table into the excel workbook "./tables.xls" at sheet "Table 1" as well as showing the table in the log:
To install just write -ssc install basetable- at the command promt.
And -help basetable- to read about usage.
Enjoy
I've done a new package for Stata called basetable.
Most researchers where I work have to make at least one basetable comparing eg several possible confounders for each level of a risk factor or another categorical variable.
Building these tables is usually very tedious to do.
They are necessary for the upcoming article and they are often also bound to be changed during writing process.
This tools both eases the making of the table at the cost of some minor simplifications and also makes it possible to export the resulting table to excel using only one (1!) single command.
And hence if variable labels as well as value labels are set smart from the beginning then only minor changes are needed before using the table directly in the word document containing the upcoming article.
If you are interested please read the help file carefully. Only there is the full description of the functionality.
An example below using low as the categorical variable for the column comparing age, ftv2, race and smoke and then putting the table into the excel workbook "./tables.xls" at sheet "Table 1" as well as showing the table in the log:
Code:
. basetable low age(%6.2f) ftv2(1) race(1) smoke(Yes), nolog toxl(./tables.xls, Tabel 1, 1, 1) +------------------------------------------------------------------------------------------------+ | |Normal Low |P-value | |------------------------------------------------------------+--------------------------+--------| |n (pct) |130 (68.8) 59 (31.2) | | |age of mother, mean (sd) |23.66 (5.58) 22.31 (4.51) |0.1031 | |number of visits to physician during 1st trimester, n (pct) | | | | 0_visits |64 (49.2) 36 (61.0) | | | 1_visits |36 (27.7) 11 (18.6) | | | 2_visits |23 (17.7) 7 (11.9) | | | >3_visits |7 (5.4) 5 (8.5) |0.2747 | |race, n (pct) | | | | white |73 (56.2) 23 (39.0) | | | black |15 (11.5) 11 (18.6) | | | other |42 (32.3) 25 (42.4) |0.0819 | |smoked during pregnancy (Yes), n (pct) |44 (33.8) 30 (50.8) |0.0265 | +------------------------------------------------------------------------------------------------+ Table send to Excel succesfully...
And -help basetable- to read about usage.
Enjoy

Comment