Another possibility is to use the -parmest- package, downloadable from
SSC. This creates an output dataset (or resultsset) with 1 observation
per parameter (or 1 observation per parameter per by-group), and data on
parameter names, estimates, t- or z-statistics, P-values, confidence
intervals, and other parameter attributes optionally specified by the
user.
I hope this helps.
Best wishes
Roger
Roger Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
www.imperial.ac.uk/nhli/r.newson/
Opinions expressed are those of the author, not of the institution.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nuno Soares
Sent: 30 November 2006 16:42
To: [email protected]
Subject: st: RE: RE: Accessing the t-stat and p-values in a regression
Thanks Maarten!
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maarten Buis
Sent: quinta-feira, 30 de Novembro de 2006 16:25
To: [email protected]
Subject: st: RE: Accessing the t-stat and p-values in a regression
--- Nuno Soares wrote:
> I'm running a OLS using the -regression- and -statsby- commands in
> order to save the results into a dataset. Does anyone knows how to
> access the t-stats and p-values associated with the estimated
coefficients?
Stata doesn't store the t-stats or the p-values, but you can get the
t-stats
if you know the t-stats are the parameter estimates divided by the
standard
error, both of which are stored by -regress-. And once you know the
t-stat
you can find the p-value, using the function ttail, see: -help
function-.
Also see the example
below:
*----------- begin example ----------------- sysuse auto, clear regress
price weight mpg if foreign == 0 regress price weight mpg if foreign ==
1
statsby tweight = (_b[weight]/_se[weight]) /*
*/ pweight = (2 * ttail(e(df_r), abs(_b[weight]/_se[weight]))) /*
*/ tmpg = (_b[mpg]/_se[mpg]) /*
*/ pmpg = (2 * ttail(e(df_r), abs(_b[mpg]/_se[mpg]))) /*
*/, by(for): regress price weight mpg list
*----------- end example ------------------
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* 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/
*
* 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/
*
* 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/