14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

658 JSL Syntax Reference Appendix A<br />

Random Functions<br />

Returns<br />

The last value placed into the last row.<br />

Argument<br />

none<br />

Example<br />

For Each Row(x=:shuffle = colshuffle());<br />

show(x)<br />

x = 6<br />

In a table with 40 rows, the above script places the values 1-40 randomly into each row of the column<br />

named shuffle. All numbers appear only once. Each time the script is run, the numbers are placed in a<br />

different random order. If the value placed into the row 40 of column shuffle is 6, that number is<br />

assigned to x, as in the above example.<br />

Random Beta(alpha, beta)<br />

Description<br />

Generates a pseudo-random number distributed Beta (alpha, beta)<br />

Random Beta Binomial(n, p, delta)<br />

Description<br />

Returns a random number from a beta binomial distribution for n trials with probability p and<br />

correlation delta. The default value for delta is 0.<br />

Random Binomial(n, p)<br />

Description<br />

Returns random numbers from a binomial distribution with n trials and probability p of the event of<br />

interest occurring.<br />

Random Cauchy(alpha, beta)<br />

Description<br />

Returns a Cauchy distribution with given alpha and beta.<br />

Random Exp()<br />

Description<br />

Returns a random number distributed exponentially from 0 to infinity. Equivalent to the negative log of<br />

Random Uniform.<br />

Random Frechet(mu, sigma)<br />

Description<br />

Returns a random number from a Fréchet distribution with the location mu and scale sigma. The<br />

default values are mu = 0 and sigma = 1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!