Difference between revisions of "Documentation/How Tos/Calc: PROB function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Example:)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{Documentation/MasterTOC
 +
|bookid=1234'''
 +
|booktitle=<div style="padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;">CALC FUNCTIONS</div>
 +
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Statistical_functions|<div style="font-size: 140%;">Statistical Functions]]
 +
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_STANDARDIZE_function
 +
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_POISSON_function
 +
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Spreadsheet_functions
 +
|ShowNextPart=block|NextPart=Documentation/How_Tos/Calc:_Text_functions
 +
|toccontent= <div style="padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;">FUNCTIONS</div>
 +
 
 +
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Measures of Central Tendency</div>
 +
* [[Documentation/How_Tos/Calc:_AVEDEV_function|<div style="font-size: 120%;">Avedev]]
 +
* [[Documentation/How_Tos/Calc:_AVERAGE_function|<div style="font-size: 120%;">Average]]
 +
* [[Documentation/How_Tos/Calc:_AVERAGEA_function|<div style="font-size: 120%;">Averagea]]
 +
* [[Documentation/How_Tos/Calc:_COUNT_function|<div style="font-size: 120%;">Count]]
 +
* [[Documentation/How_Tos/Calc:_COUNTA_function|<div style="font-size: 120%;">Counta]]
 +
* [[Documentation/How_Tos/Calc:_GEOMEAN_function|<div style="font-size: 120%;">Geomean]]
 +
* [[Documentation/How_Tos/Calc:_HARMEAN_function|<div style="font-size: 120%;">Hearmean]]
 +
* [[Documentation/How_Tos/Calc:_MEDIAN_function|<div style="font-size: 120%;">Median]]
 +
* [[Documentation/How_Tos/Calc:_MODE_function|<div style="font-size: 120%;">Mode]]
 +
* [[Documentation/How_Tos/Calc:_TRIMMEAN_function|<div style="font-size: 120%;">Trimmean]]
 +
 
 +
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Measures of dispersion / spread</div>
 +
* [[Documentation/How_Tos/Calc:_DEVSQ_function|<div style="font-size: 120%;">Devsq]]
 +
* [[Documentation/How_Tos/Calc:_KURT_function|<div style="font-size: 120%;">Kurt]]
 +
* [[Documentation/How_Tos/Calc:_SKEW_function|<div style="font-size: 120%;">Skew]]
 +
* [[Documentation/How_Tos/Calc:_STDEV_function|<div style="font-size: 120%;">Stdev]]
 +
* [[Documentation/How_Tos/Calc:_STDEVA_function|<div style="font-size: 120%;">Stedeva]]
 +
* [[Documentation/How_Tos/Calc:_STDEVP_function|<div style="font-size: 120%;">Stdevp]]
 +
* [[Documentation/How_Tos/Calc:_STDEVPA_function|<div style="font-size: 120%;">Stdevpa]]
 +
* [[Documentation/How_Tos/Calc:_VAR_function|<div style="font-size: 120%;">Var]]
 +
* [[Documentation/How_Tos/Calc:_VARA_function|<div style="font-size: 120%;">Vara]]
 +
* [[Documentation/How_Tos/Calc:_VARP_function|<div style="font-size: 120%;">Varp]]
 +
* [[Documentation/How_Tos/Calc:_VARPA_function|<div style="font-size: 120%;">Varpa]]
 +
 
 +
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Probability and statistics</div>
 +
* [[Documentation/How_Tos/Calc:_B_function|<div style="font-size: 120%;">B]]
 +
* [[Documentation/How_Tos/Calc:_BETADIST_function|<div style="font-size: 120%;">Betadist]]
 +
* [[Documentation/How_Tos/Calc:_BETAINV_function|<div style="font-size: 120%;">Betainv]]
 +
* [[Documentation/How_Tos/Calc:_BINOMDIST_function|<div style="font-size: 120%;">Binomdist]]
 +
* [[Documentation/How_Tos/Calc:_CHIDIST_function|<div style="font-size: 120%;">Chidist]]
 +
* [[Documentation/How_Tos/Calc:_CHIINV_function|<div style="font-size: 120%;">Chiinv]]
 +
* [[Documentation/How_Tos/Calc:_CHISQINV_function|<div style="font-size: 120%;">Chisqinv]]
 +
* [[Documentation/How_Tos/Calc:_CHITEST_function|<div style="font-size: 120%;">Chitest]]
 +
* [[Documentation/How_Tos/Calc:_CONFIDENCE_function|<div style="font-size: 120%;">Confidence]]
 +
* [[Documentation/How_Tos/Calc:_CRITBINOM_function|<div style="font-size: 120%;">Critbinom]]
 +
* [[Documentation/How_Tos/Calc:_EXPONDIST_function|<div style="font-size: 120%;">Expondist]]
 +
* [[Documentation/How_Tos/Calc:_FINV_function|<div style="font-size: 120%;">Finv]]
 +
* [[Documentation/How_Tos/Calc:_FISHER_function|<div style="font-size: 120%;">Fisher]]
 +
* [[Documentation/How_Tos/Calc:_FISHERINV_function|<div style="font-size: 120%;">Fisherinv]]
 +
* [[Documentation/How_Tos/Calc:_FDIST_function|<div style="font-size: 120%;">Fdist]]
 +
* [[Documentation/How_Tos/Calc:_FTEST_function|<div style="font-size: 120%;">Ftest]]
 +
* [[Documentation/How_Tos/Calc:_GAMMA_function|<div style="font-size: 120%;">Gamma]]
 +
* [[Documentation/How_Tos/Calc:_GAMMAINV_function|<div style="font-size: 120%;">Gammainv]]
 +
* [[Documentation/How_Tos/Calc:_GAMMALN_function|<div style="font-size: 120%;">Gammaln]]
 +
* [[Documentation/How_Tos/Calc:_GAMMADIST_function|<div style="font-size: 120%;">Gammadist]]
 +
* [[Documentation/How_Tos/Calc:_GAUSS_function|<div style="font-size: 120%;">Gauss]]
 +
* [[Documentation/How_Tos/Calc:_HYPGEOMDIST_function|<div style="font-size: 120%;">Hypgeomdist]]
 +
* [[Documentation/How_Tos/Calc:_LOGINV_function|<div style="font-size: 120%;">Loginv]]
 +
* [[Documentation/How_Tos/Calc:_LOGNORMDIST_function|<div style="font-size: 120%;">Lognormdist]]
 +
* [[Documentation/How_Tos/Calc:_NEGBINOMDIST_function|<div style="font-size: 120%;">Negbinomdist]]
 +
* [[Documentation/How_Tos/Calc:_NORMINV_function|<div style="font-size: 120%;">Norminv]]
 +
* [[Documentation/How_Tos/Calc:_NORMDIST_function|<div style="font-size: 120%;">Normdist]]
 +
* [[Documentation/How_Tos/Calc:_NORMSINV_function|<div style="font-size: 120%;">Normsinv]]
 +
* [[Documentation/How_Tos/Calc:_NORMSDIST_function|<div style="font-size: 120%;">Normsdist]]
 +
* [[Documentation/How_Tos/Calc:_PERMUT_function|<div style="font-size: 120%;">Permut]]
 +
* [[Documentation/How_Tos/Calc:_PERMUTATIONA_function|<div style="font-size: 120%;">Permutationa]]
 +
* [[Documentation/How_Tos/Calc:_PHI_function|<div style="font-size: 120%;">Phi]]
 +
* [[Documentation/How_Tos/Calc:_POISSON_function|<div style="font-size: 120%;">Poisson]]
 +
* [[Documentation/How_Tos/Calc:_PROB_function|<div style="font-size: 120%; border-style: double; border-color:#778899;">Prob]]
 +
* [[Documentation/How_Tos/Calc:_STANDARDIZE_function|<div style="font-size: 120%;">Standardize]]
 +
* [[Documentation/How_Tos/Calc:_TDIST_function|<div style="font-size: 120%;">Tdist]]
 +
* [[Documentation/How_Tos/Calc:_TINV_function|<div style="font-size: 120%;">Tinv]]
 +
* [[Documentation/How_Tos/Calc:_TTEST_function|<div style="font-size: 120%;">Ttest]]
 +
* [[Documentation/How_Tos/Calc:_WEIBULL_function|<div style="font-size: 120%;">Weibull]]
 +
* [[Documentation/How_Tos/Calc:_ZTEST_function|<div style="font-size: 120%;">Ztest]]
 +
 
 +
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Correlation and line fitting</div>
 +
* [[Documentation/How_Tos/Calc:_CORREL_function|<div style="font-size: 120%;">Correl]]
 +
* [[Documentation/How_Tos/Calc:_COVAR_function|<div style="font-size: 120%;">Covar]]
 +
* [[Documentation/How_Tos/Calc:_FORECAST_function|<div style="font-size: 120%;">Forecast]]
 +
* [[Documentation/How_Tos/Calc:_INTERCEPT_function|<div style="font-size: 120%;">Intercept]]
 +
* [[Documentation/How_Tos/Calc:_PEARSON_function|<div style="font-size: 120%;">Pearson]]
 +
* [[Documentation/How_Tos/Calc:_RSQ_function|<div style="font-size: 120%;">Rsq]]
 +
* [[Documentation/How_Tos/Calc:_SLOPE_function|<div style="font-size: 120%;">Slope]]
 +
* [[Documentation/How_Tos/Calc:_STEYX_function|<div style="font-size: 120%;">Steyx]]
 +
<div style="font-size: 110%;">''See also (in the [[Documentation/How_Tos/Calc:_Array_functions|Array Function]] category); GROWTH, LINEST, LOGEST, TREND''</div>
 +
 
 +
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Ranking</div>
 +
* [[Documentation/How_Tos/Calc:_LARGE_function|<div style="font-size: 120%;">Large]]
 +
* [[Documentation/How_Tos/Calc:_MAX_function|<div style="font-size: 120%;">Max]]
 +
* [[Documentation/How_Tos/Calc:_MAXA_function|<div style="font-size: 120%;">Maxa]]
 +
* [[Documentation/How_Tos/Calc:_MIN_function|<div style="font-size: 120%;">Min]]
 +
* [[Documentation/How_Tos/Calc:_MINA_function|<div style="font-size: 120%;">Mina]]
 +
* [[Documentation/How_Tos/Calc:_PERCENTILE_function|<div style="font-size: 120%;">Percentile]]
 +
* [[Documentation/How_Tos/Calc:_PERCENTRANK_function|<div style="font-size: 120%;">Percentrank]]
 +
* [[Documentation/How_Tos/Calc:_QUARTILE_function|<div style="font-size: 120%;">Quartile]]
 +
* [[Documentation/How_Tos/Calc:_RANK_function|<div style="font-size: 120%;">Rank]]
 +
* [[Documentation/How_Tos/Calc:_SMALL_function|<div style="font-size: 120%;">Small]]
 +
}}__TOC__
  
 
== PROB ==
 
== PROB ==
Line 9: Line 108:
 
: <tt>'''values'''</tt> is a range or array of numbers (possibly unordered).
 
: <tt>'''values'''</tt> is a range or array of numbers (possibly unordered).
  
: <tt>'''probabilities'''</tt> is a range or array of numbers of the same size as <tt>'''values'''</tt>, indicating the corresponding probability (>0 and <=1) of each value in <tt>'''values'''</tt> occurring. The numbers in <tt>'''probabilities'''</tt> must sum to 1 exactly.
+
: <tt>'''probabilities'''</tt> is a range or array of numbers of the same size as <tt>'''values'''</tt>, indicating the corresponding probability (>0 and <=1) that each value in <tt>'''values'''</tt> will occur. The numbers in <tt>'''probabilities'''</tt> must sum to 1 exactly.
  
 
: <tt>'''PROB'''</tt> finds all <tt>'''values'''</tt> which are between <tt>'''start'''</tt> and <tt>'''end'''</tt> inclusive and returns the sum of their corresponding <tt>'''probabilities'''</tt>.
 
: <tt>'''PROB'''</tt> finds all <tt>'''values'''</tt> which are between <tt>'''start'''</tt> and <tt>'''end'''</tt> inclusive and returns the sum of their corresponding <tt>'''probabilities'''</tt>.
  
 
:  <tt>'''end'''</tt> may be omitted, in which case <tt>'''PROB'''</tt> returns the probability corresponding to <tt>'''start'''</tt> (or <tt>'''0'''</tt> if <tt>'''start'''</tt> is not present in <tt>'''values'''</tt>).
 
:  <tt>'''end'''</tt> may be omitted, in which case <tt>'''PROB'''</tt> returns the probability corresponding to <tt>'''start'''</tt> (or <tt>'''0'''</tt> if <tt>'''start'''</tt> is not present in <tt>'''values'''</tt>).
 +
 +
 +
: Advanced topic: <tt>'''PROB'''</tt> evaluates the <tt>'''values'''</tt> and <tt>'''probabilities'''</tt> parameters as [[Documentation/How_Tos/Using_Arrays|array formulas]] - see the examples.
  
 
=== Example: ===
 
=== Example: ===
Line 25: Line 127:
 
: returns <tt>'''0.4'''</tt>, the probability for <tt>'''4'''</tt>.
 
: returns <tt>'''0.4'''</tt>, the probability for <tt>'''4'''</tt>.
  
=== See also: ===
+
 
[[Documentation/How_Tos/Calc: Statistical functions|'''Statistical functions''']]
+
Evaluation as an * [[Documentation/How_Tos/Using_Arrays|array formula]]:
 +
 
 +
<tt>'''PROB(A1:A2*2; B1:B2; 2)'''</tt>
 +
: where cells A1, A2 contain 1, 4 and cells B1, B2 contain 0.3, 0.7, returns <tt>'''0.3'''</tt>. <tt>'''PROB'''</tt> forces evaluation of <tt>'''values'''</tt> as an array formula, so that <tt>'''A1:A2*2'''</tt> yields the array {2 | 8}. Thus <tt>'''PROB({2 | 8}; B1:B2; 2)'''</tt> is actually evaluated to give the result.
 +
 
 +
<tt>'''PROB(A1:A2; B1:B2/100; 4)'''</tt>
 +
: where cells A1, A2 contain 1, 4 and cells B1, B2 contain 30, 70, returns <tt>'''0.7'''</tt>. <tt>'''PROB'''</tt> forces evaluation of <tt>'''probabilities'''</tt> as an array formula, so that <tt>'''B1:B2/100'''</tt> yields the array {0.3 | 0.7}. Cells B1 and B2 effectively contain percentages here.
 +
 
 +
=== Issues: ===
 +
*If <tt>'''start'''</tt> is given as a range (eg D4:D5) and the formula entered in scalar (non-array) mode then the top left value of the range appears to be evaluated, rather than the intersection of the range and the formula cell row/colum. This is a minor issue which is recorded in [http://qa.openoffice.org/issues/show_bug.cgi?id=88967 issue 88967].
 +
 
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: Statistical functions|Statistical functions]]
 +
* [[Documentation/How_Tos/Using_Arrays|Using Arrays]]
 +
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Statistical functions]]

Latest revision as of 09:20, 17 July 2018


PROB

Returns a result from a list of probabilities.

Syntax:

PROB(values; probabilities; start; end)

values is a range or array of numbers (possibly unordered).
probabilities is a range or array of numbers of the same size as values, indicating the corresponding probability (>0 and <=1) that each value in values will occur. The numbers in probabilities must sum to 1 exactly.
PROB finds all values which are between start and end inclusive and returns the sum of their corresponding probabilities.
end may be omitted, in which case PROB returns the probability corresponding to start (or 0 if start is not present in values).


Advanced topic: PROB evaluates the values and probabilities parameters as array formulas - see the examples.

Example:

PROB({3; 4; 5; 6}; {0.2; 0.4; 0.3; 0.1}; 4; 6)

returns 0.8, the sum of the probabilities for 4, 5 and 6.

PROB({2.2; 5; 1}; {0.5; 0.3; 0.2}; 0; 3)

returns 0.7, the sum of the probabilities for 1 and 2.2.

PROB({3; 4; 5; 6}; {0.2; 0.4; 0.3; 0.1}; 4)

returns 0.4, the probability for 4.


Evaluation as an * array formula:

PROB(A1:A2*2; B1:B2; 2)

where cells A1, A2 contain 1, 4 and cells B1, B2 contain 0.3, 0.7, returns 0.3. PROB forces evaluation of values as an array formula, so that A1:A2*2 yields the array {2 | 8}. Thus PROB({2 | 8}; B1:B2; 2) is actually evaluated to give the result.

PROB(A1:A2; B1:B2/100; 4)

where cells A1, A2 contain 1, 4 and cells B1, B2 contain 30, 70, returns 0.7. PROB forces evaluation of probabilities as an array formula, so that B1:B2/100 yields the array {0.3 | 0.7}. Cells B1 and B2 effectively contain percentages here.

Issues:

  • If start is given as a range (eg D4:D5) and the formula entered in scalar (non-array) mode then the top left value of the range appears to be evaluated, rather than the intersection of the range and the formula cell row/colum. This is a minor issue which is recorded in issue 88967.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_PROB_function&oldid=243567"
Views
Personal tools
Navigation
Print/export
Tools