VBA 手作仔:Population and Sample

利用剛學會的 Excel VBA 寫了一個小程式,準備用來闡述統計學上 Population 跟 Sample 的關係。

這個程式首先隨機產生 30 個由 1 至 100 的可重覆整數,作為 population。使用者可以鍵入 sample 的大小,例如 8 個,然後程式便會從 population 中,抽出 8 個數放入下面的 sample 欄裡。Excel 會分別計算這 population 及 sample 的平均值及其它統計量,從中可以明白不同的 sample size 對於這些統計量有甚麼影響。

我把程式納入 public domain,歡迎有興趣的讀者,自由下載使用、修改或研究。

I wrote a tiny program using the newly learned Excel VBA to illustrate the relation between population and sample in statistics.

This program generates a population of 30 repeatable random integers from 1 to 100. The user might then specify a sample size, say, 8, and the program would pick 8 numbers from the population and put them into the sample area. Excel would calculate the population parameters and sample statistics respectively. This program should help the students understand the effect of sample size on these statistical quantities.

I have put the program into public domain. Interested readers please feel free to download the program for your use, modification or study.

About the Author


你的電郵地址並不會被公開。 必要欄位標記為 *