When using embedded data to generate random number, can I make each number appears roughly equal ? | XM Community
Skip to main content
I need to apply the embedded data to generate random numbers to further lead to participants to different questions. Also, for each question package, I need an equal number of the participants, which means I need the probability of different random numbers showing up to be the same.

(It would be too complicated to do this using randomizer, so pls do not suggest so. Applying random number generator is the easiest way for me.)

However, after collecting the first-round data, I notice that the random generalized numbers are not showing with equal probability (for example, the number "1" shows up 12 times and "2" only shows up 4 times). I am wondering if there is a way that I can indicate the distribution of the random numbers? Or, simply, can I make the numbers evenly shown?



I appreciate the kind suggestions a lot!!!!!!!!!!
You could use a web service to assign the numbers. If you do that, you could go with one of three different strategies:

1. A random number generator algorithm than provides a more uniform distribution

2. Round-robin number assignment (keep track of the last one assigned and assign the next one)

3. Use quotas (either Qualtrics quotas or stored externally) and assign the least filled
Dear Tom,



Thanks a lot for the help! May I ask more some more detailed explanations?

1. Do you mean that I can tell the generator to use a specific algorithm to provide uniform distribution? Or the current generating algrithm tends to provide uniform distribution ( maybe yes, but not work for a small amount ,200 for me, for example).

2. this round-robin number assignment sounds perfect for my object, could you please explain a it more precisely for me how to do that?





Thanks a loooooooooooooooot!
> @Jing said:

> Dear Tom,

>

> Thanks a lot for the help! May I ask more some more detailed explanations?

> 1. Do you mean that I can tell the generator to use a specific algorithm to provide uniform distribution? Or the current generating algrithm tends to provide uniform distribution ( maybe yes, but not work for a small amount ,200 for me, for example).

In Qualtrics rand is what it is and you can't change the algorithm. If you use a web service the language you use might have a number of random number functions that use different algorithms or you could write your own.

> 2. this round-robin number assignment sounds perfect for my object, could you please explain a it more precisely for me how to do that?

Say you are assigning numbers 1 to 200. Each time you assign a number you store it (on your web server) as the last number assigned. The next time you assign the stored last number + 1. When you get to 200, start over again with 1.
> @TomG said:

> > @Jing said:

> > Dear Tom,

> >

> > Thanks a lot for the help! May I ask more some more detailed explanations?

> > 1. Do you mean that I can tell the generator to use a specific algorithm to provide uniform distribution? Or the current generating algrithm tends to provide uniform distribution ( maybe yes, but not work for a small amount ,200 for me, for example).

> In Qualtrics rand is what it is and you can't change the algorithm. If you use a web service the language you use might have a number of random number functions that use different algorithms or you could write your own.

> > 2. this round-robin number assignment sounds perfect for my object, could you please explain a it more precisely for me how to do that?

> Say you are assigning numbers 1 to 200. Each time you assign a number you store it (on your web server) as the last number assigned. The next time you assign the stored last number + 1. When you get to 200, start over again with 1.

>

>



So for the round-robin number assignment, I need to use the web-server to write my own javascript right?
> @Jing said:

> So for the round-robin number assignment, I need to use the web-server to write my own javascript right?

Yes, but it wouldn't be JavaScript (that is used in client browsers only). It would be a web server scripting language like PHP, Python, etc.

Leave a Reply