diff --git a/source/statistics/tests/parametric/ztest.rst b/source/statistics/tests/parametric/ztest.rst index a411df1..0383cff 100644 --- a/source/statistics/tests/parametric/ztest.rst +++ b/source/statistics/tests/parametric/ztest.rst @@ -14,24 +14,17 @@ Conditions for using a z-test: According to central limit theorem, a distribution is well approximated when reaching 30 samples. See `here `__ for more infos. - - -To perform a z-test, you should compute the *standard score* (or *z-score*) of your sample :math:`X`. +To perform a z-test with a sample :math:`X` of size :math:`n`, you should compute the sample *standard score* (or *z-score*). The *z-score*, noted :math:`Z`, characterizes how far from the population mean :math:`\mu` your sample mean :math:`\overline{x}` is, in unit of standard deviation :math:`\sigma`. It is computed as follow: .. math:: - Z=\frac{\overline{x}-\mu}{\sigma} + Z=\frac{\overline{x}-\mu}{\sigma_\overline{x}}=\frac{\overline{x}-\mu}{\frac{\sigma}{\sqrt{n}}} .. note:: - The following formula can also be seen, when the original population :math:`\sigma` is unknown: - - .. math:: - Z=\frac{\overline{x}-\mu}{\mathrm{SEM}}=\frac{\overline{x}-\mu}{\frac{s}{\sqrt{n}}} - - In this case, :math:`Z` technically follow a t-distribution (student test). - However, if :math:`n` is sufficiently large, the distribution followed by :math:`Z` is very close to a normal one. - So close that, using z-test in place of the student test to compute *p-values* leads to nominal differences (`source `__). + The SEM is used in the denominator to account for inaccuracies of :math:`\overline{x}`. + The more samples are collected, the more the denominator tends toward :math:`\sigma`. + See :ref:`SEM ` for more details. From :math:`Z`, a *p-value* can be derived using the :math:`\mathcal{N}(0,1)` :ref:`CDF ` noted :math:`\Phi_{0,1}(x)`: @@ -100,7 +93,7 @@ Examples One-tailed ^^^^^^^^^^^ -This exercice is inpired from `this video `__ *(be careful the video uses a wrong formula)*. +This exercice is inpired from `this video `__. A complain was registered stating that the boys in the municipal school are underfed. The average weight of boys of age 10 is 32kg with a standard deviation of 9kg. @@ -115,9 +108,9 @@ Hypothesis: * :math:`H_1` : There is significant difference (:math:`\overline{x} < 32`), the boys from the are underfed .. math:: - Z=\frac{29.5-32}{9}=-0.2777778 + Z=\frac{29.5-32}{\frac{9}{\sqrt{25}}}=-1.388889 -From this z-score, the *p-value* is 0.3905915. As it is greater than 0.05, we cannot reject :math:`H_0`. +From this z-score, the *p-value* is 0.08243327. As it is greater than 0.05, we cannot reject :math:`H_0`. Thus, the boys from the are not underfed. Two-tailed @@ -127,7 +120,7 @@ This exercice is inpired from `this website > 0.05` we cannot reject the null hypothesis :math:`H_0`. +Since :math:`0.06800103 >> 0.05` we cannot reject the null hypothesis :math:`H_0`. Thus, Michigan receives the same amount of public school funding per student.