Assigning values based on probability of occurrence
Posted: Tue Apr 23, 2013 1:54 pm
Hello all,
I'm looking for a more efficient way to do something, and I hope someone can help out.
What I'm trying to do is have EViews assign a series a certain value, based on a list of probabilities.
For exmaple, let's assume that a new product can come in three colors:
1. Blue: 10%
2. White: 50%
3. Green: 40%
and the % figure indicates the probability that a randomly chosen chair will fall into any of these categories. Is there an easy way for this to be done in EViews? For such a simple example, I can easily do the following:
which will give me the correct distribution.
But imagine I had several hundred rows like this. What would be an efficient way to do this?
Thanks a lot,
I'm looking for a more efficient way to do something, and I hope someone can help out.
What I'm trying to do is have EViews assign a series a certain value, based on a list of probabilities.
For exmaple, let's assume that a new product can come in three colors:
1. Blue: 10%
2. White: 50%
3. Green: 40%
and the % figure indicates the probability that a randomly chosen chair will fall into any of these categories. Is there an easy way for this to be done in EViews? For such a simple example, I can easily do the following:
Code: Select all
Series b = rnd
Series a = @recode(b<0.1,1,@recode(b<0.5,2,3)) But imagine I had several hundred rows like this. What would be an efficient way to do this?
Thanks a lot,