Simple Random Samples
Choose the “Random” option and input the number of random selections you wish Excel to make.
Note: Repeated selections are possible, so it is advisable that you generate several more random numbers than the sample size.
Click “OK” and find the random numbers outputted to a new worksheet.
Note: If you wish to sort the random numbers, you should first highlight the cells to be sorted and then click the “Sort & Filter” option, found under the “Home” tab. You can now pick the option to have the numbers sorted from smallest to largest.
CrunchIt does not formally support random sampling, but a random sample (without replacement) can be obtained by creating a column of random values to allow the selection of only those rows with values matching a particular value.
A new variable will be created with values of 0 and 1—to use this variable to form a selection:
Rows not matching this criterion will be excluded from analysis.
TI calculators do not perform random sampling, but they can generate a random list of numbers to use in selecting a sample.
Enter the minimum desired value, the maximum, and the number of values to generate. Ask for a few more than you need, because duplicates may occur. A finished command should look like (to generate five numbers between 1 and 33, inclusive)
L1=randInt(1,33,5)
Use sample() to take a random sample of size n from a data set. An example of this command is shown and selects a sample of size n=15 from data set named “mydata” into a subset named “mysamp:”
> mysamp=mydata[sample(1:nrow(mydata),15,replace=F),]