You can create formulas that generate real numbers by effectively “rolling the dice” within the constraints of the specified distribution. Each time you click Apply in the Formula Editor window, these functions produce a new set of random numbers.
Note: Random numbers are generated using the Mersenne-Twister technique. This technique has a period length of 219937-1. For details about the generators, see Matsumoto and Nishimura (1998). The new generators are verified to pass all the DIEHARD tests as documented in Marshalled (1996).
Generates random numbers uniformly between 0 and 1. This means that any number between 0 and 1 is as likely to be generated as any other. The result is an approximately even distribution. You can shift the distribution and change its range with constants. For example, 5 + Random Uniform()*20 generates uniform random numbers between 5 and 25.
Generates random numbers that approximate a normal distribution with a mean of 0 and standard deviation of 1 if no arguments are used, or with the mean and standard deviation entered as arguments. The normal distribution is bell shaped and symmetrical. You can also modify the Random Normal function with constants if no arguments are entered to give a normal distribution with specific mean and standard deviation. For example, the formula Random Normal()*5 + 30 generates a random normal variable with a mean of 30 and a standard deviation of 5.
For example, Random Exp()/.1 generates an exponential distribution for lambda=0.1. The exponential distribution is often used to model simple failure time data, where lambda is the failure rate.
Gives a gamma distribution for the parameter, alpha, you enter as the function argument. The gamma distribution describes the time until the kth occurrence of an event. The gamma distribution can also have a scale parameter, beta. A gamma variate with shape parameter alpha and scale beta can be generated with the formula beta*Random Gamma(alpha). If 2*alpha is an integer, a Chi-squared variate with 2*alpha degrees of freedom is generated with the formula 2*Random Gamma(alpha).
Generates a random category given an alternation of probability and result expressions (for example, Random Category(.2, "A", .3, "B", .4, "C", "D");).
Generates a uniform distribution of integers between 1 and the argument that you enter as n1, if nothing is entered for n2. If you enter both n1 and n2 (n1<n2), Random Integer generates a uniform distribution of the integers between and including n1 and n2.
Generates random numbers from a binomial distribution with parameters that you enter as function arguments. The first argument is n, the number of trials in a binomial experiment. The second argument is p, the probability that the event of interest occurs. When n is 1, the binomial function generates a distribution of Bernoulli trials. For example, n =1 and p = 0.5, give the distribution of tossing a fair coin. The mean of the binomial distribution is np, and variance is np(1 – p).
Generates a negative binomial distribution for the parameters that you enter as function arguments. The first parameter is the number of successes of interest (r) and the second argument is the probability of success (p). The random variable of interest is the number of failures that precede the rth success. In contrast to the binomial variate, where the number of trials is fixed and the number of successes is variable, the negative binomial variate is for a fixed number of successes and a random number of trials. The mean of the negative binomial distribution is (r(1 – p))/p and the variance is (r(1 – p))/p2.
Returns random numbers from the beta binomial distribution for n trials with probability p and correlation or overdispersion delta.
Returns random numbers from the geometric distribution with the parameter that you enter as the function argument. The parameter, p, is the probability that a specific event occurs at any one trial. The number of trials until a specific event occurs for the first time is described by the geometric distribution. The mean of the geometric distribution is (1-p)/p, and the variance is (1 – p)/p2.
Returns random numbers from the generalized logarithm distribution with parameters mu, sigma, and lambda. When lambda is equal to zero, the function returns a lognormal(mu, sigma).
Returns a random number from the smallest extreme distribution with the specified location mu and scale sigma.
Selects a row number at random from the current data table. Each row number is selected only once. When Col Shuffle is used as a subscript, it returns a value selected at random from the column that serves as its argument. Each value from the original column is assigned only once as Col Shuffle’s result.
For example, to identify a 50% random sample without replacement, use the formula in Formula Identifying 50% Random Sample.
The formula in Formula Identifying 50% Random Sample selects half the values (n/2) from the column x and assigns them to the first half of the rows in the computed column. The remaining rows of the computed column fill with missing values.
Generates a random selection with replacement frequency counts, suitable for use in bootstrapping. For example, it supports a second Freq Column argument, enabling it to do bootstrap samples relating to a pre-existing frequency column specified in the second argument. Resample Freq() generates a 100% resample. ResampleFreq(rate) generates a rate frequency sample. Resample(rate, column) generates a sample that is calculated by the rate multiplied by the sum of the specified column.