Statalist


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

st: RE: Simulation: return overidentifying statistics


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: Simulation: return overidentifying statistics
Date   Sat, 19 Sep 2009 12:52:35 +0200

<>

If you do insist on a -program- to return the values:




**************
webuse docvisits, clear

//drop it beforehand
capt prog drop sim

//define the program
program define sim
    version 10.1
    syntax [, SAMplesize(integer 1000)]
    //estimate 
		gmm (docvis - exp({xb:private chronic /*
		*/ female income} + {b0})) in 1/`samplesize', /*
		*/instruments(private chronic female age black/*
		*/ hispanic) deriv(/xb = -1*exp({xb:} + {b0})) /*
		*/deriv(/b0 = -1*exp({xb:} + {b0})) /*
		*/twostep nolog
		//test
		estat overid
end

//for sample sizes from 100 to 4000
forv i=100(100)4000{
	qui sim, sam(`i')
	di in red _n(2) /*
	*/"Returned Values for `i' obs" 
	ret li
}
**************


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of John Antonakis
Sent: Samstag, 19. September 2009 09:56
To: [email protected]
Subject: st: Simulation: return overidentifying statistics

Hi:

I would like to do a Monte Carlo to see how the Hansen J test behaves 
when varying sample size.

I can't figure out how to return and simulate the chi-square, df, and 
p-values for each run.

Best,
John.

-- 
____________________________________________________

Prof. John Antonakis
Associate Dean Faculty of Business and Economics
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Switzerland

Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305

Faculty page:
http://www.hec.unil.ch/people/jantonakis&cl=en

Personal page:
http://www.hec.unil.ch/jantonakis
____________________________________________________

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