Diff for "FAQ/rand" - CBU statistics Wiki
location: Diff for "FAQ/rand"
Differences between revisions 9 and 12 (spanning 3 versions)
Revision 9 as of 2012-07-07 17:36:16
Size: 161
Editor: vps-1088369-8017
Comment: LSuezt , [url=http://bgeqftnzueww.com/]bgeqftnzueww[/url], [link=http://slktpwnubwkg.com/]slktpwnubwkg[/link], http://hctznbggnsfo.com/
Revision 12 as of 2016-02-18 11:14:32
Size: 841
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
LSuezt , [url=http://bgeqftnzueww.com/]bgeqftnzueww[/url], [link=http://slktpwnubwkg.com/]slktpwnubwkg[/link], http://hctznbggnsfo.com/
----
CategoryCategory
= How do I generate a random sample in EXCEL? =

Let us suppose we wish to randomly sample n cases of data comprising N people.

1. Put =RAND()*N in row 1 of the column adjacent to the right most data column in the spreadsheet

2. Copy and paste into remaining N-1 rows

3. Go to Data>sort on the EXCEL menu and make sure you sort in ascending order by the column you have just created. Click OK.

4. Delete rows n+1 to N.

We have randomly permuted the data rows so that the first, or any adjacent, n rows represent a random sample of size n.

Block randomization and other procedures may also be done on-line [[https://www.random.org/ | here.]]

[[http://www.stanford.edu/class/msande121/Materials/ExcelTut.pdf|More on the rand() function]].

[[FAQ/rand/spss|There is also easy to use syntax to perform this in SPSS.]]

How do I generate a random sample in EXCEL?

Let us suppose we wish to randomly sample n cases of data comprising N people.

1. Put =RAND()*N in row 1 of the column adjacent to the right most data column in the spreadsheet

2. Copy and paste into remaining N-1 rows

3. Go to Data>sort on the EXCEL menu and make sure you sort in ascending order by the column you have just created. Click OK.

4. Delete rows n+1 to N.

We have randomly permuted the data rows so that the first, or any adjacent, n rows represent a random sample of size n.

Block randomization and other procedures may also be done on-line here.

More on the rand() function.

There is also easy to use syntax to perform this in SPSS.

None: FAQ/rand (last edited 2016-02-18 11:14:32 by PeterWatson)