Listings

Listing 8.1 Commands for a Multi-way Event-Count Table

! DATAB Example 8.2 - Multi-way Event-Count Table 

NAMES id hosp byr bmo bdy inyr inmo indy tryr trmo trdy

  dose numbtf aft dxyr dxmo dxdy brstat @

TRAN IF brstat == 2 then DELETE ENDIF ;

     aftcat = 1 + (aft >= 15) + (aft >= 20) + (aft >= 25) +

             (aft >= 30) + (aft >= 50) ;

@

LEVELS aftcat 6 @

TABULATE OVER aftcat @

CATEGORY dose

      -1   -1   Missing

       0    0   Zero

       0  100   0-

     100  200   100-

     200  300   200-

     300  400   300-

     400  998 ] 400+

@

EVENT brstat AS cases @

RMEAN  aft  @

RMEAN  dose @

INPUT ../exdata/tbfchrt.dat @

SHOW @

DATA ; TO exam8_2.lst FORMAT (5F7.0,2F9.2) HEADER @

END

 

 

Listing 8.2 Commands for an Event-Time Table with Two Time Scales;
Using the GETRATES Command to Add Expected Rates to an Event-Time Table

! Commands for an Event-Time Table with Two Time Scales; Using the GETRATES Command to Add Expected Rates to an Event-Time Table

 

NAMES id hosp byr bmo bdy inyr inmo indy tryr trmo trdy

  dose numbtf aft dxyr dxmo dxdy brstat @

TRAN IF brstat == 2 then DELETE ENDIF ;

     aftcat = 1 + (aft >= 15) + (aft >= 20) + (aft >= 25) +

             (aft >= 30) + (aft >= 50) ;

     dxyr = dxyr + 1900 ;

     inyr = inyr + 1900 ;

@

! Reset Exit Date if necessary

TRAN IF dxyr > 1975 THEN

        dxyr = 1975 ; dxmo = 12 ; dxdy = 31

     ENDIF

@

LEVELS aftcat 6 @

TABULATE  OVER aftcat

@

CATEGORY dose AS DCAT

   -1 / Missing 0 / 0 / 100 / 200 / 300 / 400 ] 998

@

TIME age FROM byr MONTH bmo DAY bdy AS agecat

  25 / 30 / 40 / 50 / 60 / 75 / 85

@

CALENDAR time TO 1975 12 31

  1930 1 1

  1940 1 1

  1950 1 1

  1960 1 1

  1970 1 1

@

ENTRY inyr inmo indy @

EXIT dxyr dxmo dxdy @

TTRAN year = cyear(time) + cmonth(time)/12  @

FCOUNT @

EVENT brstat AS cases @

RMEAN aft  @

RMEAN dose @

RMEAN age  @

RMEAN year @

REJECT id byr bmo bdy dxyr dxmo dxdy brstat; TO brrej.out

FORM (8f7.0); ALL @

INPUT ..\exdata\ tbfchrt.dat @

GETRATES RPATH ..\exrates\  USINC LISTCAUSE @

GETRATES CAUSE 22 USE F AS ctbrrt@

SHOW #_rtfact @

TRAN expctd = ctbrrt * pyr/#_rtfact @

SUM cases expctd @

SAVE; TO tabtbf @

DATA; TO exam8.9.out

FORMAT (6f7.0,f10.3,2f5.0,3f8.2,f9.2,g12.4,f8.3) HEADER @

END