⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pctile.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 29mar2005}{...}
{cmd:help pctile}, {cmd:help xtile}, {cmd:help _pctile}{...}
{right:dialogs:  {bf:{dialog pctile}}  {bf:{dialog xtile}}}
{hline}

{title:Title}

{p2colset 5 19 21 2}{...}
{p2col :{hi:[D] pctile} {hline 2}}Create variable containing percentiles{p_end}
{p2colreset}{...}


{title:Syntax}

{phang}
Create variable containing percentiles

{p 8 15 2}
{cmd:pctile}
{dtype}
{newvar}
{cmd:=} {it:{help exp}}
{ifin}
{weight}
[{cmd:,}
{it:{help pctile##pctile_options:pctile_options}}]

{phang}
Create variable containing quantile categories

{p 8 15 2}
{cmd:xtile}
{it:newvar} {cmd:=} {it:{help exp}}
{ifin}
{weight}
[{cmd:,} {it:{help pctile##xtile_options:xtile_options}}]

{phang}
Compute percentiles and store them in r()

{p 8 15 2}
{cmd:_pctile}
{varname}
{ifin}
{weight}
[{cmd:,} {it:{help pctile##_pctile_options:_pctile_options}}]

{synoptset 22 tabbed}{...}
{marker pctile_options}{...}
{synopthdr :pctile_options}
{synoptline}
{syntab :Main}
{synopt :{opt n:quantiles(#)}}number of quantiles; default is
{cmd:nquantiles(2)}{p_end}
{synopt :{opth g:enp(newvar:newvarp)}}generate
{it:newvarp} variable containing percentages{p_end}
{synopt :{opt alt:def}}use alternative formula for calculating
percentiles{p_end}
{synoptline}

{synoptset 22 tabbed}{...}
{marker xtile_options}{...}
{synopthdr :xtile_options}
{synoptline}
{syntab :Main}
{synopt :{opt n:quantiles(#)}}number of quantiles; default is
{cmd:nquantiles(2)}{p_end}
{synopt :{opth c:utpoints(varname)}}use values of {it:varname} as cutpoints
{p_end}
{synopt :{opt alt:def}}use alternative formula for calculating
percentiles{p_end}
{synoptline}

{synoptset 22}{...}
{marker _pctile_options}{...}
{synopthdr :_pctile_options}
{synoptline}
{synopt :{opt n:quantiles(#)}}number of quantiles; default is
{cmd:nquantiles(2)}{p_end}
{synopt :{opth p:ercentiles(numlist)}}calculate percentiles corresponding to
the specified percentages{p_end}
{synopt :{opt alt:def}}use alternative formula for calculating
percentiles{p_end}
{synoptline}

{p 4 6 2}
{opt aweight}s, {opt fweight}s, and {opt pweight}s are allowed
(see {help weight}), except when
the {opt altdef} option is specified, in which case no weights are allowed.
{p_end}


{title:Description}

{pstd}
{opt pctile} creates a new variable containing the percentiles of 
{it:{help exp}}, where the expression {it:exp} is typically just another
variable.

{pstd}
{opt xtile} creates a new variable that categorizes {it:exp} by its
quantiles.  If the {opth cutpoints(varname)} option is specified, it
categorizes {it:exp} using the values of {it:varname} as category cutpoints.
For example, {it:varname} might contain percentiles of another variable,
generated by {opt pctile}.

{pstd}
{opt _pctile} is a programmer's command that computes up to 1,000 percentiles
and places results in {hi:r()}; see
{bind:{bf:[U] 18.8 Accessing results calculated by other programs}}.
Note that {opt summarize, detail} computes some percentiles
(1, 5, 10, 25, 50, 75, 90, 95, and 99th); see {helpb summarize}.


{title:Options}

{dlgtab:Main}

{phang}{opt nquantiles(#)} specifies the number of quantiles.
It computes percentiles corresponding to percentages 100*k/m
for k=1, 2, ..., m-1, where m={it:#}.  For example, {cmd:nquantiles(10)}
requests that the 10th, 20th, ..., 90th percentiles be computed.  The default
is {cmd:nquantiles(2)}; i.e., the median is computed.

{phang}{opth "genp(newvar:newvarp)"}
specifies a new variable to be generated
containing the percentages corresponding to the percentiles.

{phang}{opt altdef} uses an alternative formula for calculating percentiles.
The default method is to invert the empirical distribution function using
averages, where the function is flat (the default is the same method used by
{helpb summarize}).
The alternative formula uses an interpolation method.  Weights cannot be used
when {opt altdef} is specified.

{phang}{opth cutpoints(varname)} requests that {opt xtile} use the
values of {it:varname}, rather than quantiles, as cutpoints for the categories.
Note that all values of {it:varname} are used, regardless of any {opt if} or
{opt in} restriction.

{phang}{opth percentiles(numlist)} requests
percentiles corresponding to the specified percentages.
Percentiles are placed in {cmd:r(r1)}, {cmd:r(r2)}, ..., etc.
For example, {cmd:percentiles(10(20)90)} requests that the 10th, 30th, 50th,
70th, and 90th percentiles be computed and placed into
{cmd:r(r1)}, {cmd:r(r2)}, {cmd:r(r3)}, {cmd:r(r4)}, and {cmd:r(r5)}.
Up to 1,000 (inclusive) percentiles can be requested.
See {it:{help numlist}} for details about specifying a {it:numlist}.


{title:Examples}

{phang}{cmd:. pctile pct = mpg, nq(10)}{p_end}
{phang}{cmd:. pctile pct = mpg, nq(10) genp(percent)}{p_end}

{phang}{cmd:. xtile quart = bp, nq(4)}{p_end}
{phang}{cmd:. xtile category = bp, cut(class)}{p_end}


{title:Also see}

{psee}
Manual:  {bf:[D] pctile}

{psee}
Online:  {helpb centile}, {helpb summarize}{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -