Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65074

reg3 - r(2001) Insufficient observations error

$
0
0
Dear Statalists,

I try to run a system of two simultaneous equations imposed on Monte Carlo generated data using the 3sls method. The problem is, while I have set the number of observations at 50000000, the simulation stops with error message of: "insufficient observations - an error occurred when simulate executed my3sls".

I would appreciate if some one could help me with this. The code is:


#delimit ;
clear all ;
set seed 10101 ;

* Set the values of the parameters

global numobs = 50000000 ; /*numobs = sample size*/
global numsims = 2000 ;/*numsims = replication number*/

scalar beta12 = 1.5 ;
scalar beta21 = 1.8 ;
scalar gamma11 = 1.5 ;
scalar gamma12 = 0.5 ;
scalar gamma21 = 1 ;
scalar gamma32 = 2 ;

capture program drop my3sls ;
program my3sls, rclass ;
version 13 ;
drop _all ;
set obs $numobs ;
tempvar x1 x2 x3 eps1 eps2 u1 u2 y1 y2 ;

generate `y1' =. ;/* initiate y -- all missing values */
generate `y2' =. ;/* initiate y -- all missing values */

generate `x1' = runiform() ;
generate `x2' = runiform() ;
generate `x3' = runiform() ;

generate `eps1' = rnormal() ;
generate `eps2' = rnormal() ;

generate `u1' = 1.708*`eps1' + 1.404*`eps2' ;
generate `u2' = 1.732*`eps2' ;

replace `y1' = (beta21)*(`y2') + (gamma11)*(`x1') + (gamma21)*(`x2') + `u1' ;
replace `y2' = (beta12)*(`y1') + (gamma12)*(`x1') + (gamma32)*(`x3') + `u2' ;

reg3 (`y1' = `y2' `x1' `x2') (`y2' = `y1' `x1' `x3') ;

return scalar b1 = _b[`x1'] ;
return scalar b2 = _b[`x2'] ;
return scalar b3 = _b[`x3'] ;

end ;

simulate b1=r(b1) b2=r(b2) b3=r(b3), reps($numsims) saving(results, replace) nolegend nodots: my3sls ;

use results, clear ;
summarize ;




Thanks in advance,
Homa

Viewing all articles
Browse latest Browse all 65074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>