Code covered by the BSD License  

Highlights from
Forest plot for meta-analysis or sub-group analysis

5.0
5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 7.07 KB File ID: #37227 Version: 1.3
image thumbnail

Forest plot for meta-analysis or sub-group analysis

by

Qi An (view profile)

 

19 Jun 2012 (Updated )

Plot a forest plot for meta-analysis or sub-group analysis

| Watch this File

File Information
Description

FORESTPLOT generates a forest plot to demonstrate the effects of a predictor in multiple subgroups or across multiple studies. A forest plot is a graphical display designed to illustrate the relative strength of treatment effects in multiple quantitative scientific studies addressing the same question.
 
  forestplot(response, predictor, subgroup, 'ArgumentName',ArgumentValue)
  response - a Nx1 binary vector, where N is the number patients, "1" means an event/disease happened on this patient, "0" means the opposite and "NaN" means unknown. When response is a NxM matrix, each column is associated with one study. Pad with "NaN" in the end if the patient sizes are different across studies.
  preditor - a Nx1 binary vector, where "1" means this patient is exposed to this treament or is within desire predictor range (e.g. low dose), "0" mean the opposite and "NaN" means unknown. When response is a NxM matrix, each column is associated with one study.Pad with "NaN" if the patient sizes are different across studies.
  subgroup - a NxM binary vector, where "1" means this patient belongs to this subgroup "0" mean the opposite and "NaN" means unknown.
 
  Optional 'ArgumentName' includes:
  subgroup_text - a 1xM cell vector of strings, where each strings is a description of one subgroup/study. For example, {'Group 1', 'Group 2', 'Group 3'} or {'Study 1', 'Study 2', 'Study 3'}
  predictor_text - a 1x2 cell vector of strings, where the first string is the description of the non-treatment group and the second is for the treatment group. For example, {'Favor high dose', 'Favor low dose'}
  limx - a 1x2 vector to specify the limits of x coordinate. The plot is in logarithm scale.
  'stat' - the statistics (odds ratio or relative risk) used to generate the forest plot. (options = 'or', 'rr', default = 'or')

  For example,
    response=round(rand(100, 1));
    preditor=round(rand(100, 1));
    subgroup=round(rand(100, 3));
    forestplot(response, preditor, subgroup, 'stat', 'rr');
  plots a forest plot.
  
    Developed under Matlab version 7.10.0.499 (R2010a)
    Created by Qi An
    anqi2000@gmail.com

Acknowledgements

Odds inspired this file.

MATLAB release MATLAB 7.14 (R2012a)
Other requirements http://www.mathworks.com/matlabcentral/fileexchange/15347
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
06 Mar 2015 Pratik Chhatbar

Very nice work! However, Cochran's Review Manager can do it quickly and easily while minimizing errors on user's end. It can also quickly generate the funnel plot which is many a times a need along with the forest plot.
http://tech.cochrane.org/revman/download

Updates
20 Jun 2012 1.1

description and requirement change

23 Jul 2012 1.2

minor code changes and description updates

14 Feb 2013 1.3

Fixed a couple of bugs; simplified the input structure

Contact us