help strate, help stmc, help stmh dialogs: strate stmh stmc
-------------------------------------------------------------------------------
Title
[ST] strate -- Tabulate failure rates and rate ratios
Syntax
Tabulate failure rates
strate [varlist] [if] [in] [, strate_options]
Calculate rate ratios with the Mantel-Haenszel method
stmh varname [varlist] [if] [in] [, options]
Calculate rate ratios with the Mantel-Cox method
stmc varname [varlist] [if] [in] [, options]
strate_options description
-------------------------------------------------------------------------
Main
per(#) units to be used in reported rates
smr(varname) use varname as reference-rate variable to
calculate SMRs
cluster(varname) cluster variable to be used by the
jackknife
jackknife report jackknife confidence intervals
missing include missing values as extra categories
level(#) set confidence level; default is level(95)
output(filename[,replace]) save summary dataset as filename; use
replace to overwrite existing filename
nolist suppress listed output
graph graph rates against exposure category
nowhisker omit confidence intervals from the graph
Plot
marker_options change look of markers (color, size, etc.)
marker_label_options add marker labels; change look or position
cline_options affect rendition of the plotted points
CI plot
ciopts(rspike_options) affect rendition of the confidence
intervals (whiskers)
Add plots
addplot(plot) add other plots to the generated graph
Y axis, X axis, Titles, Legend, Overall
twoway_options any options other than by() documented in
[G] twoway_options
-------------------------------------------------------------------------
options description
-------------------------------------------------------------------------
Main
by(varlist) tabulate rate ratio on varlist
compare(num1,den2) compare categories of exposure variable
missing include missing values as extra categories
level(#) set confidence level; default is level(95)
-------------------------------------------------------------------------
You must stset your data before using strate, stmh, and stmc; see [ST]
stset.
by is allowed with stmh and stmc; see [D] by.
fweights, iweights, and pweights may be specified using stset; see [ST]
stset.
Menu
strate
Statistics > Survival analysis > Summary statistics, tests, and
tables > Tabulate failure rates and rate ratios
stmh
Statistics > Survival analysis > Summary statistics, tests, and
tables > Tabulate Mantel-Haenszel rate ratios
stmc
Statistics > Survival analysis > Summary statistics, tests, and
tables > Tabulate Mantel-Cox rate ratios
Description
strate tabulates rates by one ore more categorical variables declared in
varlist. You can also save an optional summary dataset, which includes
event counts and rate denominators, for further analysis or display. The
combination of the commands stsplit and strate implements most of, if not
all, the functions of the special-purpose person-years programs in
widespread use in epidemiology. See Clayton and Hills (1993) and [ST]
stsplit. If your interest is solely in calculating person-years, see
[ST] stptime.
stmh calculates stratified rate ratios and significance tests by using a
Mantel-Haenszel-type method.
stmc calculates rate ratios that are stratified finely by using the
Mantel-Cox method. The corresponding significance test (the log-rank
test) is also calculated.
Both stmh and stmc can estimate the failure-rate ratio for two categories
of the explanatory variable specified by the first argument of varlist.
You can define categories to be compared by specifying them with the
compare() option. The remaining variables in varlist before the comma
are categorical variables, which are to be "controlled for" using
stratification. Strata are defined by cross-classification of these
variables.
You can also use stmh and stmc to carry out trend tests for a metric
explanatory variable. Here a one-step Newton approximation to the
log-linear Poisson regression coefficient is computed.
Options for strate
+------+
----+ Main +-------------------------------------------------------------
per(#) specifies the units to be used in reported rates. For example, if
the analysis time is in years, specifying per(1000) results in rates
per 1000 person-years.
smr(varname) specifies a reference-rate variable. strate then calculates
SMRs rather than rates. This option will usually follow using
stsplit to separate the follow-up records by age bands and possibly
calendar periods.
cluster(varname) defines a categorical variable that indicates clusters
of data to be used by the jackknife. If the jackknife option is
selected and this option is not specified, the cluster variable is
taken as the id variable defined in the st data. Specifying
cluster() implies jackknife.
jackknife specifies that jackknife confidence intervals be produced.
This is the default if weights were specified when the dataset was
stset.
missing specifies that missing values of the explanatory variables be
treated as extra categories. The default is to exclude such
observations.
level(#) specifies the confidence level, as a percentage, for confidence
intervals. The default is level(95) or as set by set level.
output(filename [,replace]) saves a summary dataset in filename. The
file contains counts of failures and person-time, rates (or SMRs),
confidence limits, and all the categorical variables in the varlist.
This dataset could be used for further calculations or simply as
input to the table command.
replace indicates that filename be overwritten, if it exists. This
option is not shown in the dialog box.
nolist suppresses the output. This is used only when saving results to a
file specified by output().
graph produces a graph of the rate against the numerical code used for
categories of varname.
nowhisker omits the confidence intervals from the graph.
+------+
----+ Plot +-------------------------------------------------------------
marker_options affect the rendition of markers drawn at the plotted
points, including their shape, size, color, and outline; see [G]
marker_options.
marker_label_options specify if and how the markers are to be labeled;
see [G] marker_label_options.
cline_options affect whether lines connect the plotted points and the
rendition of those lines; see [G] cline_options.
+---------+
----+ CI plot +----------------------------------------------------------
ciopts(rspike_options) affects the rendition of the confidence intervals
(whiskers); see [G] rspike_options.
+-----------+
----+ Add plots +--------------------------------------------------------
addplot(plot) provides a way to add other plots to the generated graph;
see [G] addplot_option.
+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------
twoway_options are any of the options documented in [G] twoway_options,
excluding by(). These include options for titling the graph (see [G]
title_options) and for saving the graph to disk (see [G]
saving_option).
Options for stmh and stmc
+------+
----+ Main +-------------------------------------------------------------
by(varlist) specifies categorical variables by which the rate ratio is be
tabulated.
A separate rate ratio is produced for each category or combination of
categories of varlist, and a test for unequal rate ratios (effect
modification) is displayed.
compare(num1,den2) specifies the categories of the exposure variable to
be compared. The first code defines the numerator categories, and
the second code defines the denominator categories.
When compare is absent and there are only two categories, the larger
is compared with the smaller; when there are more than two
categories, compare analyzes log-linear trend.
missing specifies that missing values of the explanatory variables be
treated as extra categories. The default is to exclude such
observations.
level(#) specifies the confidence level, as a percentage, for confidence
intervals. The default is level(95) or as set by set level.
Examples of strate
Setup
. webuse diet
Declare data to be survival-time data
. stset dox, origin(time doe) id(id) scale(365.25) fail(fail==1 3 13)
Split the data into ten-year age bands
. stsplit ageband, at(40(10)70) after(time=dob) trim
Tabulate failure rates per 1,000 person-years for categories of ageband
. strate ageband, per(1000)
Merge reference population dataset with current dataset on ageband
. merge m:1 ageband using http://www.stata-press.com/data/r11/smrchd
Obtain SMRs and confidence intervals
. strate ageband, per(1000) smr(rate)
Examples of stmh
Setup
. webuse diet, clear
Declare data to be survival-time data
. stset dox, origin(time dob) enter(time doe) id(id) scale(365.25)
fail(fail==1 3 13)
Split the data into ten-year age bands
. stsplit ageband, at(40(10)70) after(time=dob) trim
Calculate rate ratio comparing categories of hienergy
. stmh hienergy
Calculate rate ratio comparing categories of hienergy by categories of
ageband
. stmh hienergy, by(ageband)
Compare the effect of hienergy between jobs, controlling for ageband
. stmh hienergy ageband, by(job)
Test for trend of heart disease rates with height controlling for ageband
. stmh height ageband
Examples of stmc
Setup
. webuse diet, clear
stset the data, specifying dob as the origin
. stset dox, origin(time dob) enter(time doe) id(id) scale(365.25)
fail(fail==1 3 13)
Obtain the effect of high energy controlling for age (time) by
stratifying very finely
. stmc hienergy
Same as above, but comparing hienergy = 0 versus hienergy = 1
. stmc hienergy, c(0,1)
Saved results
stmh and stmc save the following in r():
Scalars
r(RR) overall rate ratio
Reference
Clayton, D. G., and M. Hills. 1993. Statistical Models in Epidemiology.
Oxford: Oxford University Press.
Also see
Manual: [ST] strate
Help: [ST] stci, [ST] stir, [ST] stptime, [ST] stset