Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Using "makematrix" with "logistic"


From   [email protected]
To   [email protected]
Subject   st: RE: RE: Using "makematrix" with "logistic"
Date   Mon, 1 Sep 2003 14:04:35 +0200

My thanks to Nick Cox for his response and I apologise if my message was
confusing.  To further clarify my query, and taking an example below,
"logistic" produces an output as follows:

. xi:logistic lbw i.stunt3 
i.stunt3          _Istunt3_0-1        (naturally coded; _Istunt3_0 omitted)
Logistic regression                               Number of obs   =
734
                                                  LR chi2(1)      =
56.00
                                                  Prob > chi2     =
0.0000
Log likelihood = -469.55293                       Pseudo R2       =
0.0563
----------------------------------------------------------------------------
--
         lbw | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
  _Istunt3_1 |   8.656607   2.938012     6.36   0.000     4.450961
16.8361
----------------------------------------------------------------------------
--


My query is just as "mlfit" leaves behind "S_E_aic and S_E_sc", does
"logistic" leave behind any global macros (perhaps prefixed by "S_E_") that
hold the outputs "Odds Ratio z P>|z|  [95% Conf. Interval]"  and may replace
(???) in the "makematrix" command line (step 2 below). 

1. 	create a do-file  saved as "mydo1.do" containing one  command line
		xi : logistic lbw i.`1'

2. 	run the command line
 	  	makematrix, from(???): "run D:\mydo1" stunt3 stunt6 stunt12


Otherwise, I can always settle for editing the outputs after running a
series of logistic models.  Many thanks for your help in advance.

Amani






-----Original Message-----
From: Nick Cox [mailto:[email protected]]
Sent: Monday, 1 September 2003 12:16
To: [email protected]
Subject: st: RE: Using "makematrix" with "logistic"


[email protected]
 
> I am very thankful to Nick Cox for putting together 
> "makematrix". I have
> tried it to save and return the AIC and Schwarz's Criterion 
> from a few logit
> models and his suggestions worked well.
> 
> It will helpful to me if I can first obtain a matrix of the 
> "Odds Ratio z
> P>|z| [95% Conf. Interval]" produced by "logistic" but I am 
> not sure to
> which global macros S_E_** are those saved (I have had a 
> look through
> logistic.ado, logistic.dlg,logis_lf.ado).
> 
> I guess I am looking at a 3-step process:
> 
> 1. a do-file is first saved as "mydo1.do" containing one 
> command line
> 		xi : logistic lbw i.`1'
> 
> 2. a second do-file "mydo2.do" is saved containi
ng two command lines
> 		xi : logistic lbw i.`1'
> 		mlfit 
> 
> 3. Then the command lines below run to obtain the two 
> matrix outputs:
> 
> 	makematrix, from(S_E_**): "run D:\mydo1" stunt3 stunt6 stunt12
> 
> 	makematrix, from(S_E_aic S_E_sc): "run D:\mydo2" stunt3 stunt6
> stunt12
> 

I am a bit confused on what you want. Your request
says one thing, but your example says another. 

However, I don't know a way to use -makematrix- to pick up 
odds ratios, etc., after -logistic-. These are not 
within its scope. Sorry. Perhaps Roger Newson's suite 
can do this. 

Moreover, you want to be able to say 

	S_E_**

(strictly, I think you mean "S_E_??") 
to pick up a list of globals via a wildcard. 
I don't think anything in Stata is that smart. 
The idea of a wildcard applies in Stata to varlists 
or to numbered lists of local `1', `2', etc. 
I am not aware that it extends beyond those. 
Certainly -makematrix- is not that smart. 

Nick 
[email protected] 

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