{smcl}
{hline}
help for {hi:csmatch}{right:(SJ4-3: st0070)}
{hline}

{title:Matched cohort study risk ratio estimates}

{p 8 12 2}
{cmd:csmatch}
{it:depvar expvar}
[{cmd:if} {it:exp}]
[{cmd:in} {it:range}]
{cmd:,}
	{cmdab:g:roup}{cmd:(}{it:varname}{cmd:)}
	[{cmd:level}{cmd:(.}{it:#}{cmd:)}
	{cmdab:personv:ar}{cmd:(}{it:varlist}{cmd:)}
	{cmdab:pairv:ar}{cmd:(}{it:varlist}{cmd:)} ]


{title:Description}

{p 4 4 2} {cmd:csmatch} estimates the risk ratio for the outcome, {it:depvar},
given the exposure, {it:expvar}; {it:depvar} and {it:expvar} must be binary
and coded as 0 or 1. The command can be applied to matched-pair cohort data
when pairs are matched on one or several variables.


{title:Options}

{p 4 8 2}
{cmd:group}{cmd:(}{it:varname}{cmd:)} specifies the identifier variable
(numeric or string) for the matched pairs. The data must be organized so that
there is one record for each subject, i.e., two records for each pair.

{p 4 8 2}
{cmd:level}{cmd:(.}{it:#}{cmd:)} specifies the confidence level, as a fraction,
for the estimates. Unlike many Stata commands, {cmd:level()} must be a
fraction between zero and 1, such as .95, not a percentage, such as 95%.
The default is {cmd:level(.95)}.

{p 4 8 2}
{cmd:personvar}{cmd:(}{it:varlist}{cmd:)} specifies a list of potential
confounding variables that are specified to a person or individual, 
such as age or sex. These must be numeric.

{p 4 8 2}
{cmd:pairvar}{cmd:(}{it:varlist}{cmd:)} specifies a list of variables that are 
the same for each member of a pair but may differ between pairs. If you 
studied vehicle occupants paired in their cars, examples might include speed
or crash angle. These must be numeric.

{p 8 8 2}
    A total of only 6 confounding or effect modifying variables are allowed. 
    Since each {cmd:personvar()} level confounder is used twice, once for each
    member of the pair, you can have any of the following combinations:{p_end}
{tab}1. 3 {cmd:personvar()} level confounders and no {cmd:pairvar()} effect modifiers
{tab}2. 2 {cmd:personvar()} level confounders and 2 {cmd:pairvar()} level effect modifiers
{tab}3. 1 {cmd:personvar()} level confounder and 4 {cmd:pairvar()} level effect modifiers
{tab}4. 6 {cmd:pairvar()} level confounders
{p 8 8 2} (Since any number of levels is allowed within each confounding 
variable, you could get around these restrictions by combining two
variables into one. For example, you could you have a variable that
classifies occupants both by sex and category of age. However, a
set of data would have to be very large to allow stratification by more
than 6 person level variables or more than 3 pair level variables.)


{title:Saved results}

{p 4 4 2}{cmd:csmatch} saves results in {cmd:r()}:
		
{p 8 8 2}Scalars

{p 8 20 2}{cmd:r(prct)}{space 2}count of matched pairs that are discordant on the exposure in the estimation sample{p_end}
{p 8 8 2}{cmd:r(rr)}{space 4}risk-ratio estimate{p_end}
{p 8 8 2}{cmd:r(vlrr)}{space 2}variance ln risk ratio{p_end}

{p 8 8 2}
When the results are stratified, all the above are saved for each stratum i.
For example, the stratum 3 result for the risk ratio is {cmd:r(rr3)}, and the
stratum 3 count of pairs is stored in {cmd:r(prct3)}. The total count of pairs
is in {cmd:r(prct)}. The overall estimates are stored without numbers,
{cmd:r(rr)}, {cmd:r(vlrr)}. Adjusted estimates (summarized across the strata)
have the prefix "a", such as {cmd:r(arr)} and {cmd:r(vlarr)}. The crude risk
ratio, based upon all available data, and the adjusted risk ratio are shown.
These may differ either because of confounding, or because the adjusted
estimate is based upon strata within which a risk ratio and variance can be
estimated. If there are many strata, estimates may not be possible within some
strata; thus, the crude and adjusted estimates might differ just because
records in some strata are not included in the analysis. To identify this
situation, estimates are presented for crudenew, a crude risk ratio estimate
which is generated only from records which contributed to the stratified
estimates; these results are saved in {cmd:r(rrn)}, {cmd:r(vlrrn)}, and
{cmd:r(prctn)}.


{title:Remarks}

{p 4 4 2}
In a matched-pair cohort analysis, the crude risk ratio estimate is
the same as the estimate adjusted for the matching variables. In other words,
confounding by the matching variables is eliminated if the matching is precise 
and if there is no imbalance due to loss of follow-up or missing data. 
The crude risk ratio estimate is the same as the estimate based on the 
matched pairs, summarized by Mantel-Haenszel methods. This program 
produces matched Mantel-Haenszel risk ratio estimates that are adjusted for 
the matching variables. The variance estimator was described by Greenland 
and Robins (1985) and Rothman (1986). Details and a worked example 
appear in Rothman and Greenland (1998).

{p 4 4 2}
In stratified output E+ means exposed, E- means not exposed, 0+ means had
the outcome, and 0- means did not have the outcome. Note that pairs in 
which neither had the outcome do not contribute to the analysis.


{title:Examples}

{p 8 12 2}{cmd:. csmatch died seatbelt, group(vehnum)}

{p 8 12 2}{cmd:. csmatch died driver, g(vehnum) personv(agecat seatbelt) pairv(rollover)}


{title:Author}

{p 4 4 2}
Peter Cummings. Affiliations: Dept of Epidemiology, School of Public 
Health & Community Medicine and Harborview Injury Prevention & 
Research Center (HIPRC), University of Washington, Seattle, WA, 
USA. Home and office address: 250
Grandview Dr, Bishop CA 93514, USA. Email
{browse "mailto:peterc@u.washington.edu":peterc@u.washington.edu}
if you find problems with this program.


{title:References}

{p 4 8 2}
Cummings, P., B. McKnight, and N. S. Weiss. 2003. Matched-pair cohort methods 
in traffic crash research. {it:Accident Analysis and Prevention} 35: 131-141.

{p 4 8 2}
Cummings, P., B. McKnight, and S. Greenland. 2003. Matched cohort methods in 
injury research. {it:Epidemiological Reviews} 25: 43-50.

{p 4 8 2}
Greenland, S. and J. M. Robins. 1985. Estimation of a common effect parameter 
from sparse follow-up data. {it:Biometrics} 41: 55-68.

{p 4 8 2}
Lachin, J. M. 2000. 
{it:Biostatistical Methods: The Assessment of Relative Risks}. 
New York: John Wiley & Sons.

{p 4 8 2}
Nurminen, N. 1981. Asymptotic efficiency of general noniterative estimation 
of common relative risk. {it:Biometrika} 68: 525-530.

{p 4 8 2}
Rothman, K. J. 1986. {it:Modern Epidemiology}. 1st ed. 
Boston: Little, Brown and Company.

{p 4 8 2}
Rothman, K. J. and S. Greenland. 1998. {it:Modern Epidemiology}. 2nd ed.
Philadelphia: Lippincott-Raven.
