1. sample()

I was reading through some of the API documentation and ran across the sample() function. When I took statistics in college (30 years ago) we were taught two different sampling methods each of which have their uses.

The first of these appear to be the one currently supported. Example fill a bag with 10 white balls and 5 red balls, then sample n balls by withdrawing one ball at a time and placing it on the table.

The other starts with the same 10 white and 5 red balls in the bag, but the n ball sample is determined by withdrawing a ball, recording the color and then returning the ball to the bag before picking the next.

Unfortunately after 3 decades, I forget the terminology for indicating which method is being used, but I suspect sooner or later someone will ask about the other method.

new topic     » topic index » view message » categorize

2. Re: sample()

mindwalker said...

I was reading through some of the API documentation and ran across the sample() function. When I took statistics in college (30 years ago) we were taught two different sampling methods each of which have their uses.

The first of these appear to be the one currently supported. Example fill a bag with 10 white balls and 5 red balls, then sample n balls by withdrawing one ball at a time and placing it on the table.

The other starts with the same 10 white and 5 red balls in the bag, but the n ball sample is determined by withdrawing a ball, recording the color and then returning the ball to the bag before picking the next.

Unfortunately after 3 decades, I forget the terminology for indicating which method is being used, but I suspect sooner or later someone will ask about the other method.

For whatever it's worth, here's something I found relevant to the above via Google:

"Replacement of selected units:

Sampling schemes may be without replacement ('WOR' - no element can be selected more than once in the same sample) or with replacement ('WR' - an element may appear multiple times in the one sample). For example, if we catch fish, measure them, and immediately return them to the water before continuing with the sample, this is a WR design, because we might end up catching and measuring the same fish more than once. However, if we do not return the fish to the water (e.g. if we eat the fish), this becomes a WOR design."

Cursory reading of the article seems to suggest that there are quite a number of different sampling methods, most or all of them able to be done either WOR or WR. If that's right, then the two (WOR,WR) are not two BASIC methods, but rather two variations which may be applied as desired or appropriate to many different basic methods of sampling.

from: http://en.wikipedia.org/wiki/Sampling_(statistics)

Dan

new topic     » goto parent     » topic index » view message » categorize

3. Re: sample()

To throw in some math, here are the basic categories of sampling to find the total number of possibilities:

Type Order important Order not important
Sample w/ replacement n^r ( (n+r-1) / r) -> binomial coefficient
Sample w/o replacement n! / (n-r)! n! / ((n-r)! r!)

n is the number of objects you are choosing from
r is the number of selections

For example:

Tossing a die two times is sampling w/ replacement and order matters (rolling 4,6 is different than rolling 6,4): 6^2 = 36 combinations

The number of ways to select 2 people from a list of 5 is sampling w/o replacement and order does not matter: 5! / (3!2!) = 10 ways

Hope this helps,
Ira

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu