Main Page: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
No edit summary
 
(535 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:''Z''-test}}
This is a preview for the new '''MathML rendering mode''' (with SVG fallback), which is availble in production for registered users.
A '''''Z''-test''' is any [[statistics|statistical]] [[statistical hypothesis testing|test]] for which the [[probability distribution|distribution]] of the [[test statistic]] under the [[null hypothesis]] can be approximated by a [[normal distribution]]. Because of the [[central limit theorem]], many test statistics are approximately normally distributed for large samples. For each significance level, the ''Z''-test has a single critical value (for example, 1.96 for 5% two tailed) which makes it more convenient than the [[Student's t-test|Student's ''t''-test]] which has separate critical values for each sample size. Therefore, many statistical tests can be conveniently performed as approximate ''Z''-tests if the sample size is large or the population variance known. If the population variance is unknown (and therefore has to be estimated from the sample itself) and the sample size is not large (n < 30), the Student's ''t''-test may be more appropriate.


If ''T'' is a statistic that is approximately normally distributed under the null hypothesis, the next step in performing a ''Z''-test is to estimate the [[expected value]] θ of ''T'' under the null hypothesis, and then obtain an estimate ''s'' of the [[standard deviation]] of ''T''. After that the [[standard score]] ''Z''&nbsp;=&nbsp;(''T''&nbsp;&minus;&nbsp;θ)&nbsp;/&nbsp;''s'' is calculated, from which [[one- and two-tailed tests|one-tailed and two-tailed]] [[p-values|''p''-values]] can be calculated as Φ(&minus;''Z'') (for upper-tailed tests), Φ(''Z'') (for lower-tailed tests) and 2Φ(&minus;|''Z''|) (for two-tailed tests) where Φ is the standard [[normal distribution|normal]] [[cumulative distribution function]].
If you would like use the '''MathML''' rendering mode, you need a wikipedia user account that can be registered here [[https://en.wikipedia.org/wiki/Special:UserLogin/signup]]
* Only registered users will be able to execute this rendering mode.
* Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.


==Use in location testing==
Registered users will be able to choose between the following three rendering modes:


The term "''Z''-test" is often used to refer specifically to the [[location test|one-sample location test]] comparing the mean of a set of measurements to a given constant. If the observed data ''X''<sub>1</sub>, ..., ''X''<sub>n</sub> are (i) uncorrelated, (ii) have a common mean μ, and (iii) have a common variance σ<sup>2</sup>, then the sample average <span style="text-decoration: overline">''X''</span> has mean μ and variance σ<sup>2</sup>&nbsp;/&nbsp;''n''. If our null hypothesis is that the mean value of the population is a given number μ<sub>0</sub>, we can use <span style="text-decoration: overline">''X''</span>&nbsp;&minus;μ<sub>0</sub> as a test-statistic, rejecting the null hypothesis if <span style="text-decoration: overline">''X''</span>&nbsp;&minus;μ<sub>0</sub> is large.
'''MathML'''
:<math forcemathmode="mathml">E=mc^2</math>


To calculate the standardized statistic ''Z''&nbsp;=&nbsp;(<span style="text-decoration: overline">''X''</span> &nbsp;&minus;&nbsp; μ<sub>0</sub>)&nbsp;/&nbsp;''s'', we need to either know or have an approximate value for σ<sup>2</sup>, from which we can calculate ''s''<sup>2</sup>&nbsp;=&nbsp;σ<sup>2</sup>&nbsp;/&nbsp;''n''. In some applications, σ<sup>2</sup> is known, but this is uncommon. If the sample size is moderate or large, we can substitute the [[Sample_variance#Population_variance_and_sample_variance|sample variance]] for σ<sup>2</sup>, giving a ''plug-in'' test. The resulting test will not be an exact ''Z''-test since the uncertainty in the sample variance is not accounted for &mdash; however, it will be a good approximation unless the sample size is small. A [[t-test|''t''-test]] can be used to account for the uncertainty in the sample variance when the sample size is small and the data are exactly [[normal distribution|normal]]. There is no universal constant at which the sample size is generally considered large enough to justify use of the plug-in test. Typical rules of thumb range from 20 to 50 samples. For larger sample sizes, the ''t''-test procedure gives almost identical ''p''-values as the ''Z''-test procedure.
<!--'''PNG'''  (currently default in production)
:<math forcemathmode="png">E=mc^2</math>


Other location tests that can be performed as ''Z''-tests are the two-sample location test and the [[paired difference test]].
'''source'''
:<math forcemathmode="source">E=mc^2</math> -->


== Conditions ==
<span style="color: red">Follow this [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering link] to change your Math rendering settings.</span> You can also add a [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering-skin Custom CSS] to force the MathML/SVG rendering or select different font families. See [https://www.mediawiki.org/wiki/Extension:Math#CSS_for_the_MathML_with_SVG_fallback_mode these examples].


For the ''Z''-test to be applicable, certain conditions must be met.
==Demos==


* [[Nuisance parameter]]s should be known, or estimated with high accuracy (an example of a nuisance parameter would be the [[standard deviation]] in a one-sample location test). ''Z''-tests focus on a single parameter, and treat all other unknown parameters as being fixed at their true values. In practice, due to [[Slutsky's theorem]], "plugging in" [[consistent estimator|consistent]] estimates of nuisance parameters can be justified. However if the sample size is not large enough for these estimates to be reasonably accurate, the ''Z''-test may not perform well.
Here are some [https://commons.wikimedia.org/w/index.php?title=Special:ListFiles/Frederic.wang demos]:


* The test statistic should follow a [[normal distribution]]. Generally, one appeals to the [[central limit theorem]] to justify assuming that a test statistic varies normally. There is a great deal of statistical research on the question of when a test statistic varies approximately normally. If the variation of the test statistic is strongly non-normal, a ''Z''-test should not be used.


If estimates of nuisance parameters are plugged in as discussed above, it is important to use estimates appropriate for the way the data were [[sampling (statistics)|sampled]]. In the special case of ''Z''-tests for the one or two sample location problem, the usual sample [[standard deviation]] is only appropriate if the data were collected as an independent sample.
* accessibility:
** Safari + VoiceOver: [https://commons.wikimedia.org/wiki/File:VoiceOver-Mac-Safari.ogv video only], [[File:Voiceover-mathml-example-1.wav|thumb|Voiceover-mathml-example-1]], [[File:Voiceover-mathml-example-2.wav|thumb|Voiceover-mathml-example-2]], [[File:Voiceover-mathml-example-3.wav|thumb|Voiceover-mathml-example-3]], [[File:Voiceover-mathml-example-4.wav|thumb|Voiceover-mathml-example-4]], [[File:Voiceover-mathml-example-5.wav|thumb|Voiceover-mathml-example-5]], [[File:Voiceover-mathml-example-6.wav|thumb|Voiceover-mathml-example-6]], [[File:Voiceover-mathml-example-7.wav|thumb|Voiceover-mathml-example-7]]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Audio-Windows7-InternetExplorer.ogg Internet Explorer + MathPlayer (audio)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-SynchronizedHighlighting-WIndows7-InternetExplorer.png Internet Explorer + MathPlayer (synchronized highlighting)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Braille-Windows7-InternetExplorer.png Internet Explorer + MathPlayer (braille)]
** NVDA+MathPlayer: [[File:Nvda-mathml-example-1.wav|thumb|Nvda-mathml-example-1]], [[File:Nvda-mathml-example-2.wav|thumb|Nvda-mathml-example-2]], [[File:Nvda-mathml-example-3.wav|thumb|Nvda-mathml-example-3]], [[File:Nvda-mathml-example-4.wav|thumb|Nvda-mathml-example-4]], [[File:Nvda-mathml-example-5.wav|thumb|Nvda-mathml-example-5]], [[File:Nvda-mathml-example-6.wav|thumb|Nvda-mathml-example-6]], [[File:Nvda-mathml-example-7.wav|thumb|Nvda-mathml-example-7]].
** Orca: There is ongoing work, but no support at all at the moment [[File:Orca-mathml-example-1.wav|thumb|Orca-mathml-example-1]], [[File:Orca-mathml-example-2.wav|thumb|Orca-mathml-example-2]], [[File:Orca-mathml-example-3.wav|thumb|Orca-mathml-example-3]], [[File:Orca-mathml-example-4.wav|thumb|Orca-mathml-example-4]], [[File:Orca-mathml-example-5.wav|thumb|Orca-mathml-example-5]], [[File:Orca-mathml-example-6.wav|thumb|Orca-mathml-example-6]], [[File:Orca-mathml-example-7.wav|thumb|Orca-mathml-example-7]].
** From our testing, ChromeVox and JAWS are not able to read the formulas generated by the MathML mode.


In some situations, it is possible to devise a test that properly accounts for the variation in plug-in estimates of nuisance parameters. In the case of one and two sample location problems, a [[t-test|''t''-test]] does this.
==Test pages ==


== Example ==
To test the '''MathML''', '''PNG''', and '''source''' rendering modes, please go to one of the following test pages:
*[[Displaystyle]]
*[[MathAxisAlignment]]
*[[Styling]]
*[[Linebreaking]]
*[[Unique Ids]]
*[[Help:Formula]]


Suppose that in a particular geographic region, the mean and standard deviation of scores on a reading test are 100 points, and 12 points, respectively. Our interest is in the scores of 55 students in a particular school who received a mean score of 96. We can ask whether this mean score is significantly lower than the regional mean &mdash; that is, are the students in this school comparable to a simple random sample of 55 students from the region as a whole, or are their scores surprisingly low?
*[[Inputtypes|Inputtypes (private Wikis only)]]
 
*[[Url2Image|Url2Image (private Wikis only)]]
We begin by calculating the [[standard error (statistics)|standard error]] of the mean:
==Bug reporting==
 
If you find any bugs, please report them at [https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=Math&version=master&short_desc=Math-preview%20rendering%20problem Bugzilla], or write an email to math_bugs (at) ckurs (dot) de .
:<math>\mathrm{SE} = \frac{\sigma}{\sqrt n} = \frac{12}{\sqrt{55}} = \frac{12}{7.42} = 1.62 \,\!</math>
 
where <math>{\sigma}</math> is the population standard deviation
 
Next we calculate the [[standard score|''z''-score]], which is the distance from the sample mean to the population mean in units of the standard error:
 
:<math>z = \frac{M - \mu}{\mathrm{SE}} = \frac{96 - 100}{1.62} = -2.47 \,\!</math>
 
In this example, we treat the population mean and variance as known, which would be appropriate if all students in the region were tested. When population parameters are unknown, a t test should be conducted instead.
 
The classroom mean score is 96, which is −2.47 standard error units from the population mean of 100. Looking up the ''z''-score in a table of the standard [[normal distribution]], we find that the probability of observing a standard normal value below -2.47 is approximately 0.5 - 0.4932 = 0.0068. This is the [[one-tailed|one-sided]] [[p-value|''p''-value]] for the null hypothesis that the 55 students are comparable to a simple random sample from the population of all test-takers. The two-sided ''p''-value is approximately 0.014 (twice the one-sided ''p''-value).
 
Another way of stating things is that with probability 1&nbsp;&minus;&nbsp;0.014&nbsp;=&nbsp;0.986, a simple random sample of 55 students would have a mean test score within 4 units of the population mean. We could also say that with 98.6% confidence we reject the [[null hypothesis]] that the 55 test takers are comparable to a simple random sample from the population of test-takers.
 
The ''Z''-test tells us that the 55 students of interest have an unusually low mean test score compared to most simple random samples of similar size from the population of test-takers. A deficiency of this analysis is that it does not consider whether the [[effect size]] of 4 points is meaningful. If instead of a classroom, we considered a subregion containing 900 students whose mean score was 99, nearly the same ''z''-score and ''p''-value would be observed. This shows that if the sample size is large enough, very small differences from the null value can be highly statistically significant. See [[statistical hypothesis testing]] for further discussion of this issue.
 
== ''Z''-tests other than location tests ==
 
Location tests are the most familiar ''Z''-tests. Another class of ''Z''-tests arises in [[maximum likelihood]] estimation of the [[parameter]]s in a [[parametric statistics|parametric]] [[statistical model]]. Maximum likelihood estimates are approximately normal under certain conditions, and their asymptotic variance can be calculated in terms of the [[Fisher information]]. The maximum likelihood estimate divided by its standard error can be used as a test statistic for the null hypothesis that the population value of the parameter equals zero. More generally, if <math>\hat{\theta}</math> is the maximum likelihood estimate of a parameter θ, and θ<sub>0</sub> is the value of θ under the null hypothesis,
 
:<math>
(\hat{\theta}-\theta_0)/{\rm SE}(\hat{\theta})
</math>
 
can be used as a ''Z''-test statistic.
 
When using a ''Z''-test for maximum likelihood estimates, it is important to be aware that the normal approximation may be poor if the sample size is not sufficiently large. Although there is no simple, universal rule stating how large the sample size must be to use a ''Z''-test, [[Monte Carlo method|simulation]] can give a good idea as to whether a ''Z''-test is appropriate in a given situation.
 
''Z''-tests are employed whenever it can be argued that a test statistic follows a normal distribution under the null hypothesis of interest. Many [[non-parametric statistics|non-parametric]] test statistics, such as [[U statistic]]s, are approximately normal for large enough sample sizes, and hence are often performed as ''Z''-tests.
 
== See also ==
* [[Normal distribution]]
* NormDis, normal probability distribution calculator
* [[Standard normal table]]
* [[Standard score]]
* [[Student's t-test|Student's ''t''-test]]
 
==References==
{{No footnotes|date=November 2009}}
* Sprinthall, R.C. (2011) Basic Statistical Analysis. 9th Edition. Pearson Education Group: 672 pp.
 
{{Statistics}}
 
[[Category:Statistical tests]]
[[Category:Normal distribution]]

Latest revision as of 23:52, 15 September 2019

This is a preview for the new MathML rendering mode (with SVG fallback), which is availble in production for registered users.

If you would like use the MathML rendering mode, you need a wikipedia user account that can be registered here [[1]]

  • Only registered users will be able to execute this rendering mode.
  • Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.

Registered users will be able to choose between the following three rendering modes:

MathML


Follow this link to change your Math rendering settings. You can also add a Custom CSS to force the MathML/SVG rendering or select different font families. See these examples.

Demos

Here are some demos:


Test pages

To test the MathML, PNG, and source rendering modes, please go to one of the following test pages:

Bug reporting

If you find any bugs, please report them at Bugzilla, or write an email to math_bugs (at) ckurs (dot) de .