Scatter plot for CEA

I prepared this figure for:

Xie X, Vondeling H. Cost-utility analysis of intensive blood glucose control with metformin versus usual care in overweight type 2 diabetes mellitus patients in Beijing, P.R. China. Value Health 2008; 11 Suppl 1:S23-S32 Link: http://www.ncbi.nlm.nih.gov/pubmed/18387063

 

Poster: Xie X, Vondeling H. metformin for overweight type 2diabetes, Annual meeting HTAi (health technology assessment international) 2008 (July 6 to 9, 2008; Montreal)

 

 

************************************************************************************

*Program: C:\Documents and Settings\xie\My Documents\Paper\Scatter_dia.sas         *

*Programer : Xuanqian Xie                                                          *

*Data set Created: 3 June, 2008                                                    *

*Purpose: Draw Scatter plot and CEAC(Used in poster at HTAi, Diabetics in China)   *

*Methods:  Using two SAS macros written by Michael Friendly(In Appendix)           *

************************************************************************************;

 

 

/*1.Draw scatter plot with three WTP lines*/

goptions reset;

 

/*Create input data set for Maximum WTP= 20,000,  50,000, 100,000*/

data anno1 (where= ( -300000 < y < 300000));*/To provide rational range of v-axis;

    do group = 1 to 3; */four lines;

       do ic = -5 to 5 by 0.01; */To provide rational range of h-axis;

           if group =1 then  y = 50000*ic;

           if group =2 then  y = 134900*ic;

           if group =3 then  y = 0*ic;

           output;

       end;       

    end;

run;

 

data anno2;

    group =4 ;

      do y= -300000 to 300000 by 100;

       ic=0*y;

       output;

    end;

run;

 

data ann03;

    set anno1 anno2;

      by group;

      where group ne 1;

run;

 

 

/*Use Macro %lines To create an Annotate dataset to draw Maximum WTP lines.*/

/* The Macro lines in Appendix 1*/

%lines (data=ann03, x=ic, y=y, COLOR= RED black black, line=  2 1 1, class=group, size=3);

 

/*Input data for scatter plot*/

%let pa=%str(C:\Documents and Settings\xie\My Documents\Paper\Scatter_dia.xls);

proc import

    datafile="&pa"

    out=aa

    DBMS=EXCEL2000 REPLACE;

    getnames=yes;

    range="Scatter$a25:c10025";

run;

 

/*Format the IC*/

proc format;

   value IC    

                 -400000='-400K'

                 -300000='-300K'

                 -250000='-250K'

                 -200000='-200K'

                 -150000='-150K'

                 -100000='-100K'

                  -50000='-50K'

                 0='0K'

                  50000='50K'

                 100000='100K'

                 150000='150K'

                 200000='200K'

                 250000='250K'

                 300000='300K'

                 400000='400K';

run;

 

data aa;

    set aa;

    format Incremental_Cost IC.;

run;

 

/*Define h-axis and v-axis*/

    axis1 label=(h=3.5 f=Arial  'Incremental effectiveness (QALY)') width=2 length=100

          order=(-5 to 5 by 1) value=(f='Times New Roman' h=28pt) minor=none;

    axis2 label=(h=3.5  f=Arial  a=90 'Incremental cost (RMB)') width=2 length=38

          order=(-300000 to 300000 by 100000 )  value=(f='Times New Roman' h=28pt) minor=none;

 

/*Use Macro %ellipses to produce sactter plot with three WTP lines*/

/* The Macro ellipses in Appendix 2*/

%ellipses(data=aa, x=Incremental_Effectiveness, y=Incremental_Cost, PVALUE=.5 .95, points=10000,

        inanno=_lines_, haxis=axis1, vaxis=axis2, hsym=0.20,name=11, line=1, width=3, colors=blue);

 

 

 

 

 

 

 

/*Appendix 1*/

 

/*--------------------------------------------------------------*

  *    Name: lines.sas                                           *

  *   Title: Create an Annotate dataset to draw lines in a plot  *

  *     Doc: http://www.math.yorku.ca/SCS/sasmac/lines.html      *

  *--------------------------------------------------------------*

  *  Author:  Michael Friendly            <friendly@yorku.ca>    *

  * Created:  3 Jan 2000                                         *

  * Revised: 18 Jan 2006 11:17:38                                *

  * Version: 1.0                                                 *

  *                                                              *

  *--------------------------------------------------------------*/

 

/*Appendix 2: */

 

 /*-------------------------------------------------------------------*

  *    Name: ellipses.sas                                             *

  *   Title: Plot bivariate data ellipses                             *

  *     Doc: http://www.math.yorku.ca/SCS/sasmac/ellipses.html        *

  *-------------------------------------------------------------------*

  *  Author:  Michael Friendly            <friendly@YorkU.ca>         *

  * Created: 24 Oct 2006 16:10:05                                     *

  * Revised: 15 May 2007 11:07:45                                     *

  * Version:  2.4-2                                                   *

  * Requires: IML                                                     *

  *                                                                   *

  *    Renamed from contour.sas, originally from SSSG.  contour.sas   *

  *    will no longer be enhanced.                                    *

  *                                                                   *

  *  Added VAR= shorthand for x,y,z                                   *

  *  Added PLOTOPT= to supply options to plot statement               *

  *  Avoid diag(wt) to calculate cov when unweighted                  *

  *                                                                   *

  *-------------------------------------------------------------------*/