# timely

How to download and try this example

    Usage: pl -gif timely.htm

    Uses the data file timely.dat

    #declare CEN

    // do page title using proc page
    #proc page
      pagesize: 8.5 11
      #if @DEVICE in gif,png
        scale: 0.5
      #endif
      title: Timeliness of Problem Resolution, By Center
    	 03-31-99

    // do column headers using proc annotate
    // and proc line
    #proc annotate
      location: 1 9.2
      textdetails: align=C size=10
      text:	CENTER

    #proc line
      points 0.7 9 1.3 9

    #proc annotate
      location: 1.9 9.75
      textdetails: align=C size=10
      text:	Number of
    	Problems
    	Reported &
    	Resolved

    #proc line
      points 1.5 9 2.3 9

    // read in data file using proc getdata
    #proc getdata
      file: timely.dat

    // keep only fields 3 and 9 using proc transform
    #proc transform
      keepfields: 3 9

    //  define the plotting area and do Y axis using proc areadef
    #proc areadef
      rectangle: 2.5 2 7.5 9.0
      axes: Y
      xrange: 0 90
      yscaletype: categories
      ycategories:
    	01 Sea
    	02 Alb
            06 NY
    	07 Buf
    	08 DC
    	09 Orl
    	10 Hou
    	11 Cin
    	13 Chi
    	15 Tor
    	16 LV
    	18 Mon
    	19 Rch
    	20 Nor
    	21 NO
    	22 Mai
    	\
    	All

      yaxis.stubdetails: align=L adjust=-1.5,0 size=10
      yaxis.axisline: yes
      yaxis.ticlen: 0
      yaxis.stubs: usecategories

    //  do an X axis on bottom and top using proc xaxis
    #proc xaxis
      grid: color=green
      label: Number of days
      #saveas: AX
      stubs: inc 20

    // do a second x axis across the top..
    #proc xaxis
      #clone: AX
      location: max
      stubdetails: adjust=0,0.3
      labeldetails: adjust=0,0.7

    // do rangebar for all clinics using proc rangebar
    #proc rangebar
      axis: x
      barloc: All
      datafield: 2
      mediansym: shape=circle fillcolor=0.2 style=filled radius=0.05
      nlocation: 1.9
      barwidth: 0.15
      nword: N=@@N
      tailmode: 5/95
      textdetails: size=10
      #saveas: B

    #loop

        #set CEN = $nextstub(2)
        #if $strlen(@CEN) < 1
          #break
        #endif

      #proc print
      label: @CEN

      // do rangebar for each center using proc rangebar
      #proc rangebar
      #clone B
      select: @@1 = @CEN
      barloc: @CEN
      showoutliers: yes

    #endloop

    // do annotations at bottom of page using proc annotate
    #proc annotate
      location: 1 1.4
      textdetails: align=L
      text:
    	Dot = median.
    	Box = 25th through 75th percentile.
    	Tails = 5th and 95th percentile.
    	Outliers are marked with a circle or asterisk.
    	\
    	\
    	Includes only 2-year-contracted centers.