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

From Apache OpenOffice Wiki
Jump to: navigation, search
("Calc and Excel are different")
m
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:ZTEST function}}
 +
{{Documentation/CalcFunc StatisticalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_WEIBULL_function
 +
|NextPage=Documentation/How_Tos/Calc:_CORREL_function
 +
}}__NOTOC__
  
 
== ZTEST ==
 
== ZTEST ==
Line 6: Line 11:
 
=== Syntax: ===
 
=== Syntax: ===
 
<tt>'''ZTEST(data; &mu; &sigma;)'''</tt>
 
<tt>'''ZTEST(data; &mu; &sigma;)'''</tt>
: <tt>'''data'''</tt> is a range or array containg a random sample from a population (population assumed to have a normal distribution).
+
: <tt>'''data'''</tt> is a range or array containing a random sample from a population (population assumed to have a normal distribution).
  
 
: <tt>'''&mu;'''</tt> is the (known) mean of the population.
 
: <tt>'''&mu;'''</tt> is the (known) mean of the population.
Line 12: Line 17:
 
: <tt>'''&sigma;'''</tt> is the (known) standard deviation of the population. If omitted, it is estimated from the sample data by <tt>'''STDEV(data)'''</tt>.
 
: <tt>'''&sigma;'''</tt> is the (known) standard deviation of the population. If omitted, it is estimated from the sample data by <tt>'''STDEV(data)'''</tt>.
  
: <tt>'''ZTEST'''</tt> calculates the z statistic as
+
: <tt>'''ZTEST'''</tt> calculates the z statistic:
 
:: [[Image:Calc_z_formula.png]]
 
:: [[Image:Calc_z_formula.png]]
  
: and returns a probability based on that.
+
: where ''m'' is the sample mean and ''n'' the number in the sample. When the mean and standard deviation of the population are known, the z statistic forms a standard normal distribution - that is, a normal distribution with mean=0 and standard deviation=1.
 +
 
 +
: <tt>'''ZTEST'''</tt> returns the '''one-sided''' cumulative probability - the area under the standard normal curve to the right of the z value (shaded blue here):
 +
<center>[[Image:Calc_ztest_graph2.png]] [[Image:Calc_ztest_graph1.png]] </center>
  
 
=== Example: ===
 
=== Example: ===
Line 21: Line 29:
 
: returns the result of a z-test on a sample A2:A20 drawn from a population with known mean 9 and known standard deviation 2.
 
: returns the result of a z-test on a sample A2:A20 drawn from a population with known mean 9 and known standard deviation 2.
  
=== See also: ===
+
=== Issues: ===
[[Documentation/How_Tos/Calc: TTEST function|'''TTEST''']]
+
* Excel has referred to this as both a one-tailed and a two-tailed test. Neither is correct - the test is '''one-sided''' as described above. For example, when z = -1.5 part of the left tail and all parts of the right tail are included. This is an unconventional measure, but can be used.
 +
* As with all statistics, a good understanding is needed for reliable results.
  
[[Documentation/How_Tos/Calc: Statistical functions|'''Statistical functions''']]
+
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: TTEST function|TTEST]]
  
=== Issues: ===
+
* [[Documentation/How_Tos/Calc: Statistical functions|Statistical functions]]
* The validity of this measure is not clear; see for example the draft ODFF standard 16May08, and that Excel has referred to this as both a one-tailed and a two-tailed test.
+
 
* Calc and Excel produce different results. Excel calculates <tt>'''1 - NORMSDIST(z)'''</tt>. It is not clear which is correct.
+
* [[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 14:37, 2 February 2024



ZTEST

Returns the result of a z-test.

Syntax:

ZTEST(data; μ σ)

data is a range or array containing a random sample from a population (population assumed to have a normal distribution).
μ is the (known) mean of the population.
σ is the (known) standard deviation of the population. If omitted, it is estimated from the sample data by STDEV(data).
ZTEST calculates the z statistic:
Calc z formula.png
where m is the sample mean and n the number in the sample. When the mean and standard deviation of the population are known, the z statistic forms a standard normal distribution - that is, a normal distribution with mean=0 and standard deviation=1.
ZTEST returns the one-sided cumulative probability - the area under the standard normal curve to the right of the z value (shaded blue here):
Calc ztest graph2.png Calc ztest graph1.png

Example:

ZTEST(A2:A20; 9; 2)

returns the result of a z-test on a sample A2:A20 drawn from a population with known mean 9 and known standard deviation 2.

Issues:

  • Excel has referred to this as both a one-tailed and a two-tailed test. Neither is correct - the test is one-sided as described above. For example, when z = -1.5 part of the left tail and all parts of the right tail are included. This is an unconventional measure, but can be used.
  • As with all statistics, a good understanding is needed for reliable results.



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