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

st: Re: save results from the simulation

From   Kit Baum <>
Subject   st: Re: save results from the simulation
Date   Mon, 27 Oct 2008 09:13:12 -0400

< >
I believe you will have to extract the desired elements from those matrices and return them as scalars, e.g. within your program,

	mat xmfxx = e(Xmfx_X)
	ret scalar xmfxx1 = xmfxx[1,1]
	ret scalar xmfxx2 = xmfxx[1,2]
	eret clear

Something I did not know is that -simulate- will pick up everything in r() if it has been changed but e() has not. Of course -logit- and - mfx- change e(). That's why I include -eret clear- here. Then you can just say

simulate, reps(`reps') nodots saving(simlogit1.dta, replace): simlogit

and it will pick up all the scalars that you have created in the program.

Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

On Oct 27, 2008, at 02:33 , Anupit wrote:

Here, I want to save the marginal effects of a and b after running the
logit for each repetition. I check the ereturn list and find that these are
the matrices that I would like to save:

However, I am a bit confused about how to save them.

1) Do I have to use them (e()) with -post-? If yes, how to declare
this within the -program-?

2) Are the new dataset saved by using -post- different from the one saved by
- -saving- option of -simulation- command?

*   For searches and help try:

© Copyright 1996–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index