Skip to content
Prev 370147 / 398503 Next

Creating two groups of random numbers

Hi all,
I want to create two groups of random numbers to calculate proportions. The
first group is to represent the number of cases in a study. The second
group is to represent the sample size of the study. Apparently, the sample
size is going to have to be bigger or equal to the number of cases, but the
sample size of a study is not necessarily greater than the number of cases
of another study. Here's an example:

study                 cases            total
1                        17                 28
2                        48                 70
3                        87                 92
4                        15                 17



Notice that the sample size of the first study is 28, which is bigger than
the number of cases of this study, but is smaller than the number of cases
of the second study.

How do I create a data set like this?

Best,
Naike