Statalist


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

st: Re: Capture syntax


From   "[email protected]" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Re: Capture syntax
Date   Fri, 11 Jul 2008 07:14:08 -0700

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/

Privileged, confidential or patient identifiable information may be contained in this message. This information is meant only for the use of the intended recipients. If you are not the intended recipient, or if the message has been addressed to you in error, do not read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. Instead, please notify the sender by reply e-mail, and then destroy all copies of the message and any attachments.

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