[SPSS] How to Make Random Samples

This post covers how to make random samples in SPSS.

    1. Preparation

    First, you need to have at least one variable and some cases.

    If you wish to make a large number of caes, you can refer to the post below.

    https://ik-lab.blogspot.com/2022/11/spss-how-to-insert-large-number-of-cases.html

    For this post, I have 1,000 cases and the values go from 1001 to 2000.


    2. Selecting cases

    Case selection tool can be used for a random sampling.

    Go to [Data] tab and click [Select cases].

    As a new window opens, select [Random sample of cases] and click [Sample] right below, which will then give us another window.

    There are two ways to designate sample size.

    First is to set a proportion of all case and I tried 50%.

    The second is to give a specific number of cases from the first N cases.

    One tip is that when you want to sample specific number of cases from the all the cases, you can put the number of all cases for the latter box

    That is, selecting exactly 500 cases from the first 1000 cases will do the same job as selecting 50% of all cases in this situation.

    Click [Continue] and now we need to decide how the output should be.

    There are three options, first of which is to filter out unselected cases within the same dataset.

    Second is to copy selected cases to a new dataset. The new Dataset name should have no spacing in it.

    The last option is to delete the unselected cases within the same dataset.

    Choose whatever option that suits you but be careful not to loose your original dataset.

    For the demonstration, I decided to choose the second option.

    Click [OK] and in the new dataset, we can see that there are only 500 randomly selected cases.

    Post a Comment

    0 Comments