{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Bootstrap Tutorial\n", "\n", "This notebook contains a tutorial on how to use the bootstrap functionality provided by estimagic. We start with the simplest possible example of calculating standard errors and confidence intervals for an OLS estimator without as well as with clustering. Then we progress to more advanced examples.\n", "\n", "In the example here, we will work with the \"exercise\" example dataset taken from the seaborn library.\n", "\n", "The working example will be a linear regression to investigate the effects of exercise time on pulse." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import seaborn as sns\n", "import statsmodels.api as sm\n", "\n", "import estimagic as em" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Prepare the dataset" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | id | \n", "diet | \n", "pulse | \n", "time | \n", "kind | \n", "constant | \n", "
|---|---|---|---|---|---|---|
| 0 | \n", "1 | \n", "low fat | \n", "85 | \n", "1 | \n", "rest | \n", "1 | \n", "
| 1 | \n", "1 | \n", "low fat | \n", "85 | \n", "15 | \n", "rest | \n", "1 | \n", "
| 2 | \n", "1 | \n", "low fat | \n", "88 | \n", "30 | \n", "rest | \n", "1 | \n", "
| 3 | \n", "2 | \n", "low fat | \n", "90 | \n", "1 | \n", "rest | \n", "1 | \n", "
| 4 | \n", "2 | \n", "low fat | \n", "92 | \n", "15 | \n", "rest | \n", "1 | \n", "