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

📄 svy_tabulate_twoway.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 30mar2005}{...}
{cmd:help svy: tabulate twoway}{...}
{right:dialog:  {bf:{dialog svy_tabulate_twoway:svy: tabulate twoway}}{space 8}}
{right:also see:  {helpb "svy: tabulate oneway"}{space 8}}
{right:{help "svy: tabulate postestimation"}}
{hline}

{title:Title}

{p2colset 5 35 37 2}{...}
{p2col :{hi:[SVY] svy: tabulate twoway} {hline 2}}Two-way
tables for survey data{p_end}
{p2colreset}{...}


{title:Syntax}

{pstd}
Basic syntax:

{phang2}
{cmd:svy}{cmd::} {cmdab:tab:ulate} {varname:1} {varname:2}


{pstd}
Full syntax:

{phang2}
{cmd:svy} [{it:vcetype}] [{cmd:,} {it:svy_options}]
{cmd::} {cmdab:tab:ulate} {varname:1} {varname:2} {ifin}
[{cmd:,}
{it:{help "svy: tabulate twoway##tabulate_options":tabulate_options}}
{it:{help "svy: tabulate twoway##display_items":display_items}}
{it:{help "svy: tabulate twoway##display_options":display_options}}
{it:{help "svy: tabulate twoway##statistic_options":statistic_options}}]


{pstd}
Syntax to report results:

{phang2}
{cmd:svy} [{cmd:,}
{it:{help "svy: tabulate oneway##display_items":display_items}}
{it:{help "svy: tabulate oneway##display_options":display_options}}
{it:{help "svy: tabulate oneway##statistic_options":statistic_options}}]


{synoptset 22 tabbed}{...}
INCLUDE help svy_tab_optable


{marker tabulate_options}{...}
{synopthdr:tabulate_options}
{synoptline}
{syntab:Model}
{synopt :{opt std:ize(varname)}}variable
	identifying strata for standardization{p_end}
{synopt :{opt stdw:eight(varname)}}weight variable
	for standardization{p_end}
{synopt :{opt tab(varname)}}variable
	to compute cell totals/proportions of{p_end}
{synopt :{opt miss:ing}}treat missing values like other values{p_end}
{synoptline}

{marker display_items}{...}
{synopthdr:display_items}
{synoptline}
{syntab:Table items}
{synopt :{opt cel:l}}cell proportions{p_end}
{synopt :{opt cou:nt}}weighted cell counts{p_end}
{synopt :{opt col:umn}}within-column proportions{p_end}
{synopt :{opt row}}within-row proportions{p_end}
{synopt :{opt se}}standard errors{p_end}
{synopt :{opt ci}}confidence intervals{p_end}
{synopt :{opt deff}}display the DEFF design effects{p_end}
{synopt :{opt deft}}display the DEFT design effects{p_end}
{synopt :{opt srs:subpop}}report
	design effects assuming SRS within subpopulation{p_end}
{synopt :{opt obs}}cell observations{p_end}
{synoptline}
{p 4 6 2}
When any of {opt se}, {opt ci}, {opt deff}, {opt deft}, or {opt srssubpop} are
specified, only of one {opt cell}, {opt count}, {opt column}, or {opt row} can
be specified.  If none of {opt se}, {opt ci}, {opt deff}, {opt deft}, or
{opt srssubpop} is specified, any or all of  {opt cell}, {opt count},
{opt column}, and {opt row} can be specified.

{marker display_options}{...}
{synopthdr:display_options}
{synoptline}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}confidence level for CI{p_end}
{p2coldent:+ {opt prop:ortion}}display proportions (default){p_end}
{synopt :{opt per:cent}}display percentages instead of proportions{p_end}
{synopt :{opt vert:ical}}stack confidence interval endpoints vertically{p_end}
{synopt :{opt nomarg:inals}}suppress row and column marginals{p_end}
{synopt :{opt nolab:el}}suppress displaying the value labels{p_end}
{p2coldent:+ {opt notab:le}}suppress displaying the table{p_end}
{synopt :{opt for:mat(%fmt)}}cell format, default {cmd:format(%6.0g)}{p_end}
{synopt :{opt cellw:idth(#)}}cell width{p_end}
{synopt :{opt csepw:idth(#)}}cell-separation width{p_end}
{synopt :{opt stubw:idth(#)}}stub width{p_end}
{synoptline}
{p 4 6 2}
+ {opt proportion} and {opt notable} are not shown in the dialog box.

{marker statistic_options}{...}
{synopthdr:statistic_options}
{synoptline}
{syntab:Test statistics}
{synopt :{opt pea:rson}}Pearson's chi-squared{p_end}
{synopt :{opt lr}}likelihood ratio{p_end}
{synopt :{opt nul:l}}display null-based statistics{p_end}
{synopt :{opt wald}}adjusted Wald{p_end}
{synopt :{opt llwald}}adjusted log-linear Wald{p_end}
{synopt :{opt noadj:ust}}Report unadjusted Wald statistics{p_end}
{synoptline}
{p2colreset}{...}


{title:Description}

{pstd}
{cmd:svy: tabulate} produces two-way tabulations with tests of independence
for complex survey data or for other clustered data.  See
{helpb "svy: tabulate oneway"} for one-way tabulations for complex survey
data.


{title:Options}

{phang}
{it:svy_options}; see {helpb svy}.

{dlgtab:Model}

{phang}
{opt stdize(varname)}
specifies that the point estimates be adjusted by direct standardization
across the strata identified by {it:varname}.  This option requires the
{opt stdweight()} option.

{phang}
{opt stdweight(varname)}
specifies the weight variable associated with the standard strata identified
in the {opt stdize()} option.  The standardization weights must be constant
within the standard strata.

{phang}
{opt tab(varname)} specifies that counts be
cell totals of this variable and proportions (or percentages) should be
relative to (i.e., weighted by) this variable.  For example, if this variable
denotes income, then the cell "counts" are instead totals of income for each
cell, and the cell proportions are proportions of income for each cell.

{phang}
{opt missing} specifies that missing values of {it:varname1} and
{it:varname2} are to be treated as another row or column category, rather than
be omitted from the analysis (the default).

{dlgtab:Table items}

{phang}
{opt cell} requests that cell proportions (or percentages) be
displayed.  This is the default if none of {opt count}, {opt row}, or
{opt column} are specified.

{phang}
{opt count} requests that weight cell counts be displayed.

{phang}
{opt row} or {opt column} requests that row or column proportions (or
percentages) be displayed.

{phang}
{opt se} requests that the standard errors of either cell proportions
(the default), weighted counts, or row or column proportions be displayed.
When {opt se} (or {opt ci}, {opt deff}, or {opt deft}) is specified, only one
of {opt cell}, {opt count}, {opt row}, or {opt column} can be selected.  The
standard error computed is the standard error of the one selected.

{phang}
{opt ci} requests confidence intervals for either cell proportions,
weighted counts, or row or column proportions.  The confidence intervals are
constructed using a logit transform so that their endpoints always lie between
0 and 1.

{phang}
{opt deff} and {opt deft} request that the design-effect measure DEFF and DEFT
be displayed for each cell proportion or weighted counts.  See {hi:[SVY] estat} for details.

{pmore}
Note that options {opt deff} and {opt deft} are not allowed with estimation
results that employed direct standardization of poststratification.

{phang}
{opt srssubpop} requests that DEFF and DEFT be computed using an estimate fo
SRS (simple random sampling) variance for sampling within a subpopulation.  By
default DEFF and DEFT are computed using an estimate of the SRS variance for
sampling from the entire population.  Typically, {opt srssubpop} would be
given when computing subpopulation estimates by strata or by groups of strata.

{phang}
{opt obs} requests that the number of observations for each cell be
displayed.

{dlgtab:Reporting}

{phang}
{opt level(#)}; see {help estimation options}

{phang}
{opt proportion}, the default, requests that proportions be displayed.

{phang}
{opt percent} requests that percentages be displayed.

{phang}
{opt vertical} requests that the endpoints of the confidence intervals
be stacked vertically on display.

{phang}
{opt nomarginals} requests that row and column marginals not be
displayed.

{phang}
{opt nolabel} requests that variable labels and value labels be
ignored.

{phang}
{opt notable} prevents the header and table from being displayed in the
output.  When specified, only the results of the requested test statistics are
displayed.  This option may not be specified with any of the options in
{it:display_options} except the {opt level()} option.

{phang}
{opt format(%fmt)} specifies a format for the items in the
table.  The default is {hi:%6.0g}.  See
{hi:[U] 12.5 Formats: controlling how data are displayed}.

{phang}
{opt cellwidth(#)}, {opt csepwidth(#)}, and
{opt stubwidth(#)} specify widths of table elements in the
output; see {helpb tabdisp}.  Acceptable values for the {opt stubwidth()}
option range from 4 to 32.

{dlgtab:Test statistics}

{phang}
{opt pearson} requests that the Pearson chi-squared statistic be
computed.  By default, this is the test of independence that is displayed.
The Pearson chi-squared statistic is corrected for the survey design using the
second-order correction of Rao and Scott (1984) and converted into an
F-statistic.

{pmore}
One term in the correction formula can be calculated using either
observed cell proportions or proportions under the null hypothesis (i.e., the
product of the marginals).  By default, observed cell proportions are used.
If the {opt null} option is selected, then a statistic corrected using
proportions under the null is displayed as well.  In most cases, it makes
little difference which is used, but simulations seem to indicate that for
sparse tables, using observed cell proportions is superior.

{phang}
{opt lr} requests that the likelihood-ratio test statistic for
proportions be computed.  Note that this statistic is not defined when there
are one or more zero cells in the table.  The statistic is corrected for the
survey design using exactly the same correction procedure that is used with
the {opt pearson} statistic.  Again, either observed cell proportions or
proportions under the null can be used in the correction formula.  By default,
the former is used; specifying the {opt null} option gives both the former and
the latter.  Neither variant of this statistic is recommended for sparse
tables.  For nonsparse tables, the {opt lr} statistics are very similar to the
corresponding {opt pearson} statistics.

{phang}
{opt null} modifies the {opt pearson} and {opt lr} options only.  If it
is specified, two corrected statistics are displayed.  The statistic labeled
"D-B (null)" ("D-B" stands for design-based) uses proportions under the null
hypothesis (i.e., the product of the marginals) in the Rao and Scott (1984)
correction.  The statistic labeled merely "Design-based" uses observed cell
proportions.  If {opt null} is not specified, only the correction that uses
observed proportions is displayed.

{phang}
{opt wald} requests a Wald test of whether observed weighted counts
equal the product of the marginals.  By default, an adjusted F-statistic is
produced; an unadjusted statistic can be produced by specifying
{opt noadjust}.  The unadjusted F-statistic can yield extremely
anti-conservative p-values (i.e., p-values that are too small) when the
degrees of freedom of the variance estimates (the number of PSUs minus the
number of strata) are small relative to the (R-1)*(C-1) degrees of freedom of
the table (where R is the number of rows and C is the number of columns).
Hence, the statistic produced by {opt wald} and {opt noadjust} should not be
used for inference except when it is essentially identical to the adjusted
statistic; it is only made available to duplicate the results of other
software.

{pmore}
This option must be specified at run time in order to be used on subsequent
calls to {cmd:svy} to report results.

{phang}
{opt llwald} requests a Wald test of the log-linear model of
independence.  Note that the statistic is not defined when there are one or
more zero cells in the table.  The adjusted statistic (the default) can
produce anti-conservative p-values, especially for sparse tables, when the
degrees of freedom of the variance estimates are small relative to the degrees
of freedom of the table.  Specifying {opt noadjust} yields a statistic with
more severe problems.  Neither the adjusted nor the unadjusted statistic is
recommended for inference; the statistics are only made available for
pedagogical purposes and to duplicate the results of other software.

{phang}
{opt noadjust} modifies the {opt wald} and {opt llwald} options only.
It requests that an unadjusted F-statistic be displayed in addition to the
adjusted statistic.

{pstd}
Note that {cmd:svy:} {cmd:tabulate} uses the {cmd:tabdisp} command (see
{helpb tabdisp}) to produce the table.
Only five items can be displayed in the table at one time, where the {opt ci}
option implies 2 items.
If too many items are selected, a warning will appear immediately.  To view
additional items, redisplay the table while specifying different options.



{title:Examples}

{phang}
{cmd:. webuse nhanes2b}
{p_end}
{phang}
{cmd:. svyset psuid [pweight=finalwgt], strata(stratid)}
{p_end}
{phang}
{cmd:. svy: tabulate race diabetes}
{p_end}
{phang}
{cmd:. svy: tabulate, row}
{p_end}
{phang}
{cmd:. svy: tabulate race diabetes, row se ci format(%7.4f)}
{p_end}

{phang}
{cmd:. webuse nhanes2b}
{p_end}
{phang}
{cmd:. svyset psuid [pweight=finalwgt], strata(stratid)}
{p_end}
{phang}
{cmd:. gen black = (race==2) if !missing(race)}
{p_end}
{phang}
{cmd:. gen diablck = diabetes*black}
{p_end}
{phang}
{cmd:. svy: ratio diablck/black}
{p_end}

{phang}
{cmd:. webuse nhanes2b}
{p_end}
{phang}
{cmd:. svyset psuid [pweight=finalwgt], strata(stratid)}
{p_end}
{phang}
{cmd:. svy: tabulate gender race, tab(income) row}
{p_end}

{phang}
{cmd:. webuse nhanes2b}
{p_end}
{phang}
{cmd:. gen male = (sex==1) if !missing(sex)}
{p_end}
{phang}
{cmd:. svy, subpop(male):}
{cmd: tabulate highbf sizplace, col obs pearson lr null wald}
{p_end}


{title:Also see}

{psee}
Manual:  {bf:[SVY] svy: tabulate twoway}

{psee}
Online:  {help "svy: tabulate postestimation"};{break}
{helpb "svy: tabulate oneway"},
{helpb svydes},
{helpb tabulate twoway},
{helpb test}
{p_end}

⌨️ 快捷键说明

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