Statalist


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

AW: st: getting p-values from estat phtest into esttab


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: getting p-values from estat phtest into esttab
Date   Fri, 27 Mar 2009 16:05:25 +0100

<> 



*************
webuse leukemia, clear
stset weeks, failure(relapse)
stcox treatment2 wbc2 wbc3, schoenfeld(sch*) scaledsch(sca*)
eststo cox
estat phtest, rank 
estadd sca df=r(df)
estadd sca chi2=r(chi2), replace
estadd sca p=chi2tail(r(df), r(chi2)) 
esttab cox, sca(df chi2 p) 
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von moleps islon
Gesendet: Freitag, 27. März 2009 15:46
An: [email protected]
Betreff: Re: st: getting p-values from estat phtest into esttab

Thank you, Apparently not as elusive as I thought. Is there a way
though to save this so that I can use esttab ?

Regards
Moleps

On Fri, Mar 27, 2009 at 3:25 PM, Maarten buis <[email protected]>
wrote:
>
> --- On Fri, 27/3/09, moleps islon wrote:
>> I need to save multiple p-values from the estat phtest
>> postestimated cox analysis, preferably in a way that
>> esttab would let me display them afterwards. However
>> the only values returned are r(chi2) and r(df). This
>> problem was addressed in the statalist back in 2007 as
>> well by Jebsen. The answer though seems elusive.
>
> There is nothing elusive about this, Stata has given
> you all the information you need. The p-value is:
>
> chi2tail(`r(df)',`r(chi2)')
>
> You can store that number in a matrix or as a local,
> or display it on screen using -display-.
>
> -- Maarten
>
> -----------------------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>
>
> *
> *   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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index