.-
  help for ^csjl^                                                 version 1.1.0
.-


Extension to cs command for exposures with more than two categories
-------------------------------------------------------------------


 ^csjl^ case_var exp_var [weight] [^if^ exp] [^in^ range]
   [ ^, rr rd at type(^[ ^rr rd at^ ]^) r^ef^() c^ase^() mis^sing ^by(^varlist^)^
       ^l^evel^()^ ^subt^ab ^subp^ct ^tab^le ^tabp^ct ^chi ex^act ^dec() to^tal ]
 
   ^fweights^ allowed; see ^help^ @weights@.


Description
-----------

^csjl^ is an extension of the ^cs^ command (for cohort studies where all subjects
are followed for the same length of time) that produces risk estimates and 
count tables for exposure variables with more than two levels.  The analysis 
can additionally be reported by substratum defined by a ^by()^ variable.  Risk 
estimates can be risk ratio (^rr^), risk difference (^rd^) or attributable risk 
(^at^). All selected estimates shown on the same line.  Testing of homogenity in 
the individual 2x2 tables can also be performed using the ^chi^ or ^exact^ options.


Options
-------

^rr^         requests risk ratios 
           (default option if no risk estimate options are specified)
^rd^         requests risk differences  
^at^         requests attributable risk fraction among exposed (prevented)
^type()^     an alternative way to request one or more of the risk estimates 
           (use this if you want to specify the output order, with spaces
           between entries. This option overrides options ^rr^, ^rd^ and ^at^)

^chi^        requests a Chi-sq test for subtables 
^exact^      requests Fisher's exact test (two-sided) for subtables 
           (specification of ^exact^ overrides the ^chi^ option)

^case()^     indicates group for cases in case_var (1 or 2, default: 2)
^ref()^      exposure group to be used as reference group (1...k, default: 1)
^missing^    includes missing values as a group in exposure variable
^level()^    specifies level for confidence interval for risk estimates
           (default: $S_level) 
^dec()^      specifies number of decimal places in output values (default: 2)
^tot^        requests display of total N and # of cases in the output

^by()^       specifies variables that define substratum (multiple variables
           are processed sequentially and are not crossed)

^table^      requests an overall count table 
^tabpct^     requests an overall count table with row percentages 
^subtab^     requests count tables for the overall data and for substrata 
           defined by the ^by()^ variable(s)
^subpct^     requests count tables with row percentages for the overall data 
           and for substrata defined by the ^by()^ variable(s)
(the table options also report an overall Chi-sq test if ^chi^ is specified)
                       
                        
Examples
--------

A minimal command yields output of the following form:

 . ^csjl icd kmgrp^

 Warning: no risk estimates specified, rr assumed

 icd       Cancer
 kmgrp     Distance 

 Outcome: icd                        Risk Ratio     
----------------------------------------------------
  kmgrp            N   cases       rr  [ 95% CI  ] 
----------------------------------------------------
     0-25 km    1208     203      ref. group 
    26-62 km    1434     237      0.98  0.83  1.17 
   63-120 km    1942     588      1.80  1.56  2.08 
     120+ km    2418     986      2.43  2.12  2.78 
----------------------------------------------------


When multiple estimates are requested, they are placed side by side. 
The user might wish to widen the display and log line sizes: 

 . ^set log linesize 100^
 . ^set display linesize 100^
 . ^csjl icd kmgrp, type(rd rr)^

 icd       Cancer
 kmgrp     Distance 

 Outcome: icd                     Risk Difference      Risk Ratio     
----------------------------------------------------------------------
  kmgrp            N   cases       rd  [ 95% CI  ]   rr  [ 95% CI  ] 
----------------------------------------------------------------------
     0-25 km    1208     203      ref. group 
    26-62 km    1434     237     -0.00 -0.03  0.03  0.98  0.83  1.17 
   63-120 km    1942     588      0.13  0.11  0.16  1.80  1.56  2.08 
     120+ km    2418     986      0.24  0.21  0.27  2.43  2.12  2.78 
----------------------------------------------------------------------


Options ^ref()^, ^dec()^, ^exact^, ^total^ and ^missing^ modify the output:
^ref(3)^ specifies that the 3rd level of the exposure variable is the 
reference exposure group; ^dec(3)^ requests 3 digits in the output; ^exact^
requests that Fisher's exact test be displayed; ^total^ causes the total 
counts to be displayed at the bottom of the report; and ^missing^ requests
that the group of missing data in the exposure variable be tabulated as well.

 . ^csjl icd kmgrp, rr ref(3) dec(3) exact total missing^

 icd       Cancer
 kmgrp     Distance 

 Outcome: icd                        Risk Ratio     
--------------------------------------------------------------
  kmgrp            N   cases      rr   [ 95% CI  ]   exact p  
--------------------------------------------------------------
     0-25 km    1208     203     0.555 0.481 0.640     0.000 
    26-62 km    1434     237     0.546 0.477 0.624     0.000 
   63-120 km    1942     588      ref. group 
     120+ km    2418     986     1.347 1.240 1.463     0.000 
           .      21      12     1.887 1.295 2.750     0.015 
      totals    7023    2026
--------------------------------------------------------------


Option ^case()^ specifies the level of the case_var to be used as the case
group and ^chi^ requests a chi-square statistic:

 . ^csjl icd kmgrp, rr ref(3) missing total dec(3) case(1) chi^

 icd       Cancer
 kmgrp     Distance 

 Outcome: icd                        Risk Ratio     
------------------------------------------------------------------
  kmgrp            N   cases      rr   [ 95% CI  ]   Chi2    p  
------------------------------------------------------------------
     0-25 km    1208    1005     1.193 1.148 1.240   71.9  0.000 
    26-62 km    1434    1197     1.197 1.153 1.243   84.5  0.000 
   63-120 km    1942    1354      ref. group 
     120+ km    2418    1432     0.849 0.813 0.888   51.5  0.000 
           .      21       9     0.615 0.375 1.008    7.1  0.008 
      totals    7023    4997
------------------------------------------------------------------


One or more ^by()^ variables can be specified, as can a frequency weight. 
An unstratified table is presented first, followed by tables for each
substratum of a ^by()^ variable. Note that stratification is ONLY on one 
^by()^ variable at a time. 
 
 . ^csjl icd kmgrp [fw=wt], rr by(sex)^

 icd       Cancer
 kmgrp     Distance 

 Outcome: icd                        Risk Ratio     
----------------------------------------------------
  kmgrp            N   cases       rr  [ 95% CI  ] 
----------------------------------------------------
unstratified
     0-25 km    1208     203      ref. group 
    26-62 km    1434     237      0.98  0.83  1.17 
   63-120 km    1942     588      1.80  1.56  2.08 
     120+ km    2418     986      2.43  2.12  2.78 

by sex (Gender)

  sex == unknown
     0-25 km     102      90      ref. group 
    26-62 km     157     123      0.89  0.80  0.99 
   63-120 km     512     456      1.01  0.93  1.09 
     120+ km     867     789      1.03  0.96  1.11 

  sex == male
     0-25 km     675      68      ref. group 
    26-62 km     911      93      1.01  0.75  1.36 
   63-120 km     954     109      1.13  0.85  1.51 
     120+ km    1080     153      1.41  1.07  1.84 

  sex == female
     0-25 km     431      45      ref. group 
    26-62 km     366      21      0.55  0.33  0.91 
   63-120 km     476      23      0.46  0.28  0.75 
     120+ km     471      44      0.89  0.60  1.33 
----------------------------------------------------


Specification of a table option (^table^, ^tabpct^, ^subtab^, and ^subpct^) 
invokes Stata's ^tabulate^ command to add a count table to the output. 
Option ^chi^ also affects the tabulation output:

 . ^csjl icd kmgrp [fw=wt], rr table chi exact^

 icd       Cancer
 kmgrp     Distance 

table is:
           |        Cancer
  Distance |        No        Yes |     Total
-----------+----------------------+----------
   0-25 km |      1005        203 |      1208 
  26-62 km |      1197        237 |      1434 
 63-120 km |      1354        588 |      1942 
   120+ km |      1432        986 |      2418 
-----------+----------------------+----------
     Total |      4988       2014 |      7002 

          Pearson chi2(3) = 361.6058   Pr = 0.000

 Outcome: icd                        Risk Ratio     
--------------------------------------------------------------
  kmgrp            N   cases       rr  [ 95% CI  ]   exact p  
--------------------------------------------------------------
     0-25 km    1208     203      ref. group 
    26-62 km    1434     237      0.98  0.83  1.17     0.875 
   63-120 km    1942     588      1.80  1.56  2.08     0.000 
     120+ km    2418     986      2.43  2.12  2.78     0.000 
--------------------------------------------------------------


Authors
-------
   Jens M. Lauritsen,  jm.lauritsen@@dadlnet.dk
   County of Funen, Odense, Denmark

   Thomas J. Steichen,  steicht@@rjrt.com
   Winston-Salem, NC, USA  


Also see 
---------
   On-line: help for @epitab@, @cs@, @set display linesize@, @csi@, @level@
