help tabodds dialog: tabodds
-------------------------------------------------------------------------------
Title
[ST] epitab -- Tables for epidemiologists (tabodds)
Syntax
tabodds var_case [expvar] [if] [in] [weight] [, tabodds_options]
tabodds_options description
-------------------------------------------------------------------------
Main
binomial(varname) number of subjects variable
level(#) set confidence level; default is level(95)
or report odds ratio
adjust(varlist) report odds ratios adjusted for the variables in
varlist
base(#) reference group of control variable for odds ratio
cornfield use Cornfield approximation to calculate CI of the
odds ratio
woolf use Woolf approximation to calculate SE and CI of
the odds ratio
tb calculate test-based confidence intervals
graph graph odds against categories
ciplot same as graph option, except include confidence
intervals
CI plot
ciopts(rcap_options) affect rendition of the confidence bands
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
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
-------------------------------------------------------------------------
fweights are allowed; see weight.
Menu
Statistics > Epidemiology and related > Tables for epidemiologists >
Tabulate odds of failure by category
Description
tabodds is used with case-control and cross-sectional data. It tabulates
the odds of failure against a categorical explanatory variable expvar.
If expvar is specified, tabodds performs an approximate chi-squared test
of homogeneity of odds and a test for linear trend of the log odds
against the numerical code used for the categories of expvar. Both tests
are based on the score statistic and its variance. When expvar is
absent, the overall odds are reported. The variable var_case is coded
0/1 for individual and simple frequency records and equals the number of
cases for binomial frequency records.
Optionally, tabodds tabulates adjusted or unadjusted odds ratios, using
either the lowest levels of expvar or a user-defined level as the
reference group. If adjust(varlist) is specified, it produces odds
ratios adjusted for the variables in varlist along with a (score) test
for trend.
Options
+------+
----+ Main +-------------------------------------------------------------
binomial(varname) supplies the number of subjects (cases plus controls)
for binomial frequency records. For individual and simple frequency
records, this option is not used.
level(#) specifies the confidence level, as a percentage, for confidence
intervals. The default is level(95) or as set by set level.
or specifies that odds ratios be produced; see base() for details about
selecting a reference category. By default, tabodds will calculate
odds.
adjust(varlist) specifies that odds ratios adjusted for the variables in
varlist be calculated.
base(#) specifies that the #th category of expvar be used as the
reference group for calculating odds ratios. If base() is not
specified, the first category, corresponding to the minimum value of
expvar, is used as the reference group.
cornfield requests that the Cornfield approximation be used to calculate
the confidence interval of the odds ratio. By default, tabodds
reports a standard-error-based interval, with the standard error
coming from the square root of the variance of the score statistic.
woolf requests that the Woolf approximation, also known as the Taylor
expansion, be used for calculating the standard error and confidence
interval for the odds ratio. By default, tabodds reports a
standard-error-based interval, with the standard error coming from
the square root of the variance of the score statistic.
tb requests that test-based confidence intervals be calculated wherever
appropriate in place of confidence intervals based on other
approximations or exact confidence intervals. We recommend that
test-based confidence intervals be used only for pedagogical purposes
and never for research work.
graph produces a graph of the odds against the numerical code used for
the categories of expvar. All graph options except connect() are
allowed. This option is not allowed with either the or option or the
adjust() option.
ciplot produces the same plot as the graph option, except that it also
includes the confidence intervals. This option may not be used with
either the or option or the adjust() option.
+---------+
----+ CI plot +----------------------------------------------------------
ciopts(rcap_options) is allowed only with the ciplot option. It affects
the rendition of the confidence bands; see [G] rcap_options.
+------+
----+ 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.
+-----------+
----+ 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).
Examples
Setup
. webuse bdesop
Tabulate the odds of cancer against alcohol consumption
. tabodds case alcohol [fw=freq]
Same as above, but report odds ratios rather than odds
. tabodds case alcohol [fw=freq], or
Tabulate Mantel-Haenszel age-adjusted odds ratios
. tabodds case alcohol [fw=freq], adjust(age)
Same as above, but adjust for tobacco use instead of age
. tabodds case alcohol [fw=freq], adjust(tobacco)
Saved results
tabodds saves the following in r():
Scalars
r(odds) odds
r(lb_odds) lower bound for odds
r(ub_odds) upper bound for odds
r(chi2_hom) chi-squared test of homogeneity
r(p_hom) p-value for test of homogeneity
r(df_hom) degrees of freedom for chi-squared test of homogeneity
r(chi2_tr) chi-squared for score test for trend
r(p_trend) p-value for score test for trend
Also see
Manual: [ST] epitab
Help: [ST] epitab; [R] bitest, [R] ci, [R] tabulate twoway, [ST]
glossary