傳回超幾何分配。 HypGeom_Dist 會傳回給定樣本大小、母體成功和母體大小的指定樣本成功機率。 將 HypGeom_Dist 用於具有有限總體的問題,其中每個觀察值要么是成功,要么是失敗,並且給定大小的每個子集都以相等的可能性選擇。
語法
表達。HypGeom_Dist (Arg1、Arg2、Arg3、Arg4、Arg5)
詞 代表 WorksheetFunction 物件的變數。
參數
| 名稱 | 必要/選用 | 資料類型 | 描述 |
|---|---|---|---|
| Arg1 | 必要 | 雙精確度 | Sample_s - 樣本成功數。 |
| Arg2 | 必要 | 雙精確度 | Number_sample - 樣本大小。 |
| Arg3 | 必要 | 雙精確度 | Population_s - 母體成功數。 |
| Arg4 | 必要 | 雙精確度 | Number_population - 母體大小。 |
| 引數5 | 選用 | Variant | Cumulative - 決定函數形式的邏輯值。 如果 cumulative 為 True,則 HypGeom_Dist 傳回累積分佈函數;如果 為 False,則傳回機率質量函數。 |
傳回值
雙精確度
註解
會將所有引數無條件捨去成整數。
如果任何引數是非數值, HypGeom_Dist 會傳回 #VALUE! 錯誤值。
如果sample_s < 0 或 sample_s 大於 number_sample 或 population_s 中的較小者,則 HypGeom_Dist 傳回 #NUM! 錯誤值。
如果sample_s小於 0 或 (number_sample - number_population + population_s) 中的較大值,則 HypGeom_Dist 傳回 #NUM! 錯誤值。
如果number_sample ≤ 0 或 number_sample >number_population,HypGeom_Dist 會傳回 #NUM! 錯誤值。
如果population_s ≤ 0 或 population_s >number_population,HypGeom_Dist 會傳回 #NUM! 錯誤值。
如果number_population ≤ 0,HypGeom_Dist 會傳回 #NUM! 錯誤值。
超幾何分佈的方程式如下,其中:
- x = sample_s
- n = number_sample
- 米 = population_s
- N = number_population
HypGeom_Dist 用於從有限總體中進行抽樣,無需替換。
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。