Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: Create Sample with Specific Distribution

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-02-2014 11:33 PM
(2234 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Ready to level-up your skills? Choose your own adventure.