BookmarkSubscribeRSS Feed
jjones3241
Calcite | Level 5

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
SteveDenham
Jade | Level 19

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

Rick_SAS
SAS Super FREQ

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.

pink_poodle
Barite | Level 11

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.

Rick_SAS
SAS Super FREQ

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. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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