This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I tried to find answer on the topic but did not come even close to it, so I kindly ask for help. I have attached a file with a sampe of my data to be easier to explain. As you can see, the column "in hour" takes the value from the column "hour" each time the randomly produced number from the "rand" column falls within the range of "min" and "max" columns (which are fixed values).
What I try to achieve is to "force" the "rand" column to yield exactly as many values that will fall within the range of "min" and "max" as the value in the "prob Anm" column. For instance the "webinar_id" 645 has two entries that fall within the range, but "webinar_id" 643 should have 1 match, but has none, or "webinar_id" 644 has 1 match but should have 2.
Please note that when in "prob Anm" stays 0, no random number from "rand" should fall in within the range of "min" and "max".
In order to "force" the number of instance that fall in range, could you to randomize twice? For instance, for webinar_id =643, prob Anm = 1, you could randomly pick one of those rows, then randomly pick a number between that min and max. For the others, you can randomly pick a number outside that min and max. Make sense?