Clinician's
corner

Back to main page

Programmer's
corner
So, you use WinBUGS a lot? Want more?
Patrick Blisle
Division of Clinical Epidemiology
McGill University Health Center
Montreal, Quebec CANADA
patrick.belisle@rimuhc.ca

Last modification: 20 dec 2012















Version 2.1 (December 2012)
BIC-Summary
Summarizing BIC results in an html table
[ BIC-Summary is a Perl program that converts bic.process outputs (saved to a text file) into easy to read Excel file and/or html table. ]


bic.process outputs are very similar to bic.glm, bicreg and bic.surv outputs. Anyone familiar with the latter three programs will feel at ease with bic.process outputs. However, many users find that the standard bic programs outputs are long and not easy to follow, hence the need for BIC-Summary (previously known as bic2html), which will turn a bic.process output into an easy to read Excel file and/or html table.

A typical bic.process output text file looks this (excerpt):


Click on the image above to see full-size text output file.

Actually, the output shown above doesn't look too bad. However, when the number of variables included in the model selection is larger, the $mle is broken down into many blocks and is difficult to read; in all cases, the different bits of information for a given model may be difficult to collect from such an output for some readers.

The same output, when put into an Excel file by BIC-Summary appears as shown below


Click on the image above to see full-size text output file.


while when put into an html table, it appears as shown below.


Click on the image above to see full-size text output file.


Both Excel and html BIC-Summary outputs are easier to read then original BIC output, the Excel file being still easier to read than its html counterpart, especially when the file is busy (in which case numbers in the html output file can be unelegantly broken onto two lines).

Note
Numbers between brackets in the outcomes names title bars (dark green) correspond to the numeric suffixes (if any) in the outcome names (nank5y40.1, nank5y40.2, nank5y50.1 and nank5y50.2 in this example), which may be used to differentiate between different bic outputs for a given outcome variable; in this example – related to rejection in organ transplant – we did not know whether we should include only patient gender in the bic or the combo variable sexmatch, which contains the info on both donor and receiver genders; since only one of these variables could be included in a bic run, we decided to run bic.glm with sex first – in the .1-suffixed output – and then with sexmatch – the .2-indexed output. (One can then compare all the bic results for a single outcome variable and make sense out of it.)

When bic is run multiple times for a single outcome variable, as in the example above, one may find useful to have at hand a summary of the results: the outcomes names in the html table are clickable and will lead to relevant section of a secondary html document produced by BIC-Summary, in which only summaries of bic.process outputs are reported. In the Excel BIC-Summary output file, the summary is relegated to the next-to-last spreadsheet, labeled -summary.


How to use BIC-Summary

BIC-Summary is a program written in Perl. Please refer to my generic page on running Perl programs for instructions.

Note that Perl module Spreadsheet-WriteExcel needs be installed in order to enable the writing of Excel output files by BIC-Summary.
Read this page on how to install a Perl module if necessary.

Options

By default, the html output file is not produced. Edit the file BIC-Summary.pl and change the value 0 to 1 on the html line in the block copied below, found on top of the file, if you would like the html output file to be produced.
%Write = ("html"        => 0,                                                                                           
          "summary"     => 1, 
          "xls"         => 1);
That is, the above three lines of code should read
%Write = ("html"        => 1,                                                                                           
          "summary"     => 1, 
          "xls"         => 1);
for the html output file to be produced.


Download BIC-Summary

BIC-Summary is a free program. Download version 2.1 (December 2012) now and unzip.