With thanks as ever to Kit Baum, an updated version of the ipdmetan package is now available for download from SSC (ssc install ipdmetan, or adoupdate ipdmetan if already installed). The package description from SSC is given below.
This version (1.07) includes the following bug-fixes and additions:
Bug fixes:
- Fixed bug preventing use of nohet option
- Fixed bug in implementation of "empirical Bayes" random-effects estimator
- forestplot no longer uses char(160) to represent blank (non-breaking) space due to differences in character mapping across systems
- Fixed bug in forestplot relating to varnames in lcols() and rcols() not having variable labels (the “must specify at least one of target or maxwidth” error)
- Now correctly parses “...if varname=="label":lblname...” syntax
Changes/additions:
- Added cumulative IPD meta-analysis functionality
- Added Kenward-Roger random-effects estimator, using an expression for the two-stage model derived from their paper (Biometrics 1997; 53: 983-97)
- Improvements to aspect ratio and text sizing in forestplot, including saving important "dimensions" in r() and optionally saving them to a matrix to be applied to subsequent plots
I am also happy to be able to draw your attention to the current issue of the Stata Journal, where you can find an article discussing ipdmetan and forestplot in more detail (Vol. 15, No. 2, pp. 369-96).
One addition which I have not yet had the time to implement is the creation of forestplots of “prognostic” subgroup effects -- that is, where the outcome in each level of a subgroup is compared to a reference (baseline) category. The current implementation only allows the effect of a treatment variable to be plotted within each subgroup level. Since I have had so many requests for this functionality, below is an example of a “hack” which can be used to achieve this effect in the meantime. I hope this will prove useful.
Many thanks,
David.
David Fisher
Statistician
MRC Clinical Trials Unit at UCL
e-mail: [email protected]
SSC DESCRIPTION
A set of routines for conducting two-stage individual participant meta-analysis, and associated functionality. The main routine, ipdmetan, loops over a series of categories, fits the desired model to the data within each, and generates pooled effects, heterogeneity statistics etc, as appropriate. Various random-effects subroutines are available, and aggregate data may be included from an external dataset. The routine forestplot is a stand-alone, re-written and extended version of the graphics routine within the existing SSC command metan. ipdover allows ipdmetan to be used outside of the meta-analytic context, for example for creating a forestplot of a series of (potentially overlapping) subgroups within a single study. admetan allows ipdmetan to be run on aggregate data only, if currently in memory, as a direct alternative to metan. Finally, petometan is an extension of the built-in command sts test for performing meta-analysis on binary or time-to-event data using the Peto (log-rank) method.
*********************
EXAMPLE CODE FOR COMPARING OUTCOMES WITHIN SUBGROUPS TO A REFERENCE CATEGORY
This version (1.07) includes the following bug-fixes and additions:
Bug fixes:
- Fixed bug preventing use of nohet option
- Fixed bug in implementation of "empirical Bayes" random-effects estimator
- forestplot no longer uses char(160) to represent blank (non-breaking) space due to differences in character mapping across systems
- Fixed bug in forestplot relating to varnames in lcols() and rcols() not having variable labels (the “must specify at least one of target or maxwidth” error)
- Now correctly parses “...if varname=="label":lblname...” syntax
Changes/additions:
- Added cumulative IPD meta-analysis functionality
- Added Kenward-Roger random-effects estimator, using an expression for the two-stage model derived from their paper (Biometrics 1997; 53: 983-97)
- Improvements to aspect ratio and text sizing in forestplot, including saving important "dimensions" in r() and optionally saving them to a matrix to be applied to subsequent plots
I am also happy to be able to draw your attention to the current issue of the Stata Journal, where you can find an article discussing ipdmetan and forestplot in more detail (Vol. 15, No. 2, pp. 369-96).
One addition which I have not yet had the time to implement is the creation of forestplots of “prognostic” subgroup effects -- that is, where the outcome in each level of a subgroup is compared to a reference (baseline) category. The current implementation only allows the effect of a treatment variable to be plotted within each subgroup level. Since I have had so many requests for this functionality, below is an example of a “hack” which can be used to achieve this effect in the meantime. I hope this will prove useful.
Many thanks,
David.
David Fisher
Statistician
MRC Clinical Trials Unit at UCL
e-mail: [email protected]
SSC DESCRIPTION
A set of routines for conducting two-stage individual participant meta-analysis, and associated functionality. The main routine, ipdmetan, loops over a series of categories, fits the desired model to the data within each, and generates pooled effects, heterogeneity statistics etc, as appropriate. Various random-effects subroutines are available, and aggregate data may be included from an external dataset. The routine forestplot is a stand-alone, re-written and extended version of the graphics routine within the existing SSC command metan. ipdover allows ipdmetan to be used outside of the meta-analytic context, for example for creating a forestplot of a series of (potentially overlapping) subgroups within a single study. admetan allows ipdmetan to be run on aggregate data only, if currently in memory, as a direct alternative to metan. Finally, petometan is an extension of the built-in command sts test for performing meta-analysis on binary or time-to-event data using the Peto (log-rank) method.
*********************
EXAMPLE CODE FOR COMPARING OUTCOMES WITHIN SUBGROUPS TO A REFERENCE CATEGORY
Code:
* Load data use "http://fmwww.bc.edu/repec/bocode/i/ipdmetan_example", clear stset tcens, fail(fail) * Generate indicator vars for each level of "stage" qui tab stage, gen(stage) * Run -ipdover- repeatedly to save the different parts we need * (N.B. the first run uses "stcox trt" simply to create the desired structure in the saved dataset; the actual coefficients are not ultimately used) ipdover, over(stage) over(trialid) hr nosubgroup nooverall nograph saving(stage_all, replace) : stcox trt ipdover, over(trialid) hr nooverall nograph poolvar(2.stage) saving(stage2, replace) rcols((sum) stage1 stage2) : stcox i.stage ipdover, over(trialid) hr nooverall nograph poolvar(3.stage) saving(stage3, replace) rcols((sum) stage3) : stcox i.stage * Now load the saved datasets and assemble use stage_all, clear drop if _USE==1 append using stage2 stage2 stage3, gen(dataid) * Sort out arrangement of trials and covariate levels replace _BY = _LEVEL if dataid > 0 replace _LEVEL = dataid if dataid > 0 replace _LABELS = "Stage I" if _LEVEL == 1 replace _LABELS = "Stage II" if _LEVEL == 2 replace _LABELS = "Stage III" if _LEVEL == 3 * Sort out numbers of patients replace _NN = stage1 if dataid == 1 replace _NN = stage2 if dataid == 2 replace _NN = stage3 if dataid == 3 drop stage1 stage2 stage3 * Replace effect size with null in reference category * (N.B. I couldn't do this directly because -ipdover- would complain that there was "no data") replace _ES = 0 if dataid == 1 replace _seES = 0 if dataid == 1 replace _LCI = 0 if dataid == 1 replace _UCI = 0 if dataid == 1 * Manually generate "effect size" string, including for reference category gen str estText = string(exp(_ES), "%10.2f") + " (" + string(exp(_LCI), "%10.2f") + ", " + string(exp(_UCI), "%10.2f") + ")" if _USE == 1 replace estText = "1.00 (Reference)" if _LEVEL == 1 label var estText "Haz. ratio (95% CI)" * Sort data and produce forestplot sort _BY _USE _LEVEL forestplot, hr nostat nowt rcols(estText _NN)
Comment