I have a large table with a column of uniform[0,1] random numbers. I have another column that classifies each row as belonging to a SLOW or BUSY time period. I have a second table with 21 rows and three columns, whose one column corresponds to SLOW and the second column to BUSY. These columns contain bin edges of 0-1 broken up into consecutive ascending bins. The third column contains a value.
For the INPUT value in Column 1 of each row in the first table and the corresponding entry (SLOW or BUSY) in Column3, I would first like to choose the (SLOW or BUSY) column in the second table. Then I need to find the entry in the column (chosen SLOW or BUSY) in the second table where the entry is next-larger than the INPUT value. Then I need to form a new column in Table 1 to include the value of the bin number from Column 3 in the second table.
In the attachments, Table1 is the first "large" table with BUSY and SLOW indicating the Busy and Slow periods. Traffic_CDF contains the two columns of bin edges and the third contains the value that want to add to a new column in Table1.
Here is an example.
The 6th entry in Table 1 is 0.405374 and is BUSY. This value is between the entries in rows 2 and 3 of The BUSY column of Table 2. So, I would like to enter the value '2' of Column 3 of Table 2, to the 6th row on the new column in Table 1.
Would greatly appreciate if anyone can help with this.
Thanks
Thanks