Page 1 of 1

Creating sampling distribution

Posted: Thu Aug 25, 2011 11:06 pm
by gamma
Hi guys,

I am currently trying to program (this is the first semester I have ever used Eviews)
1) Create 100 observations from gamma distribution - I understand to use @rgamma (b,r)
2) Calculate the average of this sample
3) Repeat steps 1,2 one hundred times to get a data set that would have 100 estimates of mean coming from these randomly generated data sets

I'm not sure how to loop this, as the examples in the tutorial are mainly regression related.

Any hints, help would be greatly appreciated.
Thank you

Re: Creating sampling distribution

Posted: Fri Aug 26, 2011 7:58 am
by EViews Gareth

Code: Select all

create u 100 vector(100) means for !i=1 to 100 series rand = @rgamma(b,r) means(!i) = @mean(rand) next

Re: Creating sampling distribution

Posted: Fri Aug 26, 2011 4:33 pm
by gamma
Thank you very much Eviews Gareth!

May I ask one further question, I've run this program and when I check the means there are a few N/A entries e.g. I only got 39 observations out of 100 run
Is this supposed to happen?
I am using (2,1) for (b,r) in the gamma function if it is relevant.

Thank you

Re: Creating sampling distribution

Posted: Fri Aug 26, 2011 5:06 pm
by startz
The program ran fine for me in version 7.

Is your EViews uptodate? Any chance you made a typo?

Re: Creating sampling distribution

Posted: Mon Sep 12, 2011 9:14 pm
by gamma
Hi startz,

The code is fine now. It appears there was an issue with the Citrix client.

Thank you for taking the time to verify the code!