st: RE: RE: Accessing the t-stat and p-values in a regression

 From "Nuno Soares" To Subject st: RE: RE: Accessing the t-stat and p-values in a regression Date Thu, 30 Nov 2006 16:41:54 -0000

```Thanks Maarten!

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten Buis
Sent: quinta-feira, 30 de Novembro de 2006 16:25
To: statalist@hsphsun2.harvard.edu
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

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/
```