Statalist


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

Re: st: saving odds ratios for logistic models


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: saving odds ratios for logistic models
Date   Thu, 30 Jul 2009 11:45:39 -0400

You don't say if you want the standard errors, or
how you want to save them (variables? macros?) but
this will give an idea for saving in local macros;
the coefficients are saved in the matrix e(b), so:

 xi : logit depvar indvar1 ...
 matrix b=e(b)
 local or1=exp(el("b",1,1))
 local or2=exp(el("b",1,2))
 .

etc. will store the ORs in the locals or1, or2, etc.

If you want to pick out certain ones, you can look up
how to reference matrix elements by their row and column
names; the column names of matrix b are just the names of
the variables in the model.

hth,
Jeph





Miranda Kim wrote:
Would anyone be able to help me with this...
How can I save the odds ratio produced when using xi: logitic ?
Many thanks!


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