Skip to content

Commit

Permalink
Added missing tex macros to examples/ nbs; fix stats overview sns plots
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanistheone committed Jan 20, 2024
1 parent a7f389a commit 2f2a189
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 118 deletions.
54 changes: 47 additions & 7 deletions examples/ANOVA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,63 @@
"id": "5b41ceb6-d385-4837-b5e0-5e21e643d6e6",
"metadata": {},
"source": [
"# Analysis of variance (ANOVA)"
"### Analysis of variance (ANOVA)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "3a91e1db-04f3-4c28-9707-e0a7c6df2d6a",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import seaborn as sns"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "6e1aa2b2-ce9b-420f-8813-e0d0f9ac327a",
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'retina'"
]
},
{
"cell_type": "markdown",
"id": "2030c8e7-a0d8-4a4d-b227-a0a81f11e02d",
"metadata": {},
"source": [
"$\\def\\stderr#1{\\mathbf{se}_{#1}}$\n",
"$\\def\\stderrhat#1{\\hat{\\mathbf{se}}_{#1}}$\n",
"$\\newcommand{\\Mean}{\\textbf{Mean}}$\n",
"$\\newcommand{\\Var}{\\textbf{Var}}$\n",
"$\\newcommand{\\Std}{\\textbf{Std}}$\n",
"$\\newcommand{\\Freq}{\\textbf{Freq}}$\n",
"$\\newcommand{\\RelFreq}{\\textbf{RelFreq}}$\n",
"$\\newcommand{\\DMeans}{\\textbf{DMeans}}$\n",
"$\\newcommand{\\Prop}{\\textbf{Prop}}$\n",
"$\\newcommand{\\DProps}{\\textbf{DProps}}$"
]
},
{
"cell_type": "markdown",
"id": "e41da4dc-40bc-4074-b3ca-5f2a2534fdcf",
"metadata": {},
"source": [
"## Definitions"
"#### Definitions"
]
},
{
"cell_type": "markdown",
"id": "442020c3-458a-469b-a82e-c7f3beafb812",
"metadata": {},
"source": [
"## Formulas"
"#### Formulas"
]
},
{
Expand All @@ -39,31 +79,31 @@
"id": "60311b0a-7c91-4df0-be4a-accc69028d8c",
"metadata": {},
"source": [
"## Example"
"#### Example"
]
},
{
"cell_type": "markdown",
"id": "2edd0ff1-e544-41a3-845a-c0471e345d41",
"metadata": {},
"source": [
"## Explanations"
"#### Explanations"
]
},
{
"cell_type": "markdown",
"id": "bf5f1bcf-d993-47e8-9f1b-52902c63c9e3",
"metadata": {},
"source": [
"## Discussion"
"#### Discussion"
]
},
{
"cell_type": "markdown",
"id": "c6bfa142-4e3f-46a0-bbd9-212692dd1b3d",
"metadata": {},
"source": [
"### Equivalence between ANOVA and OLS\n",
"#### Equivalence between ANOVA and OLS\n",
"\n",
"via https://stats.stackexchange.com/questions/175246/why-is-anova-equivalent-to-linear-regression"
]
Expand Down
Binary file added examples/attachments/equiv_test_hypotheses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions examples/one_sample_t-test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@
"%config InlineBackend.figure_format = 'retina'"
]
},
{
"cell_type": "markdown",
"id": "e2969712-ded6-408c-a30a-3948fdb27afb",
"metadata": {},
"source": [
"$\\def\\stderr#1{\\mathbf{se}_{#1}}$\n",
"$\\def\\stderrhat#1{\\hat{\\mathbf{se}}_{#1}}$\n",
"$\\newcommand{\\Mean}{\\textbf{Mean}}$\n",
"$\\newcommand{\\Var}{\\textbf{Var}}$\n",
"$\\newcommand{\\Std}{\\textbf{Std}}$\n",
"$\\newcommand{\\Freq}{\\textbf{Freq}}$\n",
"$\\newcommand{\\RelFreq}{\\textbf{RelFreq}}$\n",
"$\\newcommand{\\DMeans}{\\textbf{DMeans}}$\n",
"$\\newcommand{\\Prop}{\\textbf{Prop}}$\n",
"$\\newcommand{\\DProps}{\\textbf{DProps}}$"
]
},
{
"cell_type": "markdown",
"id": "09804789-d86e-4df9-a3d9-4106bfbf76d1",
Expand Down Expand Up @@ -109,7 +126,7 @@
"Calculate the sample mean $\\overline{\\mathbf{x}} = \\Mean(\\mathbf{x})$\n",
"and the sample standard deviation $s_{\\mathbf{x}} = \\Std(\\mathbf{x})$.\n",
"We can then calculate the estimated standard error of the mean\n",
"$\\stderrhat{\\overline{\\mathbf{x}}} = \\frac{ s_{\\mathbf{x}} }{ \\sqrt{n} }$."
"$\\stderrhat{\\overline{\\mathbf{x}}} = \\frac{ s_{\\mathbf{x}} }{ \\sqrt{n} }$. "
]
},
{
Expand All @@ -122,7 +139,7 @@
"Compute $t = \\frac{\\overline{\\mathbf{x}} - \\mu_0}{ \\stderrhat{\\overline{\\mathbf{x}}} }$ from\n",
"the sample mean $\\overline{\\mathbf{x}}$,\n",
"the theoretical population mean $\\mu_0$,\n",
"the estimated standard error $\\stderrhat{\\overline{\\mathbf{x}}}$."
"the estimated standard error $\\stderrhat{\\overline{\\mathbf{x}}}$. "
]
},
{
Expand Down
Loading

0 comments on commit 2f2a189

Please sign in to comment.