📄 dstdize.hlp
字号:
{smcl}
{* 31mar2005}{...}
{cmd:help dstdize}, {cmd:help istdize}{right:dialogs: {bf:{dialog dstdize}} {bf:{dialog istdize}}}
{hline}
{title:Title}
{p2colset 5 20 22 2}{...}
{p2col :{hi:[R] dstdize} {hline 2}}Direct and indirect standardization{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Direct standardization
{p 8 16 2}
{cmd:dstdize} {it:charvar} {it:popvar} {it:stratavars} {ifin}
{cmd:,} {opt by(groupvars)}
[{it:{help dstdize##dstdize_options:dstdize_options}}]
{phang}
Indirect standardization
{p 8 16 2}{cmd:istdize} {it:casevar_s} {it:popvar_s} {it:stratavars} {ifin}
{opt us:ing(filename)} {cmd:,} {{opt pop:vars(casevar_p popvar_p)} |
{opt rate(ratevar_p{#|crudevar_p})}}
[{it:{help dstdize##istdize_options:istdize_options}}]
{synoptset 31 tabbed}{...}
{marker dstdize_options}{...}
{synopthdr :dstdize_options}
{synoptline}
{syntab :Main}
{p2coldent: * {opth "by(varlist:groupvars)"}}study populations{p_end}
{synopt :{opt us:ing(filename)}}use standard population from Stata dataset{p_end}
{synopt :{opt ba:se(#|string)}}use standard population from a value of grouping
variable{p_end}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{syntab :Options}
{synopt :{opt sav:ing(filename)}}save computed standard population distribution
as a Stata dataset{p_end}
{synopt :{opth f:ormat(%fmt)}}final summary table display format; default is
{cmd:%10.0g}{p_end}
{synopt :{opt pr:int}}include table summary of standard population in output{p_end}
{synopt :{opt nores}}suppress saving results in {opt r()}{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}* {opt by(groupvars)} is required.{p_end}
{synoptset 31 tabbed}{...}
{marker istdize_options}{...}
{synopthdr :istdize_options}
{synoptline}
{syntab :Main}
{p2coldent: * {opt pop:vars(casevar_p popvar_p)}}for standard population,
{it:casevar_p} is number of cases and {it:popvar_p} is number of individuals{p_end}
{p2coldent : * {opt rate(ratevar_p{#|crudevar_p})}}{it:ratevar_p} is stratum-specific rates and {it:#} or {it:crudevar_p} is the crude case rate value or variable{p_end}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{syntab :Options}
{synopt :{opth "by(varlist:groupvars)"}}variables identifying study populations{p_end}
{synopt :{opth f:ormat(%fmt)}}final summary table display format; default is
{cmd:%10.0g}{p_end}
{synopt :{opt pr:int}}include table summary of standard population in output{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2} * Either {opt popvars(casevar_p popvar_p)} or
{opt rate(ratevar_p{#|crudevar_p})} must be specified.
{title:Description}
{pstd}
{cmd:dstdize} produces standardized rates for {it:charvar}, which are
defined as a weighted average of the stratum-specific rates. These rates can
be used to compare the characteristic {it:charvar} across different
populations identified by {it:groupvars}. Weights used in the standardization
are given by {it:popvar}; the strata across which the weights are to be
averaged are defined by {it:stratavars}.
{pstd}
{cmd:istdize} produces indirectly standardized rates for a study population
based on a standard population. This standardization method is appropriate
when the stratum-specific rates for the population being studied either are
unavailable or are based on small samples and thus are unreliable. The
standardization uses the stratum-specific rates of a standard population to
calculate the expected number of cases in the study population(s), sums
them, and then compares them with the actual number of cases observed. The
standard population is specified in another Stata data file named in the
{opt using()} option.
{pstd}
In addition to calculating rates, the indirect standardization command
produces point estimates and exact confidence intervals of the study
population's standardized mortality ratio (SMR), if death is the event of
interest, or the standardized incidence ratio (SIR) for studies of incidence.
Here we refer to both ratios as SMR.
{pstd}
{it:casevar_s} is the variable name for the study population's number of
cases (usually deaths). It must contain integers, and each subpopulation
identified by {it:groupvar} must have the same values or missing.
{pstd}
{it:popvar_s} identifies the number of subjects represented by each
observation in the study population.
{pstd}
{it:stratavars} define the strata.
{title:Options for dstdize}
{dlgtab:Main}
{phang}
{opth "by(varlist:groupvars)"} is required for the dstdize command; it specifies the
variables identifying the study populations. If {opt base()} is also
specified, there must be only one variable in the {opt by()} group. If you do
not have a variable for this option, you can generate one using something like
{cmd:gen newvar=1} and then use {newvar} as the argument to this option.
{phang}
{opt using(filename)} or {opt base(#|string)} may be used to specify the
standard population. You may not specify both options. {opt using(filename)}
supplies the name of a {cmd:.dta} file containing the standard population.
The standard population must contain the {it:popvar} and the {it:stratavars}.
If {opt using()} is not specified, the standard population distribution will
be obtained from the data. {opt base(#|string)} allows you to specify one of
the values of {it:groupvar}{hline 2}either a numeric value or a
string{hline 2}to be used as the standard population. If neither {opt base()}
nor {opt using()} is specified, the entire dataset is used to determine an
estimate of the standard population.
{phang}
{opt level(#)} specifies the confidence level, as a percentage, for a
confidence interval of the adjusted rate. See {helpb level}.
{dlgtab:Options}
{phang}
{opt saving(filename)} saves the computed standard population distribution as
a Stata dataset that can be used in further analyses.
{phang}
{opth format(%fmt)} specifies the format in which to display the final summary
table. The default is {cmd:%10.0g}.
{phang}
{opt print} includes a table summary of the standard population before
displaying the study population results.
{phang}
{opt nores} suppresses saving results in {opt r()}. This option is seldom
specified. Some saved results are stored in matrices. If there are more
groups than {cmd:matsize}, {cmd:dstdize} will report "matsize too
small". In that case, you can either increase {cmd:matsize} or specify
{opt nores}. The {opt nores} option does not change how results are
calculated but specifies that results need not be left behind for use by other
programs.
{title:Options for istdize}
{dlgtab:Main}
{phang}
{opt using(filename)}, which is required, supplies the name of a {cmd:.dta}
file containing the standard population. The standard population must contain
the {it:popvar} and the {it:stratavars}.
{phang}
{opt popvars(casevar_p popvar_p)} or
{opt rate(ratevar_p #|ratevar_p crudevar_p)} must be specified with
{cmd:istdize}. Only one of these two options is allowed. These options are
used to describe the standard population's data.
{pmore}
With {opt popvars(casevar_p popvar_p)}, {it:casevar_p} records the
number of cases (deaths) for each stratum in the standard population, and
{it:popvar_p} records the total number of individuals in each stratum
(individuals at risk).
{pmore}
With {opt rate(ratevar_p{#|crudevar_p})}, {it:ratevar_p} contains the
stratum-specific rates. {it:#}|{it:crudevar_p} specifies the crude case rate
either by a variable name or optionally by the crude case rate value. If a
crude rate variable is used, it must be the same for all observations,
although it could be missing for some.
{phang}
{opt level(#)} specifies the confidence level, as a percentage, for a
confidence interval of the adjusted rate. See {helpb level}.
{dlgtab:Options}
{phang}
{opth "by(varlist:groupvars)"} specifies variables identifying study
populations when more than one exists in the data. If this option is not
specified, the entire study popuation is treated as one group.
{phang} {opth format(%fmt)} specifies the format in which to display the final
summary table. The default is {cmd:%10.0g}.
{phang}
{opt print} outputs a table summary of the standard population before
displaying the study population results.
{title:Examples}
{phang}{cmd:. dstdize hpb pop age race sex, by(city year)}
{phang}{cmd:. istdize deaths pop age race sex using USstd.dta, by(year) rate(USrate crude)}{p_end}
{phang}{cmd:. istdize deaths pop age race sex using USstd, by(year) rate(USrate 0.0095)}
{title:Also see}
{psee}
Manual: {bf:[R] dstdize}
{psee}
Online: {help epitab}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -