{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quantile regression" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "This example page shows how to use statsmodels' QuantReg class to replicate parts of the analysis published in \n", "\n", "* Koenker, Roger and Kevin F. Hallock. \"Quantile Regression\". Journal of Economic Perspectives, Volume 15, Number 4, Fall 2001, Pages 143–156\n", "\n", "We are interested in the relationship between income and expenditures on food for a sample of working class Belgian households in 1857 (the Engel data). \n", "\n", "## Setup\n", "\n", "We first need to load some modules and to retrieve the data. Conveniently, the Engel dataset is shipped with statsmodels." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
incomefoodexp
0420.157651255.839425
1541.411707310.958667
2901.157457485.680014
3639.080229402.997356
4750.875606495.560775
\n", "