
From  Michael Alexander <Michael.Alexander@aifs.gov.au> 
To  statalist@hsphsun2.harvard.edu 
Subject  Re: st: RE: RE: outreg/estimates type commands for ttest 
Date  Fri, 25 Aug 2006 09:48:04 +1000 
Nick Cox wrote:
**** Beginning of quote
In the case of t tests, a workaround 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 equalvariance ttest. However,
if the user wanted an unequalvariance ttest (complete with
Satterthwaite corrected degrees of freedom), then the results are not
quite equivalent.
It is possible to do unequalvariance ttests 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=!foreignforeign
. 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 nonUS cars, and the difference
between those 2 means), and variables storing the estimates, degrees of
freedom, confidence limits and Pvalues 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, 2021 May, 2002.
Newson R. Confidence intervals and pvalues for delivery to the end
user. The Stata Journal 2003; 3(3): 245269.
Newson R. From datasets to resultssets in Stata. Presented at the 10th
UK Stata User Meeting, 2829 June, 2004.
Newson R. Generalized confidence interval plots using commands or
dialogs. Presented at the 11th UK Stata User Meeting, 1718 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/
© Copyright 1996–2017 StataCorp LLC  Terms of use  Privacy  Contact us  What's new  Site index 