📄 _mtest.hlp
字号:
{smcl}
{* 10mar2005}{...}
{cmd:help _mtest}{right:also see: {help undocumented}}
{hline}
{title:Title}
{p 4 16 2}
{hi:_mtest} {hline 2} Adjustment for multiple (simultaneous) testing
{title:Syntax}
{p 8 15 2}
{cmd:_mtest} {cmdab:q:uery}
{p 8 15 2}
{cmd:_mtest} {cmdab:s:yntax}{cmd:,}
{cmdab:m:test}[{cmd:(}{it:name}{cmd:)}]
{p 8 15 2}
{cmd:_mtest} {cmdab:a:djust} {it:matname}{cmd:,}
{cmdab:m:test}[{cmd:(}{it:name}{cmd:)}]
[{cmdab:p:index:(}{it:#}{cmd:)}
{cmd:if(}{it:#}{cmd:)}
{cmd:replace}
{cmd:append}]
{p 8 15 2}
{cmd:_mtest} {cmdab:f:ooter} {it:col} {it:type} [{it:symbol}]
{title:Description}
{pstd}When testing multiple hypotheses simultaneously, based on a series of
p-values for tests of the individual hypotheses, adjustments should be made
to these p-values in order to bound the probability of falsely accepting
at least one of these hypotheses (see Miller 1986 for details). {cmd:_mtest}
implements a number of adjustment methods, and is designed to easily
incorporate additional methods.
{pstd}
{cmd:_mtest} has the following subcommands.
{tab}{cmd:_mtest query}
{p 12 12 2}returns in {cmd:r(methods)} the names of the supported methods.
Programmers can use this feature to produce messages (for instance, an error
message) that list the available methods for the {cmd:mtest()} option they are
adding to their command. When new methods are added to {cmd:_mtest}, programs
that use the results of {cmd:_mtest query} will automatically have those new
methods listed.
{tab}{cmd:_mtest syntax}
{p 12 12 2}returns in {cmd:r(method)} the unabbreviated name of the method
implied by {it:name}, it returns {hi:none} if {cmd:mtest} was specified
without an argument, it returns nothing if mtest was not specified, and
it displays an error message otherwise.
{tab}{cmd:_mtest adjust}
{p 12 12 2}computes p-values that are adjusted for multiple (simultaneous)
testing, based on p-values of n tests (p_1,...p_n), stored in a column of
a matrix. It expects a nxk matrix, and returns in {cmd:r(result)} a
column-vector of adjusted p-values. Alternatively, it returns the input
matrix with the adjusted p-values replacing the original p-values (option
{cmd:replace}) or appended as an extra column (option {cmd:append}).
{tab}{cmd:_mtest footer}
{p 12 12 2}displays a footer for a table describing how the p-values were
adjusted. {it:col} specifies the column to which the message should be
right aligned. {it:symbol} is a character used to display what p-values
where adjusted.
{title:Options}
{phang}{cmd:mtest(}{it:name}{cmd:)}
specifies the adjustment method. The following methods are supported.
{p 10 16 2}{cmdab:b:onferroni} (Bonferroni's method)
{p 14 24 2}p' = min(1, np)
{p 10 16 2}{cmdab:h:olm} (Holm's method)
{p 14 24 2}p' = min(1,n(p) p), where n(p) is the number of p-s smaller than p
{p 10 16 2}{cmdab:s:idak} (Sidak's method)
{p 14 24 2}p' = 1 - (1-p)^n
{p 10 16 2}{cmdab:no:adjust}
{p 14 24 2}p' = p, i.e., no adjustment is made
{pmore}
Caller commands should typically allow option {cmd:mtest} be specified
without an argument, implying that multiple testing be performed, but
the p-values not be adjusted for multiple testing. This is equivalent
to specifying {cmd:mtest(noadjust)}. {cmd:_mtest} implements this
behavior as well.
{phang}{cmd:pindex(}{it:#}{cmd:)}
specifies the index of the column in {it:matname} that contains the
p-values.
{phang}{cmd:if(}{it:#}{cmd:)}
specifies the index of the column in {it:matname} that indicates
which rows of {it:matname} are to be included or excluded in the
computations. Those rows where the value in this column is unequal
to 0 and not missing are included. The elements in the returned
matrix that correspond to excluded tests are set to missing. If
{cmd:if} is not specified, all rows are used.
{phang}{cmd:replace}
specifies that {cmd:_mtest} returns in {cmd:r(result)} the matrix
{it:matname} with the column of p-values replaced by the adjusted
p-values.
{phang}{cmd:append}
specifies that {cmd:_mtest} returns in {cmd:r(result)} the matrix
{it:matname} with a column of adjusted p-values added at the end of
the matrix.
{title:Example}
{pstd}
The following code fragment demonstrates how to write a command that
supports multiple testing via {cmd:_mtest}. This code need not be
modified in any way if new methods for dealing with multiple testing
are added in {cmd:_mtest} ("inheritance").
{cmd:program define mycmd, rclass}
{cmd: syntax} {it:...} {cmd:[, Mtest Mtest2(passthru)} {it:...} {cmd:]}
{cmd: _mtest syntax, `mtest2' `mtest'}
{cmd: local mtest `r(method)'}
{cmd: if "`mtest'" != "" {c -(}}
{it:...}
{cmd: tempname tests}
{cmd: mat `tests' = J(n,3,0)}
{it:...}
{p 16 16 2}fill the matrix tests, with p-value in column 3
{cmd: _mtest adjust `tests', pindex(3) replace}
{p 16 16 2}displays multiple tests, with adjusted p-value in column 3
{cmd: mat return test r(result)}
{cmd: {c )-}}
{p 12 12 2}do any further computations{break}
and display simultaneous test results
{cmd:end}
{pstd}
Beware that you specify the options {cmd:Mtest} and {cmd:Mtest2(passthru)} in
this order. The trick to implementing options that take an optional argument
is to specify the argument accepting option after the non accepting option.
If you list them in the other order, it will not work.
{pstd}
The {cmd:_mtest syntax} subcommand is provided so that the correct syntax
of the {cmd:mtest} or {cmd:mtest2()} options can be verified before indulging
in possibly time consuming computations for the multiple tests. If early
syntax checking is not performed, {cmd:_mtest adjust} will still capture the
problem, but only after a delay that may irritate the user.
{title:Acknowledgment}
{pstd}
{cmd:_mtest} was written by Jeroen Weesie, Dept of Sociology, Utrecht
University, the Netherlands.
{title:References}
{phang}Benjamini, Y. & Hochberg, Y. 1995.
"Controlling the false discovery rate: a practical and powerful approach
to multiple testing."
{it:J Royal Statistical Society}, Series B, 57(1), 289-300.
{phang}Holm, S. (1979)
"A simple sequentially rejective multiple test procedure."
{it: Scandinavian Journal of Statistics}, 6: 65-70.
{phang}Jaccard, J., Becker, M., & Wood, G. 1984.
"Pairwise multiple comparisons: A review."
{it:Psychological Bulletin}, 96: 589-596.
{phang}Miller, Rupert G, Jr. 1986.
{it:Simultaneous Statistical Inference}. Second Edition.
New York: Springer
{phang}Shaffer J.P. 1986.
"Modified sequentially rejective multiple test procedures".
{it:Journal of the American Statistical Association}, 81: 826-831.
{phang}Wright, S.P. 1992.
"Adjusted P-values for simultaneous inference."
{it:Biometrics} 48: 1005-1013.
{title:Also See:}
{psee}
Online: {helpb oneway}; {helpb hettest}, {helpb test},
{helpb testnl}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -