📄 permute.hlp
字号:
{smcl}
{* 10mar2005}{...}
{cmd:help permute}{right:dialog: {bf:{dialog permute}}}
{hline}
{title:Title}
{p2colset 5 20 22 2}{...}
{p2col :{hi:[R] permute} {hline 2}}Monte Carlo permutation tests{p_end}
{p2colreset}{...}
{title:Syntax}
{pstd}
Compute permutation test
{p 8 16 2}
{cmd:permute}
{it:permvar}
{it:{help exp_list}}
[{cmd:,} {it:{help permute##options:options}}]
{cmd::} {it:command}
{pstd}
Report saved results
{p 8 16 2}
{cmd:permute}
[{varlist}]
[{helpb using} {it:filename}]
[{cmd:,} {it:{help permute##display_options:display_options}}]
{synoptset 23 tabbed}{...}
{marker options}{...}
{synopthdr}
{synoptline}
{syntab :Main}
{synopt :{opt r:eps(#)}}perform {it:#} random permutations, default is {cmd:reps(100)}{p_end}
{synopt :{opt le:ft}|{opt ri:ght}}compute one-sided p-values; default is two-sided{p_end}
{syntab :Options}
{synopt :{opt str:ata(varlist)}}permute within strata{p_end}
{synopt :{help prefix_saving_option:{bf:saving(}{it:filename}{bf:, ...)}}}save
results to {it:filename}; save statistics in double precision; save results to {it:filename} every {it:#} replications{p_end}
{syntab :Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synopt :{opt noh:eader}}suppress the table header{p_end}
{synopt :{opt nol:egend}}suppress the table legend{p_end}
{synopt :{opt v:erbose}}display the full table legend{p_end}
{synopt :{opt nodots}}suppress the replication dots{p_end}
{synopt :{opt noi:sily}}display any output from {it:command}{p_end}
{synopt :{opt tr:ace}}trace the {it:command}{p_end}
{synopt :{opt ti:tle(text)}}use {it:text} as title for permutation results{p_end}
{syntab :Advanced}
{synopt :{opt eps(#)}}numerical tolerance; seldom used{p_end}
{synopt :{opt nodrop}}do not drop observations{p_end}
{synopt :{opt nowarn}}do not warn when {cmd:e(sample)} is not set{p_end}
{synopt :{opt force}}do not check for {it:weights} or {cmd:svy} commands; seldom used{p_end}
{synopt :{opt reject(exp)}}identify invalid results{p_end}
{synopt :{opt seed(#)}}set random-number seed to {it:#}{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}{it:weights} are not allowed in {it:command}.
{synoptset 23}{...}
{marker display_options}{...}
{synopthdr :display_options}
{synoptline}
{synopt :{opt le:ft}|{opt ri:ght}}compute one-sided p-values;
default is two-sided{p_end}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synopt :{opt noh:eader}}suppress the table header{p_end}
{synopt :{opt nol:egend}}suppress the table legend{p_end}
{synopt :{opt v:erbose}}display the full table legend{p_end}
{synopt :{opt ti:tle(text)}}use {it:text} as title for permutation results{p_end}
{synopt :{opt eps(#)}}numerical tolerance; seldom used{p_end}
{synoptline}
{p2colreset}
{title:Description}
{pstd}
{cmd:permute} estimates p-values for permutation tests based on Monte
Carlo simulations. Typing
{pin}
{cmd:. permute} {it:permvar} {it:exp_list}{cmd:,} {opt reps(#)}{cmd::} {it:command}
{pstd}
randomly permutes the values in {it:permvar} {it:#} times, each time executing
{it:command} and collecting the associated values from the expressions in
{it:exp_list}.
{pstd}
These p-value estimates can be one-sided: Pr(T* {ul:<} T) or Pr(T* {ul:>} T).
The default is two-sided: Pr(|T*| {ul:>} |T|). Here T* denotes the value of
the statistic from a randomly permuted dataset, and T denotes the statistic,
as computed on the original data.
{pstd}
{it:permvar} identifies the variable whose observed values will be randomly
permuted.
{pstd}
{it:command} defines the statistical command to be executed.
Most Stata commands and user-written programs can be used with {cmd:permute},
as long as they follow {help language:standard Stata syntax}.
The {cmd:by} prefix may not be part of {it:command}.
{pstd}
{it:exp_list} specifies the statistics to be retrieved after the execution of
{it:command}.
{pstd}
{cmd:permute} may be used for replaying results, but this feature is only
appropriate when a dataset generated by {cmd:permute} is currently in
memory or is identified in the {opt using} option. The variables specified
in {it:varlist} in this context must be present in the respective dataset.
{title:Options}
{dlgtab:Main}
{phang}
{opt reps(#)} specifies the number of random permutations to perform. The
default is 100.
{phang}
{opt left} or {opt right} request that one-sided p-values be computed.
If {opt left} is specified, an estimate of Pr(T* {ul:<} T) is produced, where
T* is the test statistic and T is its observed value. If {opt right} is
specified, an estimate of Pr(T* {ul:>} T) is produced. By default, two-sided
p-values are computed; i.e., Pr(|T*| {ul:>} |T|) is estimated.
{dlgtab:Options}
{phang}
{opth strata(varlist)} specifies that the permutations be
performed within each stratum defined by the values of {it:varlist}.
INCLUDE help prefix_saving_option
{pmore}
See {it:{help prefix_saving_option}} for details about {it:suboptions}.
{dlgtab:Reporting}
{phang}
{opt level(#)} specifies the confidence level, as a percentage,
for confidence intervals. The default is {cmd:level(95)} or as set by
{helpb level:set level}.
{phang}
{opt noheader} suppresses display of the table header. This option
implies {opt nolegend}.
{phang}
{opt nolegend} suppresses display of the table legend. The table
legend identifies the rows of the table with the expressions they represent.
{phang}
{opt verbose} requests that the full table legend be displayed. By default,
coefficients and standard errors are not displayed.
{phang}
{opt nodots} suppresses display of the replication dots. By default, a single
dot character is displayed for each successful replication. A single red 'x'
is displayed if {it:command} returns an error or if one of the values in
{it:exp_list} is missing.
{phang}
{opt noisily} requests that any output from {it:command} be displayed. This
option implies the {opt nodots} option.
{phang}
{opt trace} causes a trace of the execution of {it:command} to be displayed.
This option implies the {opt noisily} option.
{phang}
{opt title(text)} specifies a title to be displayed above the table of
results; the default title is {cmd:Monte Carlo permutation results}.
{dlgtab:Advanced}
{phang}
{opt eps(#)} specifies the numerical tolerance for testing |T*| {ul:>} |T|,
T* {ul:<} T, or T* {ul:>} T. These are considered true if, respectively,
|T*| {ul:>} |T| - {it:#}, T* {ul:<} T + {it:#}, or T* {ul:>} T - {it:#}. The
default is {cmd:1e-7}. You will not have to specify {cmd:eps()} under normal circumstances.
{phang}
{opt nodrop} is a rarely used option to keep from dropping observations
outside the {cmd:if} and {cmd:in} qualifiers. This option has no effect when
neither {cmd:if} nor {cmd:in} is supplied.
{phang}
{opt nowarn} suppresses the printing of a warning message when {it:command}
does not set {cmd:e(sample)}.
{phang}
{opt force} suppresses the restriction that {it:command} may not specify
weights or be a {cmd:svy} command. This is a rarely used option. Use it only
if you know what you are doing!
{phang}
{opt reject(exp)} identifies an expression that indicates when results should
be rejected. When {it:exp} is true, the resulting values are reset to missing
values.
{phang}
{opt seed(#)} sets the random-number seed. Specifying this option is
equivalent to typing the following command prior to calling {cmd:permute}:
{pin2}
{cmd:. set seed} {it:#}
{title:Examples}
{phang}
{cmd:. permute y sum=r(sum), saving(permdish) right nodrop nowarn: sum y if treatment}
{phang}
{cmd:. permute using permdish, level(80)}
{phang}
{cmd:. permute treatment treatmentF=r(F) modelF=e(F), reps(1000) strata(subject) saving(permanova): panova y treatment subject}
{phang}
{cmd:. permute y z=r(z), reps(10000) nowarn: ranksum y, by(group)}
{title:Also see}
{psee}
Manual: {bf:[R] permute}
{psee}
Online: {helpb bootstrap},
{helpb ci},
{helpb jackknife},
{helpb postfile},
{helpb simulate}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -