Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: Capture syntax


From   "Eva Poen" <eva.poen@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Capture syntax
Date   Fri, 11 Jul 2008 12:13:41 +0100

Janet,

it sounds like you want the p-value for the coefficient on wmean, but
you ask for the p-value of the model chi2 test.

Try this in your code:
if _rc==0 & 2*(normal(-abs(_b[wmean])/_se[wmean])) < 0.05 di "`x'"


Hope this helps,
Eva


2008/7/11 Janet Hill <janethill73@yahoo.co.uk>:
> I have to run typically 50 variables separately in
> ologit as part of a screening process and some of the
> models fail with no convergence. I have tried the
> following to trap the error and continue the analysis:
>
> set more off
> foreach x of var chew speech appear1 ......{
> capture quietly ologit `x' wmean if surface==1
>        if _rc==0 & chi2tail(e(df_m),e(chi2)) < 0.05 di "`x'"
> }
> set more on
>
> Hoping just to print out those  variables with a model
> probability < 0.05.
>
> This typically produces several variables:
> ache
> diet
> glass
> etc.
> When I subsequently analyse these variables the model
> associated with ache has p<0.05, but diet does not
>
> .. ologit ache wm if surface==1,nolog
>
> Ordered logistic regression
> Number of obs   =         15
>                                                  LR
> chi2(1)      =       4.83
>                                                  Prob
>> chi2     =     0.0280
> Log likelihood = -16.888841
> Pseudo R2       =     0.1251
>
> ------------------------------------------------------------------------------
>        ache |      Coef.   Std. Err.      z    P>|z|
>   [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>       wmean |    1.23758   .6219381     1.99   0.047
>   .0186035    2.456556
> .. ologit ache wm if surface==1,nolog
>
>
> .. ologit diet wm if surface==1,nolog
>
> Ordered logistic regression
> Number of obs   =         15
>                                                  LR
> chi2(1)      =       4.19
>                                                  Prob
>> chi2     =     0.0407
> Log likelihood = -3.7955935
> Pseudo R2       =     0.3556
>
> ------------------------------------------------------------------------------
>        diet |      Coef.   Std. Err.      z    P>|z|
>   [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>       wmean |  -1.967477    1.24521    -1.58   0.114
>  -4.408044    .4730897
>
> I would be grateful if somebody could point out my
> programming error.
> Thanks,
> Janet
>
>
>
>
>      __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
>
> *
> *   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/



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