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

st: RE: saving and later retrieving results from an estimated model


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: saving and later retrieving results from an estimated model
Date   Wed, 23 Nov 2005 11:16:13 +0100

Have a look at -sureg-.

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of [email protected]
Sent: woensdag 23 november 2005 11:12
To: [email protected]
Subject: st: saving and later retrieving results from an estimated model

Hello,
I'd like to use the delta method (nlcom) to compute the standard error
for a non-linear function of regression coefficients, where the
regression coefficients are drawn from two different models. My
non-linear function also includes the predicted values from one of the
models. My problem is that after having estimated the second model, I
can't figure out how to access the results from the first model. That
is, I can save the coefficients estimated from the first model as a
fixed value, but I want nlcom to know that it is an estimated parameter.

Here's hypothetical code that demonstrates what I'm trying to do:
regress y1 x1 x2 x3
keep if e(sample) 
sum x1
local x1=r(mean)
sum x2
local x2=r(mean)
sum x3
local x3=r(mean)
local predxb "_b[x1]*`x1'+_b[x2]*`x2'+_b[x3]*`x3'+ _b[_cons]"

regress y2 x3 x4

local temp _b[x3]/_b[x1] + `predxb'/_b[x4]
/*The above line is where the problem occurs, since _b[x1] and `predxb'
are discarded with the estimation of the second model.*/
nlcom `temp'



As a hunch, I think I may need to write a program of the eclass variant
that estimates the first model, which I would then access when using
nlcom, but I'm not sure how to do this.

Any advice would be appreciated.

Many thanks,
Colin


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