Hi, I am new in the program...
I want to know how to draw number from a uniform distribution of [0,1] and make r = 1 if the number falls within the interval [0, 0.25]; r=2 if (0.25, 0.5], r=3 if (0.5, 0,75] and r=4 if (0.75, 1].
Many thanks!
draw number from uniform distribution
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
draw number from uniform distribution
Is r a series or a scalar?
Re: draw number from uniform distribution
it is a seriesIs r a series or a scalar?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: draw number from uniform distribution
Code: Select all
series i = rnd 'create a series from a uniform distribution
i.classify 0.25 @ r 'create a series called R that will be equal to 1 for i<0.25, 2 for i<0.5, 3 for i<0.75, and 4 for i<1
Who is online
Users browsing this forum: No registered users and 2 guests
