[R] Creating two groups of random numbers

Michael Dewey lists at dewey.myzen.co.uk
Thu Jun 29 17:17:44 CEST 2017


Please do not cross post as people waste time replying on one forum not 
knowing you have already received excellent advice on another.

On 29/06/2017 14:44, Naike Wang wrote:
> 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
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
>

-- 
Michael
http://www.dewey.myzen.co.uk/home.html



More information about the R-help mailing list