Nick Cox wrote:
**** Beginning of quote
In the case of t tests, a work-around is obtained
by noting that the results of
regress <response> <binary variable>
are equivalent to
ttest <response>, by(<binary variable>)
so that -outreg- or -estout- (which I think
you mean here rather than -estimates-) can then be
used.
*** End of quote
This is the case if the user wanted an equal-variance t-test. However,
if the user wanted an unequal-variance t-test (complete with
Satterthwaite corrected degrees of freedom), then the results are not
quite equivalent.
It is possible to do unequal-variance t-tests with Satterthwaite degrees
of freedom, saving the results, using -regress-, -parmby- and
-metaparm-. For instance, in the -auto- data, the user can type
. sysuse auto, clear
. parmby "regress weight", by(foreign) norestore
. gene byte iwt=!foreign-foreign
. tempfile tf1
. metaparm [iwei=iwt] , saving(`tf1', replace)
. append using `tf1'
. list
This replaces the -auto- data in memory with a new dataset (or
resultsset), with 1 observation for each of 3 parameters (the mean
weight for US cars, the mean weight for non-US cars, and the difference
between those 2 means), and variables storing the estimates, degrees of
freedom, confidence limits and P-values for these parameters. Such a
dataset can then be processed further to produce an output table,
possibly using the -listtex- package.
The packages -listtex-, -metaparm- and -parmest- (which includes
-parmby-) are all downloadable from SSC. So are a lot of other packages
which the user can use to generate plots and tables in Stata, using
output datasets (or resultssets). More about how to use these packages
can be found in Newson (2003) and in the Stata User Meeting
presentations of Newson (2002), Newson (2004), Newson (2005) and Newson
(2006), all of which can be downloaded from ny website at
http://www.imperial.ac.uk/nhli/r.newson/
using either a browser or the -net- command in Stata.
I hope this helps.
Roger
References
Creating plots and tables of estimation results using parmest and
friends. Presented at the 8th UK Stata User Meeting, 20-21 May, 2002.
Newson R. Confidence intervals and p-values for delivery to the end
user. The Stata Journal 2003; 3(3): 245-269.
Newson R. From datasets to resultssets in Stata. Presented at the 10th
UK Stata User Meeting, 28-29 June, 2004.
Newson R. Generalized confidence interval plots using commands or
dialogs. Presented at the 11th UK Stata User Meeting, 17-18 May, 2005.
Newson R. Resultssets, resultsspreadsheets and resultsplots in Stata.
Presented at the 4th German Stata User Meeting, 31 March, 2006.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/