Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: re-using estimates from previously estimated models and related issues


From   Maria Ana Vitorino <[email protected]>
To   <[email protected]>
Subject   st: re-using estimates from previously estimated models and related issues
Date   Fri, 4 Nov 2011 11:41:02 -0400

Dear Statalist members:

I would like to run several regressions and save their estimates and predicted values so that they can be used as inputs for some calculations that will be done later in the code. I would like to do this in the most efficient and flexible way possible...

For simplicity let's assume this is the sequence of the things I need to calculate:

1st stage

logit y x1 x2
logit y x1 x3 x4
logit y x1 x4

2nd stage

For each of the models above:

gen totprob=sum(predicteprobs)
gen probx1= [coefficient for variable x1 ] * totprob
gen probx2= [coefficient for variable x2 ] * totprob
gen probx3= [coefficient for variable x3 ] * totprob


My questions are the following:
-Is it best to collect the estimates and predicted probs in a matrix or in a data file? -How to deal with the problem that I may have 3 model specifications now but I may want to add (or remove) some specifications later? (i.e. the number of model specifications is not always the same in different runs of the do file)? -How to deal with the fact that, in the second stage, some of the values may not exist for some models (for example, there is no coefficient for x2 in model specification 3 from the first stage)? (If the coefficient was not estimated in a given model I would like Stata not to calculate probx2)


Any suggestions are appreciated.
Thanks!
Ana
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index