stata esttablesuest 原理 为什么是chi2统计量

推荐这篇日记的豆列
······
&(389人关注)
&(138人关注)
&(1人关注)estout - Making Regression Tables in Stata
Documentation for estpost
help estpost
also see: , , ,
http://repec.org/bocode/e/estout
-------------------------------------------------------------------------------
estpost -- Post results from various commands in e()
description
------------------------------------------------------------------
post summary statistics
post summary statistics
post two-group mean-comparison tests
post two-group tests of proportions
post one-way or two-way frequency table
post frequency table for survey data
post correlations
post confidence intervals for means,
proportions, or counts
post confidence intervals for means
and percentiles of survival time
post results from margins (Stata 11 or newer)
------------------------------------------------------------------
Description
estpost posts results from various Stata commands in e() so that they can
be tabulated using
after estpost to
list the elements saved in e().
+-----------+
----+ summarize +--------------------------------------------------------
estpost summarize [] [] [] [] [, detail meanonly
listwise casewise quietly esample ]
posts summary statistics computed by . If no varlist is
specified, summary statistics are calculated for all variables in the
aweights, fweights, and iweights are allowed (however, iweights may not
be used with the detail option); see .
Options are:
detail and meanonly as described in help .
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to determine the used observations for each variable
separately without regard to whether other variables are missing.
casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following results vectors are saved in e():
number of observations
sum of variable
sum of the weights
variance (unless meanonly)
standard deviation (unless meanonly)
1st percentile (detail only)
5th percentile (detail only)
10th percentile (detail only)
25th percentile (detail only)
50th percentile (detail only)
75th percentile (detail only)
90th percentile (detail only)
95th percentile (detail only)
99th percentile (detail only)
e(skewness)
skewness (detail only)
e(kurtosis)
kurtosis (detail only)
. sysuse auto, clear
(1978 Automobile Data)
. estpost summarize price mpg rep78 foreign
-------------+-------------------------------------------------------
-------------+---------------------------------
. esttab ., cells("mean sd count") noobs
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
+---------+
----+ tabstat +----------------------------------------------------------
estpost tabstat
[] [] [] [, statistics( [...])
columns(variables|statistics) by(varname) nototal missing
listwise casewise quietly esample ]
posts summary statistics computed by . aweights and fweights are
Options are:
statistics(), columns(), by(), nototal, and missing as described in
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to determine the used observations for each variable
separately without regard to whether other variables are missing.
casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
A vector of results is saved in e() for each specified variable or
statistic, depending on columns().
. sysuse auto, clear
(1978 Automobile Data)
. estpost tabstat price mpg rep78, listwise ///
statistics(mean sd)
Summary statistics: mean sd
for variables: price mpg rep78
-------------+---------------------------------
. esttab ., cells("price mpg rep78")
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
. estpost tabstat price mpg rep78, listwise ///
statistics(mean sd) columns(statistics)
Summary statistics: mean sd
for variables: price mpg rep78
-------------+----------------------
. esttab ., cells("mean(fmt(a3)) sd")
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
. estpost tabstat price mpg rep78, by(foreign) ///
statistics(mean sd) columns(statistics) listwise
Summary statistics: mean sd
for variables: price mpg rep78
by categories of: foreign
-------------+----------------------
-------------+----------------------
-------------+----------------------
. esttab ., main(mean) aux(sd) nostar unstack ///
noobs nonote label
-----------------------------------------------------------
-----------------------------------------------------------
Mileage (mpg)
Repair Record 1978
-----------------------------------------------------------
----+ ttest +------------------------------------------------------------
estpost ttest
[] [], by(groupvar) [ unequal welch listwise
casewise quietly esample ]
posts two-group mean-comparison tests computed by .
Options are:
by(), unequal, and welch as described in help .
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to determine the used observations for each variable
separately without regard to whether other variables are missing.
casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following results vectors are saved in e():
mean difference
number of observations
standard error of difference
t statistic
degrees of freedom
lower one-sided p-value
two-sided p-value
upper one-sided p-value
number of observations in group 1
mean in group 1
number of observations in group 2
mean in group 2
. sysuse auto, clear
(1978 Automobile Data)
. estpost ttest price mpg headroom trunk, by(foreign)
-------------+-------------------------------------------------------
price | -312.2587
mpg | -4.945804
headroom |
-------------+-------------------------------------------------------
headroom |
-------------+----------------------
headroom |
. esttab ., wide
-----------------------------------------
-----------------------------------------
-----------------------------------------
-----------------------------------------
t statistics in parentheses
* p&0.05, ** p&0.01, *** p&0.001
+--------+
----+ prtest +-----------------------------------------------------------
estpost prtest
[] [], by(groupvar) [ listwise casewise
quietly esample ]
posts two-group tests of proportions computed by .
Options are:
by() as described in help .
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to determine the used observations for each variable
separately without regard to whether other variables are missing.
casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following results vectors are saved in e():
difference in proportions
number of observations
standard error of difference
standard error under Ho
z statistic
lower one-sided p-value
two-sided p-value
upper one-sided p-value
number of observations in group 1
proportion in group 1
number of observations in group 2
proportion in group 2
. webuse cure2, clear
. estpost prtest cure, by(sex)
-------------+-------------------------------------------------------
cure | -.0729167
-------------+-------------------------------------------------------
-------------+----------------------
. esttab ., cell("b se0 z p")
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
+----------+
----+ tabulate +---------------------------------------------------------
One-way table:
estpost tabulate varname [] [] [] [, missing nolabel sort
subpop(varname) nototal quietly esample ]
Two-way table:
estpost tabulate varname1 varname2 [] [] [] [, missing
nolabel chi2 exact[(#)] gamma lrchi2 taub v nototal quietly
estpost tabulate posts a one-way or two-way table computed by .
aweights, fweights, and iweight see .
Options are:
missing, nolabel, sort, subpop(), chi2, exact, gamma, lrchi2, taub,
and v as described in help .
nototal to omit row and column totals.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following vectors are saved in e():
frequency counts
cumulative percent (one-way only)
column percent (two-way only)
row percent (two-way only)
If two-way options such as, e.g., chi2 or exact are specified, the
results of the tests added as scalars in e() using the names documented
The value labels of the row variable are stored as names in the saved
vectors, unless no label exceeds 30 characters or contains unsuitable
characters in which case the labels are stored in macro e(labels). Type
varlabels(`e(labels)') in
to use the labels stored
e(labels). The value labels of the column variable are stored as equation
names or, alternatively, in macro e(eqlabels). Type
eqlabels(`e(eqlabels)') in
to use the labels stored in
e(eqlabels).
. sysuse auto, clear
(1978 Automobile Data)
. estpost tabulate foreign
-------------+---------------------------------
Domestic |
-------------+---------------------------------
. esttab ., cells("b pct(fmt(2)) cumpct(fmt(2))") noobs
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
. estpost tabulate rep78 foreign
-------------+--------------------------------------------
-------------+--------------------------------------------
-------------+--------------------------------------------
. esttab ., cell(colpct(fmt(2))) unstack noobs
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
. esttab ., cell(colpct(fmt(2)) count(fmt(g) par keep(Total))) ///
collabels(none) unstack noobs nonumber nomtitle
eqlabels(, lhs("Repair Rec."))
varlabels(, blist(Total "{hline @width}{break}"))
---------------------------------------------------
Repair Rec.
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
+---------------+
----+ svy: tabulate +----------------------------------------------------
One-way table:
estpost svy [vcetype] [, svy_options] : tabulate varname [] [] [,
nototal quietly esample
Two-way table:
estpost svy [vcetype] [, svy_options] : tabulate varname1 varname2 [
] [] [, nototal quietly esample
estpost svy: tabulate posts a one-way or two-way table for complex survey
data computed by . Stata 9 or newer is required.
Options are as described in
, respectively, and:
nototal to omit row and column totals (synonym for nomarginals).
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
estpost svy: tabulate posts results in e() (except e(V)) as documented in
and , respectively,
and adds or replaces the following matrices:
cell, column, or row proportions or percentages,
or weighted counts, depending on options
standard errors of e(b)
lower confidence bounds for e(b)
upper confidence bounds for e(b)
deff for variances of e(b)
deft for variances of e(b)
cell proportion or percentages
row proportion or percentages (two-way only)
column proportion or percentages (two-way only)
weighted counts
number of observations
The value labels of the row variable are stored as names in the saved
vectors, unless no label exceeds 30 characters or contains unsuitable
characters in which case the labels are stored in macro e(labels). Type
varlabels(`e(labels)') in
to use the labels stored
e(labels). The value labels of the column variable are stored as equation
names or, alternatively, in macro e(eqlabels). Type
eqlabels(`e(eqlabels)') in
to use the labels stored in
e(eqlabels).
. webuse nhanes2b, clear
. svyset psuid [pweight=finalwgt], strata(stratid)
pweight:finalwgt
VCE:linearized
Single unit:missing
Strata 1:stratid
SU 1:psuid
FPC 1:&zero&
. estpost svy: tabulate race
(running tabulate on estimation sample)
Number of strata=
Number of obs
Number of PSUs=
Population size
-----------------------
| proportions
----------+------------
-----------------------
proportions
cell proportions
saved vectors:
cell proportions
standard errors of cell proportions
lower 95% confidence bounds for cell proportions
upper 95% confidence bounds for cell proportions
deff for variances of cell proportions
deft for variances of cell proportions
cell proportions
e(count) =
weighted counts
number of observations
. esttab ., cell("b(f(4)) se deft")
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
. estpost svy: tabulate race diabetes, row percent
(running tabulate on estimation sample)
Number of strata=
Number of obs
Number of PSUs=
Population size
-------------------------------
diabetes, 1=yes,
----------+--------------------
Other | 97.97
Total | 96.58
-------------------------------
row percentages
Uncorrectedchi2(2)
Design-basedF(1.52, 47.26)=
P = 0.0000
saved vectors:
row percentages
standard errors of row percentages
lower 95% confidence bounds for row percentages
upper 95% confidence bounds for row percentages
deff for variances of row percentages
deft for variances of row percentages
cell percentages
row percentages
column percentages
e(count) =
weighted counts
number of observations
. esttab ., b(2) se(2) scalars(F_Pear) nostar unstack ///
mtitle(`e(colvar)')
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
Standard errors in parentheses
+-----------+
----+ correlate +--------------------------------------------------------
estpost correlate
[] [] [] [, matrix nohalf print(#)
bonferroni sidak listwise casewise quietly esample ]
posts the pairwise correlations between the first variable in varlist and
the remaining variables. Alternatively, if the matrix option is
specified, all pairwise correlations among the variable in varlist are
aweights, fweights, iweights and pweight see .
Methods and formulas are as described in . However, if
pweights are specified, the p-values of the correlations are computed as
suggested in the Stata FAQ on "Estimating correlations with survey data".
Options are:
matrix to return the (lower triangle) of the correlation matrix of
the variables in varlist. The default is to return the pairwise
correlations between the first variable in varlist and the
remaining variables.
nohalf to return the full correlation matrix rather than just the
lower triangle. nohalf has no effect unless matrix is specified.
print(#) to suppress (leave blank) correlation coefficients with a
p-value larger than #. print() only affects what is saved in
e(rho), e(p), and e(count), but not what is saved in e(b).
bonferroni to apply the Bonferroni adjustment to the p-values.
sidak to apply the Sidak adjustment to the p-values.
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to handle missing values by pairwise deletion, i.e.
all available observations are used to calculate a pairwise
correlation without regard to whether variables outside that pair
are missing. casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following vectors are saved in e():
correlation coefficients
correlation coefficients
number of observations
. sysuse auto, clear
(1978 Automobile Data)
. estpost correlate price mpg turn foreign, matrix
-------------+--------------------------------------------
mpg | -.4685967
turn | -.7191863
foreign | -.6310965
. esttab ., not unstack compress noobs
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
* p&0.05, ** p&0.01, *** p&0.001
. bysort foreign: eststo: ///
estpost correlate price turn weight rep78, listwise
------------------------------------------------------------
-& Domestic
-------------+--------------------------------------------
rep78 | -.0193249
(est1 stored)
------------------------------------------------------------
-& Foreign
-------------+--------------------------------------------
(est2 stored)
. esttab est1 est2, not mtitles
--------------------------------------------
--------------------------------------------
--------------------------------------------
--------------------------------------------
* p&0.05, ** p&0.01, *** p&0.001
----+ ci +---------------------------------------------------------------
estpost ci [] [] [] [] [, binomial poisson
exposure(varname) exact wald wilson agresti jeffreys level(#)
listwise casewise quietly esample ]
posts standard errors and confidence intervals computed by . aweights
and fweights are allowed, but aweights may not be specified with options
binomial or poisson; see .
Options are:
binomial, poisson, exposure(), exact, wald, wilson, agresti,
jeffreys, and level() as described in help .
listwise to handle missing values through listwise deletion, meaning
that an observation is omitted from the estimation sample if any
of the variables in varlist is missing for that observation. The
default is to determine the used observations for each variable
separately without regard to whether other variables are missing.
casewise is a synonym for listwise.
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following results vectors are saved in e():
number of observations
estimate of standard error
lower bound of confidence interval
upper bound of confidence interval
. sysuse auto, clear
(1978 Automobile Data)
. estpost ci price mpg rep78, listwise
(confidence level is 95%)
-------------+-------------------------------------------------------
. esttab ., cells("b lb ub") label
-----------------------------------------------------------
-----------------------------------------------------------
Mileage (mpg)
Repair Record 1978
-----------------------------------------------------------
Observations
-----------------------------------------------------------
. eststo exact: estpost ci foreign, binomial exact
(confidence level is 95%)
-------------+-------------------------------------------------------
. eststo agresti: estpost ci foreign, binomial agresti
(confidence level is 95%)
-------------+-------------------------------------------------------
. esttab exact agresti, cells(lb ub) mtitles
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
----+ stci +-------------------------------------------------------------
estpost stci [] [] [, by(groupvar) median rmean emean p(#) ccorr
level(#) quietly esample ]
posts confidence intervals for means and percentiles of survival time
computed by . Stata 9 or newer is required.
Options are:
by(groupvar) to report separate summaries for each group defined by
groupvar, along with an overall total.
median, rmean, emean, p(), ccorr, and level() as described in help
quietly to suppress the output.
esample to mark the estimation sample in e(sample).
The following vectors are saved in e():
number of subjects
median (if median the default)
#th percentile (if p(#) specified)
restricted mean (if rmean specified)
extended mean (if emean specified)
standard error
lower bound of CI
upper bound of CI
. webuse page2, clear
. estpost stci
(confidence level is 95%)
-------------+-------------------------------------------------------
. esttab ., cell("count p50 se lb ub") noobs compress
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
. estpost stci, by(group)
(confidence level is 95%)
-------------+-------------------------------------------------------
-------------+-------------------------------------------------------
. esttab ., cell("count p50 se lb ub") noobs compress
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
+---------+
----+ margins +----------------------------------------------------------
estpost margins [] [] [] [] [, quietly
posts results from the
command, that was introduced in Stata 11.
Options are:
quietly to suppress the output.
margins_opions as described in help
(except post).
estpost margins replaces the current e(b) and e(V) with r(b) and r(V)
and also copies all other matrixes, scalars, and macros from
into e() (possibly replacing identically named existing entries).
. sysuse auto, clear
(1978 Automobile Data)
. quietly logit foreign price mpg weight
. estpost margins, dydx(*) quietly
. esttab ., cell("b se") pr2
--------------------------------------
--------------------------------------
--------------------------------------
pseudo R-sq
--------------------------------------
Ben Jann, Institute of Sociology, University of Bern, jann@soz.unibe.ch
[R] estimates
help for , , , ,}

我要回帖

更多关于 stata est table 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信