Hello, I'm trying to create 200 samples of a chi2 distribution with 20 degree freedom. And I stared with this:
set more off
clear mata
mata
x=1000
do
{
rchi2(x,1,20)
} while (x>=1000)
end
x is the number of observations and I decided that x starts in 1000, the problem with this is that the loops goes on forever and I don't know how tell it to does it just 200 times.
I'm totally new in stata mata
Thank you
set more off
clear mata
mata
x=1000
do
{
rchi2(x,1,20)
} while (x>=1000)
end
x is the number of observations and I decided that x starts in 1000, the problem with this is that the loops goes on forever and I don't know how tell it to does it just 200 times.
I'm totally new in stata mata
Thank you
Comment