In SPSS, how can I generate variables with random values?
In SPSS, the following example generates two variables, named
x and y , with 100 cases each. The
variable x is drawn from a normal distribution with zero
mean and a standard deviation of one. The variable y is
drawn from a uniform distribution ranging between zero and one. The
code is as follows:
You can also choose other distributions, such as beta, chi-squared, and F.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on April 27, 2011.







