Statalist


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

st: RE: Estimates save and lincom - Stata10


From   "Newson, Roger B" <r.newson@imperial.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Estimates save and lincom - Stata10
Date   Wed, 7 Nov 2007 18:56:28 -0000

I too would like to know a way around this problem. A possible immediate less-than-perfect fix might involve the -lincomest- package, downloadable from SSC using the -ssc- command. The -lincomest- package is like -lincom-, except that it saves -lincom- results as estimation results, which you can store and re-use. 

For instance:

**** BEGINNING OF Stata COMMANDS

logistic c_use urban age child* 
estimates save bangla1 , replace
lincomest urban+age, eform
estimates save lcbangla1, replace

logistic c_use urban age 
estimates save bangla2 , replace
lincomest urban+age, eform
estimates save lcbangla2, replace

clear all

estimates use bangla1
estimates store bangla1
estimates use bangla2
estimates store bangla2
estimates use lcbangla1
estimates store lcbangla1
estimates use lcbangla2
estimates store lcbangla2

* the likelihood-ratio test works fine:
lrtest bangla1 bangla2

**** END OF Stata COMMANDS

After these commands, you can replay the lincomest estimation results lcbangla1 and lcbangla2, or output them to other media using estout, outreg, parmest etc.

I hope this helps. (I wouldn't mind knowing a more elegant way, though.)

Best wishes

Roger


Roger Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk 
Web page: www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Spörri-Fahrni Adrian
Sent: 07 November 2007 09:35
To: statalist@hsphsun2.harvard.edu
Subject: st: Estimates save and lincom - Stata10

Dear statalisters
 
Estimate save is a great command when your regressions run for a long time and you want to do some post estimations later on. Often I use lincom after an estimation command. However, it doesn't work properly after estimates use...

Here's an example:

version 10
use http://www.stata-press.com/data/r10/bangladesh.dta, clear
logistic c_use urban age child* 
estimates save bangla1 , replace

logistic c_use urban age 
estimates save bangla2 , replace

clear all

estimates use bangla1
estimates store bangla1
estimates use bangla2
estimates store bangla2

* the likelihood-ratio test works fine:
lrtest bangla1 bangla2

* but the lincom does not work (if the original dataset is not loaded):
lincom urban+age, eform

* a workaround is to create two empty variables:
gen urban=.
gen age=.
lincom urban+age, eform

Is there another way of using lincom after estimates use - without creating empty variables or loading the data?

Thanks,
Adrian
spoerri@ispm.unibe.ch


*
*   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