阅读背景:

在Stata中对整个矩阵进行蒙特卡罗模拟。

来源:互联网 

I would like to compute a summary statistic of a set of groups within my data (such as age,sex) with confidence intervals. For that purpose I use monte carlo simulation drawing values from a Poisson distribution for every row in my data and then collapsing the rows to have the summary. The whole procedure works fine if the result of the simulation is just one value (using return scalar in rclass) but as soon as I try to simulate more than one result (using ereturn matrix in eclass) it is not working (see Stata code below). I get the error message: "type mismatch error in expression: e(A)". How could I simulate a whole vector or even matrix of results without more complex loops etc.?I would like to compute a summary statistic of




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: