Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE: RE: st: RE: extract t-values


From   "Bastian Steingros" <Steingros@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: RE: RE: st: RE: extract t-values
Date   Fri, 07 Nov 2008 12:44:20 +0100

Hi Martin,
voicing concern might be logical when looking at my descriptions of the problem. I think I should have detailed it. 
However, the command you last emailed is exactly what I searched!!!

Many thanks!

have a nice day
B





-------- Original-Nachricht --------
> Datum: Fri, 7 Nov 2008 12:20:04 +0100
> Von: "Martin Weiss" <martin.weiss1@gmx.de>
> An: statalist@hsphsun2.harvard.edu
> Betreff: RE: RE: st: RE: extract t-values

> I tried to make my example as general as possible, hence the "complicated"
> syntax and the use of M.Buis` -ssc d indeplist-. You can shrink this
> syntax
> if all you want is a calculation for one of the covariates, i.e.
> 
> **************
> sysuse auto, clear
> reg p w f r, robust
> gen tweight = _b[weight]/_se[weight]
> gen pweight = 2*ttail(e(df_r),abs(_b[weight]/_se[weight]))
> **************
> 
> I do not endorse your strategy, and others have voiced concerns as well,
> but
> if you absolutely want it...
> 
> 
> HTH
> Martin
> 
> 
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Bastian
> Steingros
> Sent: Friday, November 07, 2008 12:12 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: RE: st: RE: extract t-values
> 
> Yes I have.
> 
> I think using this command could be helpful:
> di in red "p-value: " %5.4fc
> 2*ttail(e(df_r),abs(_b["`indep'"]/_se["`indep'"])) _n(2)
> 
> But, I do not fully understand how to incorporate this command in my
> dofile.
> 
> I would like to program *gen p_value=...*. Is something of that mentioned
> above fit to do so?
> I have the t-values for each year. 
> I guess it must be *gen p_value=2*ttail(e(df_r), abs(t_value))... but I
> then
> have a syntax problem to deal with... Maybe e(df_r) does not function when
> using reg ... , robust
> 
> Or is it not possible to calculate the p-values by hand in stata ? 
> 
> Hope I made my problem  clear
> 
> B
> 
> 
> -------- Original-Nachricht --------
> > Datum: Fri, 7 Nov 2008 11:11:17 +0100
> > Von: "Martin Weiss" <martin.weiss1@gmx.de>
> > An: statalist@hsphsun2.harvard.edu
> > Betreff: RE: st: RE: extract t-values
> 
> > Are you sure you have read through all messages in this thread? You
> might
> > have missed
> > 
> > http://www.stata.com/statalist/archive/2008-11/msg00234.html
> > 
> > 
> > 
> > HTH
> > Martin
> > 
> > -----Original Message-----
> > From: owner-statalist@hsphsun2.harvard.edu
> > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Bastian
> > Steingros
> > Sent: Friday, November 07, 2008 11:09 AM
> > To: statalist@hsphsun2.harvard.edu
> > Subject: Re: st: RE: extract t-values
> > 
> > Hi Martin hi everybody
> > 
> > you are right, parmest simplifies it greatly, but is there another way
> to
> > put the p-values directly into my data set?
> > I mean, using something like gen t=_b[.]/_se[.] makes stata write the
> > t-statistics in the *same* dataset where the other variables already
> are. 
> > The thing is I run many regressions. My dataset consists of data from
> 1950
> > to 1995. I want to run regression  for 5-year-time-windows only, that
> is,
> > the first time window is 1950-1955 etc. 
> > To put all the statistics  from the regression table into my dataset
> > simplifies my task because I then can reduce my sample to those time
> > windows
> > where all the regression coefficient are at least significant at the 5%
> > level (for example by using: bys window: keep if p_value=<0.05).
> > 
> > That is the reason why I want to calculate the t-values and, in the next
> > step, the p-values separately. 
> > 
> > Is there a may to calculate p-values after having calculated t-values?
> > 
> > Try to give an example of how it looks like in my dataset
> > year   var1 var2 ...  coefficient         t_val         p_val
> > 
> > 1950                          2.98             4.27   -->  ????         
> > 1950                          2.98             4.27   ---> ????
> > ...etc.
> > 
> > Basti
> > -------- Original-Nachricht --------
> > > Datum: Thu, 6 Nov 2008 17:56:48 +0100
> > > Von: "Martin Weiss" <martin.weiss1@gmx.de>
> > > An: statalist@hsphsun2.harvard.edu
> > > Betreff: st: RE: extract t-values
> > 
> > > BTW, your -gen- statement is probably not the most expedient way to
> > > achieve
> > > what I assume you want. You might want to look into -local-s or
> > -scalar-s
> > > for more efficient storage. Or indeed -ssc d parmest- which simplifies
> > > this
> > > task greatly...
> > > 
> > > 
> > > HTH
> > > Martin
> > > 
> > > 
> > > -----Original Message-----
> > > From: owner-statalist@hsphsun2.harvard.edu
> > > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Bastian
> > > Steingros
> > > Sent: Thursday, November 06, 2008 5:48 PM
> > > To: statalist@hsphsun2.harvard.edu
> > > Subject: st: extract t-values
> > > 
> > > Hi Stata users,
> > > 
> > > does anybody know a ansver to this problem:
> > > 
> > > I want to extract the t-values from the table displayed below. To
> obtain
> > > the
> > > coefficients is easy by programming gen coef1=_b[var1]
> > > 
> > > Is there also a command to extract the t-value of var1???
> > > 
> > >
> >
> ----------------------------------------------------------------------------
> > > --
> > > dep_var |      Coef.       Std. Err.       t         P>|t|       [95%
> > > Conf.
> > > Interval]
> > >
> >
> ---------+------------------------------------------------------------------
> > > --
> > >    var1   |  -.0074074   .0008079     -9.168   0.000      -.0090039
> > > -.0058109
> > >    _cons |   4.711111   .2162561     21.785   0.000       4.283786
> > > 5.138436
> > >
> >
> ----------------------------------------------------------------------------
> > > --
> > > 
> > > thanks 
> > > 
> > > B
> > > -- 
> > > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> > > Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> > > *
> > > *   For searches and help try:
> > > *   http://www.stata.com/help.cgi?search
> > > *   http://www.stata.com/support/statalist/faq
> > > *   http://www.ats.ucla.edu/stat/stata/
> > > 
> > > *
> > > *   For searches and help try:
> > > *   http://www.stata.com/help.cgi?search
> > > *   http://www.stata.com/support/statalist/faq
> > > *   http://www.ats.ucla.edu/stat/stata/
> > 
> > -- 
> > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> > Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/help.cgi?search
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> > 
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/help.cgi?search
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> 
> -- 
> GMX Download-Spiele: Preizsturz! Alle Puzzle-Spiele Deluxe über 60%
> billiger.
> http://games.entertainment.gmx.net/de/entertainment/games/download/puzzle/in
> dex.html
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index