Calcite | Level 5

## Create Sample with Specific Distribution

What is the best way to take a sample from a population while controlling its characteristics? Is it possible to take a sample while specifying a min/max/mean/std dev? It's easy enough to filter something down so that you end up with the necessary averages for whatever characteristics you're looking for, but I need the distributions to look a specific way too. Any thoughts on the best way to approach this?

4 REPLIES 4

## Re: Create Sample with Specific Distribution

No idea if this will work, or if it even is a legitimate method.

It is much easier to simulate a dataset with the characteristics that you are looking for than it would be to select and hope.  Suppose you had the simulated data in hand, and then did a match against the variable of interest in the target dataset, so that only those values that come from a known distribution would be selected.  Probably would involve some rounding and a merge using in=.  I have never seen this done before, but maybe it would work.

Steve Denham

SAS Super FREQ

## Re: Create Sample with Specific Distribution

It is not clear to me whether you are trying to specify the characteristics of the population or of the sample.

In simulation studies, you specify the characteristics of the population. The parameter estimates for any random sample will deviate from those population parameters.

There are many ways to choose the parameters in a distribution to match the desired characteristics. Of course, you need enough parameters to satisfy all of the constraints.  For example, a uniform distribution only has two parameters, so in general you cannot make it match the four constraints.  If you want a parametric distribution with a given min/max/mean/StdDev, I'd use a (scaled) beta distribution or a truncated normal distribution.

You can also choose to solve this problem by using a nonparametric specification of the CDF of the distribution. For a discussion, see Approximating a distribution from published quantiles - The DO Loop  If your distribution is symmetric, then the mean equals the median and you can play with the interquartile range and the shape of the tails to obtain the required StdDev.

Barite | Level 11

## Re: Create Sample with Specific Distribution

I have the same question. I would like to choose a sample (a control group) from a large population based on the parameters of another, defined group from the same population. Any suggestions are welcome.

SAS Super FREQ

## Re: Create Sample with Specific Distribution

This does not sound like the same question. Please start a new thread and provide more details about your population and the characteristics that you are hoping to match.

Discussion stats
• 4 replies
• 1488 views
• 2 likes
• 4 in conversation