Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeturrell committed Jan 6, 2024
1 parent 49df06c commit 51cd736
Show file tree
Hide file tree
Showing 29 changed files with 17,194 additions and 1,167 deletions.
1,904 changes: 1,904 additions & 0 deletions _images/063f289be6ecd79290397b59d5012a860da34c2e91a2447e8bb02377e750527e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,915 changes: 1,915 additions & 0 deletions _images/386dab22a3df1ef2681be45bd6b20866dc89f73e33c2acf56dd75d62a412d874.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,334 changes: 1,334 additions & 0 deletions _images/71f34048984d5245c482304d7b21ba8bc4f04e72bce543a120004394929e2f83.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,463 changes: 1,463 additions & 0 deletions _images/a11d75e77779c8972d2f7d41f7166bc3595b9aebc635df59c9d3b8cdecadb255.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,958 changes: 1,958 additions & 0 deletions _images/aa5dff916161a1b75fe37bcb35446182974851c1ba7ace977e095f36e44036e2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,916 changes: 1,916 additions & 0 deletions _images/aebe91dc9dd57f0f802d3585460444d12704b4b6249e44766d9822f66016be5d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,064 changes: 1,064 additions & 0 deletions _images/b41a550d502d35af42df4859bb4072dc43291f34d14c6ee1cca017b1a048d258.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,918 changes: 1,918 additions & 0 deletions _images/cf69385f852253eddf38fdd2665fd6b0e5e13a5a1c5d2de70e1447409d114f31.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,663 changes: 2,663 additions & 0 deletions _images/edae624e802700923b2b9f97c3a67e0c3c2f348c195e58561941236c5eb839f6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 13 additions & 128 deletions _sources/auto-research-outputs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "615bc61b",
"id": "bb5b88be",
"metadata": {},
"source": [
"(auto-research-outputs)=\n",
Expand Down Expand Up @@ -76,67 +76,10 @@
},
{
"cell_type": "code",
"execution_count": 1,
"id": "033d9c5a",
"execution_count": null,
"id": "5c1fc048",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th>time</th>\n",
" <th>Lunch</th>\n",
" <th>Dinner</th>\n",
" </tr>\n",
" <tr>\n",
" <th>smoker</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Yes</th>\n",
" <td>2.83</td>\n",
" <td>3.07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>No</th>\n",
" <td>2.67</td>\n",
" <td>3.13</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"time Lunch Dinner\n",
"smoker \n",
"Yes 2.83 3.07\n",
"No 2.67 3.13"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import seaborn as sns\n",
"import pandas as pd\n",
Expand All @@ -149,82 +92,36 @@
},
{
"cell_type": "markdown",
"id": "01b32733",
"id": "9cc82578",
"metadata": {},
"source": [
"This can be turned into a $\\LaTeX$ table using the following command"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "78fccfc0",
"execution_count": null,
"id": "67c5537e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\\\begin{table}\\n\\\\caption{A Table}\\n\\\\label{tab:descriptive}\\n\\\\begin{tabular}{lrr}\\ntime & Lunch & Dinner \\\\\\\\\\nsmoker & & \\\\\\\\\\nYes & 2.830000 & 3.070000 \\\\\\\\\\nNo & 2.670000 & 3.130000 \\\\\\\\\\n\\\\end{tabular}\\n\\\\end{table}\\n'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"table.style.to_latex(caption='A Table', label='tab:descriptive')"
]
},
{
"cell_type": "markdown",
"id": "82792a7e",
"id": "3dfbc077",
"metadata": {},
"source": [
"Or perhaps you have a regression table, for example"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "bcc9b1b9",
"execution_count": null,
"id": "a78e4cdb",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table style=\"text-align:center\"><tr><td colspan=\"3\" style=\"border-bottom: 1px solid black\"></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td colspan=\"2\"><em>Dependent variable: target</em></td></tr><tr><td style=\"text-align:left\"></td><tr><td style=\"text-align:left\"></td><td>(1)</td><td>(2)</td></tr>\n",
"<tr><td colspan=\"3\" style=\"border-bottom: 1px solid black\"></td></tr>\n",
"\n",
"<tr><td style=\"text-align:left\">ABP</td><td>416.673<sup>***</sup></td><td>397.581<sup>***</sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td>(69.495)</td><td>(70.870)</td></tr>\n",
"<tr><td style=\"text-align:left\">Age</td><td>37.241<sup></sup></td><td>24.703<sup></sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td>(64.117)</td><td>(65.411)</td></tr>\n",
"<tr><td style=\"text-align:left\">BMI</td><td>787.182<sup>***</sup></td><td>789.744<sup>***</sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td>(65.424)</td><td>(66.887)</td></tr>\n",
"<tr><td style=\"text-align:left\">Intercept</td><td>152.133<sup>***</sup></td><td>152.133<sup>***</sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td>(2.853)</td><td>(2.853)</td></tr>\n",
"<tr><td style=\"text-align:left\">S1</td><td></td><td>197.848<sup></sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td></td><td>(143.812)</td></tr>\n",
"<tr><td style=\"text-align:left\">S2</td><td></td><td>-169.243<sup></sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td></td><td>(142.744)</td></tr>\n",
"<tr><td style=\"text-align:left\">Sex</td><td>-106.576<sup>*</sup></td><td>-82.862<sup></sup></td></tr>\n",
"<tr><td style=\"text-align:left\"></td><td>(62.125)</td><td>(64.851)</td></tr>\n",
"\n",
"<td colspan=\"3\" style=\"border-bottom: 1px solid black\"></td></tr>\n",
"<tr><td style=\"text-align: left\">Observations</td><td>442</td><td>442</td></tr><tr><td style=\"text-align: left\">R<sup>2</sup></td><td>0.400</td><td>0.403</td></tr><tr><td style=\"text-align: left\">Adjusted R<sup>2</sup></td><td>0.395</td><td>0.395</td></tr><tr><td style=\"text-align: left\">Residual Std. Error</td><td>59.976 (df=437)</td><td>59.982 (df=435)</td></tr><tr><td style=\"text-align: left\">F Statistic</td><td>72.913<sup>***</sup> (df=4; 437)</td><td>48.915<sup>***</sup> (df=6; 435)</td></tr>\n",
"<tr><td colspan=\"3\" style=\"border-bottom: 1px solid black\"></td></tr><tr><td style=\"text-align: left\">Note:</td><td colspan=\"2\" style=\"text-align: right\"><sup>*</sup>p&lt;0.1; <sup>**</sup>p&lt;0.05; <sup>***</sup>p&lt;0.01</td></tr></table>"
],
"text/plain": [
"<stargazer.stargazer.Stargazer at 0x16477f9a0>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import pandas as pd\n",
"from sklearn import datasets\n",
Expand All @@ -245,7 +142,7 @@
},
{
"cell_type": "markdown",
"id": "5cbd52db",
"id": "a888db4f",
"metadata": {},
"source": [
"which can similarly be cast into $\\LaTeX$ using `reg_results.render_latex()`.\n",
Expand Down Expand Up @@ -421,18 +318,6 @@
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
},
"source_map": [
14,
83,
Expand Down
50 changes: 5 additions & 45 deletions _sources/code-best-practice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "d71139c6",
"id": "0dde4ef4",
"metadata": {},
"source": [
"(code-best-practice)=\n",
Expand Down Expand Up @@ -296,45 +296,17 @@
},
{
"cell_type": "code",
"execution_count": 1,
"id": "fc8c0cbb",
"execution_count": null,
"id": "30829869",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The Zen of Python, by Tim Peters\n",
"\n",
"Beautiful is better than ugly.\n",
"Explicit is better than implicit.\n",
"Simple is better than complex.\n",
"Complex is better than complicated.\n",
"Flat is better than nested.\n",
"Sparse is better than dense.\n",
"Readability counts.\n",
"Special cases aren't special enough to break the rules.\n",
"Although practicality beats purity.\n",
"Errors should never pass silently.\n",
"Unless explicitly silenced.\n",
"In the face of ambiguity, refuse the temptation to guess.\n",
"There should be one-- and preferably only one --obvious way to do it.\n",
"Although that way may not be obvious at first unless you're Dutch.\n",
"Now is better than never.\n",
"Although never is often better than *right* now.\n",
"If the implementation is hard to explain, it's a bad idea.\n",
"If the implementation is easy to explain, it may be a good idea.\n",
"Namespaces are one honking great idea -- let's do more of those!\n"
]
}
],
"outputs": [],
"source": [
"import this"
]
},
{
"cell_type": "markdown",
"id": "1e8cfc79",
"id": "28364c1c",
"metadata": {},
"source": [
"## Advanced Coding Tips\n",
Expand Down Expand Up @@ -417,18 +389,6 @@
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
},
"source_map": [
14,
303,
Expand Down
30 changes: 5 additions & 25 deletions _sources/code-preliminaries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "72769ddf",
"id": "22b82598",
"metadata": {},
"source": [
"(code-preliminaries)=\n",
Expand Down Expand Up @@ -52,22 +52,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"id": "49255628",
"execution_count": null,
"id": "8d278d09",
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Compiled with Python version: 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:35:25) [Clang 16.0.6 ]\n"
]
}
],
"outputs": [],
"source": [
"import sys\n",
"\n",
Expand All @@ -76,7 +68,7 @@
},
{
"cell_type": "markdown",
"id": "8636742c",
"id": "bebb8571",
"metadata": {},
"source": [
"### An Integrated Development Environment, or IDE\n",
Expand Down Expand Up @@ -357,18 +349,6 @@
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
},
"source_map": [
14,
59,
Expand Down
2 changes: 1 addition & 1 deletion _sources/coming-from-stata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "f3c0c4ab",
"id": "88640f7e",
"metadata": {},
"source": [
"# Coming from Stata\n",
Expand Down
20 changes: 4 additions & 16 deletions _sources/craft-research-blogs.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 51cd736

Please sign in to comment.