Minor changes
This commit is contained in:
parent
cd3ac81edf
commit
0ae7db1bd1
7 changed files with 84 additions and 14 deletions
|
@ -18,10 +18,7 @@ Welcome to ScienceNotes's documentation!
|
||||||
statistics/probability_distribution_functions.rst
|
statistics/probability_distribution_functions.rst
|
||||||
|
|
||||||
statistics/distributions/index.rst
|
statistics/distributions/index.rst
|
||||||
statistics/tests_parametric/index.rst
|
statistics/tests/index.rst
|
||||||
statistics/tests_non_parametric/index.rst
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
|
|
32
source/statistics/tests/index.rst
Normal file
32
source/statistics/tests/index.rst
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
Statistical Tests
|
||||||
|
------------------
|
||||||
|
|
||||||
|
|
||||||
|
Statistical tests are used to decide whether a hypotesis is true or not. To do so, two hypothesis must be formulated:
|
||||||
|
|
||||||
|
#. :math:`H_0` : The one that is true at first glance (nothing particular, null, boring):
|
||||||
|
|
||||||
|
- The mean of two populations are equals
|
||||||
|
- The average weight of the children in that school is not different from the one of the country
|
||||||
|
|
||||||
|
#. :math:`H_1` : The one that says: "Something strange is happening"
|
||||||
|
|
||||||
|
- The mean of two populations are differents
|
||||||
|
- The average weight of the children in that school differ from the one of the country
|
||||||
|
|
||||||
|
|
||||||
|
A statistical test usually works with a **p-value** noted :math:`\alpha`.
|
||||||
|
It corresponds to the probability of obtaining the results that you have under the assumption that the null hypothesis is correct.
|
||||||
|
In other words, how lucky you are of obtaining these results.
|
||||||
|
|
||||||
|
Prior performing a statistical test, you must choose a minimal *p-value*.
|
||||||
|
:math:`H_0` will be rejected (meaning :math:`H_1` considered true) if the *p-value* obtained from the statistical test
|
||||||
|
is lower or equal to the one you choose initially.
|
||||||
|
The lower your initial *p-value* is, the more difficult it is to reject the null hypothesis.
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Categories
|
||||||
|
|
||||||
|
parametric/index
|
||||||
|
non-parametric/index
|
|
@ -2,8 +2,8 @@ Parametric Tests
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 1
|
||||||
:caption: Statistics
|
|
||||||
|
|
||||||
ttest
|
|
||||||
ztest
|
ztest
|
||||||
|
ttest
|
||||||
|
|
48
source/statistics/tests/parametric/ztest.rst
Normal file
48
source/statistics/tests/parametric/ztest.rst
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
Z-Test
|
||||||
|
-------
|
||||||
|
|
||||||
|
The z-test is used to assess if the mean :math:`\overline{x}` of sample :math:`X` significantly differ from the one of a known population.
|
||||||
|
The *significance level* is determined by a *p-value* threshold.
|
||||||
|
|
||||||
|
Conditions for using a z-test:
|
||||||
|
|
||||||
|
#. Population is normally distributed
|
||||||
|
#. Population :math:`\mu` and :math:`\sigma` is known
|
||||||
|
#. Sample size is greater than 30 (see note below)
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
According to central limit theorem, a distribution is well approximated when reaching 30 samples.
|
||||||
|
See `here <https://statisticsbyjim.com/basics/central-limit-theorem/>`__ for more infos.
|
||||||
|
|
||||||
|
One-tailed vs Two-tailed
|
||||||
|
========================
|
||||||
|
|
||||||
|
|
||||||
|
To perform a z-test, you should compute the *standard score* (or *z-score*) of your sample.
|
||||||
|
It corresponds to the projection of the sample mean :math:`\overline{x}` under the original population distribution.
|
||||||
|
It is computed as follow:
|
||||||
|
|
||||||
|
.. math::
|
||||||
|
Z=\frac{\overline{x}-\mu}{\sigma}
|
||||||
|
|
||||||
|
.. 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}}}
|
||||||
|
|
||||||
|
This formula originate from the t-test and :math:`Z` technically follow a t-distribution.
|
||||||
|
However, if :math:`n` is sufficiently large, the sample distribution is very close to a normal one.
|
||||||
|
So close that, using the normal in place of the student-t to compute p values leads to nominal differences (`source <https://stats.stackexchange.com/questions/625578/why-is-the-sample-standard-deviation-used-in-the-z-test>`__).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
One tailed two tailed:
|
||||||
|
https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-what-are-the-differences-between-one-tailed-and-two-tailed-tests/
|
||||||
|
|
||||||
|
example 2 tailed https://www.mathandstatistics.com/learn-stats/hypothesis-testing/two-tailed-z-test-hypothesis-test-by-hand
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Examples
|
||||||
|
========
|
|
@ -1,7 +0,0 @@
|
||||||
Z-Test
|
|
||||||
-------
|
|
||||||
|
|
||||||
One tailed two tailed:
|
|
||||||
https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-what-are-the-differences-between-one-tailed-and-two-tailed-tests/
|
|
||||||
|
|
||||||
example 2 tailed https://www.mathandstatistics.com/learn-stats/hypothesis-testing/two-tailed-z-test-hypothesis-test-by-hand
|
|
Loading…
Add table
Reference in a new issue