Statalist The Stata Listserver

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

Re: st: monte carlo study

From   Antoine Terracol <>
Subject   Re: st: monte carlo study
Date   Wed, 22 Mar 2006 20:50:36 +0100


here is an example based on the help file for -simulate-

capture program drop mcarlols
program define mcarlols, rclass
syntax [, obs(integer 1)  ]
drop _all
set obs `obs'
drawnorm eps x
g y=1+x+eps
reg y x
return scalar beta = _b[x]

simulate beta=r(beta) , reps(1000): mcarlols, obs(100)

su beta, de
kdensity beta, norm

le 22/03/2006 20:10, Rudy Fichtenbaum a ecrit :
Stata Users:

I am still learning my way around Stata after many years of using SAS.
In SAS it is fairly easy to write a program to do a simple Monte Carlo
study to illustrate the properties of least squares estimators.

Is there anyone that has a simple example of a Monte Carlo Study for OLS?


*   For searches and help try:

*   For searches and help try:

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