📄 prtest.hlp
字号:
{smcl}
{* 08dec2004}{...}
{cmd:help prtest}, {cmd:help prtestti} {right:dialogs: {dialog prtest1:one-sample} {dialog prtest2:two-sample}}
{right:{dialog prtestby:by() two-sample} }
{right:immediate dialogs: {dialog prtesti1:one-sample} {dialog prtesti2:two-sample}}
{hline}
{title:Title}
{p2colset 5 19 21 2}{...}
{p2col :{hi:[R] prtest} {hline 2}}One- and two-sample tests of proportions{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Test that a variable has a specified proportion
{p 8 15 2}
{cmd:prtest} {varname} {cmd:==} {it:#p} {ifin} [{cmd:,} {opt l:evel(#)}]
{phang}
Test that two variables have the same proportion
{p 8 15 2}
{cmd:prtest} {it:{help varname:varname1}} {cmd:==} {it:varname2} {ifin} [{cmd:,} {opt l:evel(#)}]
{phang}
Test that a variable has the same proportion within two groups
{p 8 15 2}
{cmd:prtest} {varname} {ifin} {cmd:,} {opth "by(varlist:groupvar)"} [{opt l:evel(#)}]
{phang}
Immediate form of one-sample test of proportion
{p 8 16 2}
{cmd:prtesti} {it:#obs1} {it:#p1} {it:#p2}
[{cmd:,} {opt l:evel(#)} {opt c:ount}]
{phang}
Immediate form of two-sample test of proportion
{p 8 16 2}{cmd:prtesti} {it:#obs1} {it:#p1} {it:#obs2} {it:#p2}
[{cmd:,} {opt l:evel(#)} {opt c:ount}]
{phang}
{cmd:by} may be used with {cmd:prtest} (but not with {cmd:prtesti}); see
{helpb by}.
{title:Description}
{pstd}
{cmd:prtest} performs tests on the equality of proportions using
large-sample statistics.
{pstd}
In the first form, {cmd:prtest} tests that {varname} has a proportion of
{it:#p}. In the second form, {cmd:prtest} tests that {it:varname1} and
{it:varname2} have the same proportion. In the third form, {cmd:prtest} tests
that {it:varname} has the same proportion within the two groups defined by
{it:{help varlist:groupvar}}.
{pstd}
{cmd:prtesti} is the immediate form of {cmd:prtest}; see {help immed}.
{pstd}
The {cmd:bitest} command is a better version of the first form of
{cmd:prtest} in that it gives exact p-values. Researchers should use
{cmd:bitest} when possible, especially for small samples; see {helpb bitest}.
{title:Options}
{dlgtab:Main}
{phang}
{opth "by(varlist:groupvar)"} specifies a numeric variable that contains the
group information for a given observation. This variable must have only two
values. Do not confuse the {opt by()} option with the {cmd:by} prefix; both
may be specified.
{phang}
{opt level(#)} specifies the confidence level, as a percentage, for
confidence intervals. The default is {cmd:level(95)} or as set by
{helpb set level}.
{phang}
{opt count} specifies that integer counts instead of proportions be used in
the immediate forms of {cmd:prtest}. In the first syntax, {cmd:prtesti}
expects that {it:#obs1} and {it:#p1} are counts{hline 2}{it:#p1} {ul:<}
{it:#obs1}{hline 2}and {it:#p2} is a proportion. In the second syntax,
{cmd:prtesti} expects that all four numbers are integer counts, that
{it:#obs1} {ul:>} {it:#p1}, and that {it:#obs2} {ul:>} {it:#p2}.
{title:Examples}
{phang}{cmd:. prtest foreign==.4}{p_end}
{phang}{cmd:. prtest cure1==cure2}{p_end}
{phang}{cmd:. pretest cure, by(sex)}{p_end}
{phang}{cmd:. prtesti 50 .52 .70}{p_end}
{phang}{cmd:. prtesti 30 .4 45 .67}{p_end}
{phang}{cmd:. prtesti 30 4 .7, count}{p_end}
{phang}{cmd:. prtesti 30 4 45 17, count}
{title:Also see}
{psee}
Manual: {bf:[R] prtest}
{psee}
Online: {helpb bitest}, {helpb ci}, {helpb hotelling},
{helpb oneway}, {helpb sdtest}, {helpb signrank}, {helpb ttest}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -