{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Statistical Modeling with Python\n", "\n", "`statsmodels` is better suited for traditional stats" ] }, { "cell_type": "code", "execution_count": 122, "metadata": { "ExecuteTime": { "end_time": "2020-05-13T15:18:36.966142Z", "start_time": "2020-05-13T15:18:36.963232Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# the statsmodels.api uses numpy array notation\n", "# statsmodels.formula.api use formula notation (similar to R's formula notation)\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import statsmodels.api as sm\n", "import statsmodels.formula.api as smf" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## A minimal OLS example" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "Four pairs of points" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "x = np.array([1,2,3,4])\n", "y = np.array([2,6,4,8])" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAADEtJREFUeJzt3F1oZPUZx/HfL5kN6qqYpqlYlWhAVsSLagY77YKIL8WqaC96oajY4rI3fdHaIvZKelHoRRF7IYWw2lIMSlFLxYJV7EoRnNUZXetLtEpqdOu2G9O0ainNpvP0IiORdV+SOWf3bJ75fiAkk5yZ83DQL4f/nnMcEQIArH8DVQ8AACgHQQeAJAg6ACRB0AEgCYIOAEkQdABI4pBBt32f7T22X/nE7z5j+0nb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0XUS8dlh3fJSyfaGkjyT9KiLOrXqeqtg+RdIpEfGC7RMktSV9rR//u7BtSRsj4iPbGyQ9I+mWiGhWPFplbN8mqS7pxIi4qup5qmL7bUn1iFjVDVZH4gydRwR8QkT8UdI/qp6jahGxOyJe6P78oaRpLd993Hdi2Ufdlxu6X317tYLt0yRdKWlb1bOsN0ci6Pt7REBf/o+L/bN9hqTzJO2odpLqdJcYdkraI+nJiOjbYyHpbkm3S+pUPchRICQ9YbvdfYzKQR2JoK/qEQHoT7aPl/SwpFsj4oOq56lKRPwvIr6g5TuuL7Ddl8txtq+StCci2lXPcpTYHBHna/mptt/qLtke0JEIOo8IwH5114sfljQVEY9UPc/RICL+KelpSZdXPEpVNku6urt2/KCki23fX+1I1YmI97rf90j6jZaXsA/oSASdRwTgU7r/EHivpOmIuKvqeapke9T2Sd2fj5V0qaTXq52qGhHxw4g4LSLO0HIr/hARN1Q8ViVsb+xeMCDbGyV9RdJBr4477EGPiCVJHz8iYFrSr1fxiIC0bD8g6VlJm2zvsn1z1TNVZLOkG7V8Braz+3VF1UNV5BRJ223/ScsnQE9GRF9frgdJ0smSnrH9kqTnJP0uIh4/2Bu49R8AkuBOUQBIgqADQBIEHQCSIOgAkARBB4AkCDoAJEHQASCJ/wPk3NKhIeUPUQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plt.scatter(x,y, marker = '.')\n", "plt.xlim(0,5)\n", "plt.ylim(0,10)\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " x y\n", "0 1 2\n", "1 2 6\n", "2 3 4\n", "3 4 8\n" ] } ], "source": [ "# make a dataframe of our data\n", "d = pd.DataFrame({'x':x, 'y':y})\n", "print(d)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Seaborn lmplot" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3XtwXPd53vHvu1fsYnHlRaRIgDZjxrZsWRRJMUk9k8p27MqqYzWtp0NPm8hOOnTS0VidNk2cpI1TN51e0lzUOrWi2JrYqWM649qR4sgXJWqiZBpbpKiLZUu2ZEYkIVIicSNui72+/WMX0BJcAAtgd89ens8MB4vdA+DlIfHgxe+c8x5zd0REpPlCQRcgItKtFMAiIgFRAIuIBEQBLCISEAWwiEhAFMAiIgFRAIuIBEQBLCISEAWwiEhAIkEX0Ai33Xabf/WrXw26DBHpXlbLRh3ZAY+PjwddgojIujoygEVE2oECWEQkIApgEZGAKIBFRAKiABYRCUjDA9jM7jezS2b2TMVzv2ZmL5nZk+U/t6/ysbeZ2XfN7AUz+0ijaxURaaZmdMB/ANxW5fnfdveD5T8PrXzRzMLA7wLvBm4A3m9mNzS0UhGRJmp4ALv7o8DkJj70KPCCu59x9yxwArijrsWJiAQoyDXgu8zs6fISxVCV1/cA5yveHys/V5WZHTezU2Z26vLly/WuVUSk7oIK4E8APwAcBC4Cv1llm2qX8q16B1F3v8/dj7j7kR07dtSnShGRBgokgN39FXcvuHsR+H1Kyw0rjQEjFe/vBS40oz4RkWYIJIDNbHfFuz8BPFNls5PAATN7rZnFgGPAg82oT0Rks9xX/UX9Gg2fhmZmnwNuBbab2RjwUeBWMztIaUnhReBD5W2vBz7p7re7e97M7gK+BoSB+939242uV0RksxZzBS7PZhgZTta0vW0krdvFkS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D4YTKU11fo+4OfMLA+kgWNBfPNR6ih+EvhWeQ0Q4JeB0YpaW2W/1lJrq+zX3cCnzSxM6YfAH7v7l83sY8Apd3+Q0g+TPzSzFyh1aMcCqLPWWj9sZu8F8uVaPxBQrVU1c7/qUmQRkYBoCUJEJCAKYBGRgCiARUQCogAWEQmIAlhEJCAKYBGRgCiARUQCogAWKTOzW8oDYnrMrLc8z3blHAORutGFGCIVzOzXgR4gAYy5+38OuCTpYApgkQpmFgNOAovA33P3QsAlSQfTEoTI1YaBFKW7ZPQEXIt0OHXAIhXM7EFKowlfC+x297sCLkk6WNdOQxNZycx+Csi7+x+Vp3n9PzN7u7s/EnRt0pnUAYuIBERrwCIiAVEAi4gERAEsIhIQBbCISEAUwCIiAVEAi4gERAEsIhKQ/w+2X1lUZVvYJAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sns.lmplot(x = 'x', y = 'y', data = d)\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Formula notation with statsmodels\n", "use statsmodels.formula.api (often imported as smf)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "# data is in a dataframe\n", "model = smf.ols('y ~ x', data = d)\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# estimation of coefficients is not done until you call fit() on the model\n", "results = model.fit()\n", "\n" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " OLS Regression Results \n", "==============================================================================\n", "Dep. Variable: y R-squared: 0.640\n", "Model: OLS Adj. R-squared: 0.460\n", "Method: Least Squares F-statistic: 3.556\n", "Date: Fri, 09 Nov 2018 Prob (F-statistic): 0.200\n", "Time: 15:32:30 Log-Likelihood: -6.8513\n", "No. Observations: 4 AIC: 17.70\n", "Df Residuals: 2 BIC: 16.48\n", "Df Model: 1 \n", "Covariance Type: nonrobust \n", "==============================================================================\n", " coef std err t P>|t| [0.025 0.975]\n", "------------------------------------------------------------------------------\n", "Intercept 1.0000 2.324 0.430 0.709 -8.998 10.998\n", "x 1.6000 0.849 1.886 0.200 -2.051 5.251\n", "==============================================================================\n", "Omnibus: nan Durbin-Watson: 3.400\n", "Prob(Omnibus): nan Jarque-Bera (JB): 0.308\n", "Skew: -0.000 Prob(JB): 0.857\n", "Kurtosis: 1.640 Cond. No. 7.47\n", "==============================================================================\n", "\n", "Warnings:\n", "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\miles\\Anaconda3\\lib\\site-packages\\statsmodels\\stats\\stattools.py:72: ValueWarning: omni_normtest is not valid with less than 8 observations; 4 samples were given.\n", " \"samples were given.\" % int(n), ValueWarning)\n" ] } ], "source": [ "\n", "print(results.summary()) \n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using the abline_plot function for plotting the results" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAH91JREFUeJzt3Xl81PW97/HX1yxkgwQIWza2LIhsgbgVQdmtS8V9r7X20tYe6kpvPfec28fpuT3tORAEtC7U/eipx1Zq19OERTZBlEVFxJkkJJAFCAFC9m3me/8giK2gJDOZ32Tm/Xw8eECGyfw+juTF8OM3H4y1FhER6f3Oc3oAERHxDwVdRCREKOgiIiFCQRcRCREKuohIiFDQRURCxFcG3Rj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zFp63s7vFCkJ6L0/RcnKbn4jQ9F6ed03NhrP3CaW8REemF9E5REZEQoaCLiISIgARdKwJOM8a8YIypDvfr8Y0x6caYt40xe40xe4wxDzg9k1OMMTHGmPeMMR92Phf/4vRMTjPGRBhjdhlj/uT0LE4yxpQZY3YbYz44l0sXe/wceueKADcwh5OXOr4P3G6t/aRHDxykjDHTgQbgFWvtOKfncYoxZhgwzFq70xjTF9gBzA/HXxfGGAPEW2sbjDFRwGbgAWvtuw6P5hhjzMNAHtDPWnuN0/M4xRhTBuRZa8/pDVaBeIWuFQGfY63dCBxzeg6nWWsPWmt3dv64HtjLyXcfhx17UkPnh1Gd38L2agVjTBpwNfCc07P0NoEI+plWBITlF66cmTFmBJALbHN2Eud0nmL4AKgGVltrw/a5AJYBPwK8Tg8SBCxQaIzZ0blG5UsFIujntCJAwpMxJgF4E3jQWlvn9DxOsdZ6rLWTOPmO64uMMWF5Os4Ycw1Qba3d4fQsQWKqtXYyJ7fa/qDzlO1ZBSLoWhEgZ9R5vvhN4DVr7Sqn5wkG1tpaYD1wpcOjOGUq8I3Oc8evAzONMa86O5JzrLVVnd9XA7/j5CnsswpE0LUiQL6g8y8Cnwf2WmuXOj2Pk4wxg4wxSZ0/jgVmA586O5UzrLWPWWvTrLUjONmKddbauxweyxHGmPjOCwYwxsQDc4EvvTqux4Nure0ATq0I2Au8cQ4rAkKWMebXwFYgxxhTYYy5z+mZHDIVuJuTr8A+6Px2ldNDOWQY8LYx5iNOvgBaba0N68v1BIAhwGZjzIfAe8CfrbV//bJP0Fv/RURChN4pKiISIhR0EZEQoaCLiIQIBV1EJEQo6CIiIUJBFxEJEQq6iEiI+P9k1ngXAmQo/AAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sm.graphics.abline_plot(model_results = results)\n", "plt.scatter(d.x, d.y)\n", "\n", "plt.xlim(0,5)\n", "plt.ylim(0,10)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Generating an anova table" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " df sum_sq mean_sq F PR(>F)\n", "x 1.0 12.8 12.8 3.555556 0.2\n", "Residual 2.0 7.2 3.6 NaN NaN\n" ] } ], "source": [ "print(sm.stats.anova_lm(results))\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Making predictions" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "data": { "text/plain": [ "0 4.2\n", "dtype: float64" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results.predict({'x' : 2})" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## numpy array notation\n", "similar to sklearn's notation" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1 2 3 4]\n" ] } ], "source": [ "print(x)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "X = sm.add_constant(x) \n", "# need to add a constant for the intercept term.\n", "# because we are using the numpy notation, we use sm rather than smf" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1. 1.]\n", " [1. 2.]\n", " [1. 3.]\n", " [1. 4.]]\n" ] } ], "source": [ "print(X)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "$$y_i = \\beta_0 + \\beta_1 x_i + \\epsilon_i$$\n", "\n", "$$\\mathbf{\\hat{Y}} = \\boldsymbol{\\beta} \\mathbf{X}$$\n" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# OLS is capitalized in the numpy notation\n", "model2 = sm.OLS(y, X) \n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "results2 = model2.fit()\n" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " OLS Regression Results \n", "==============================================================================\n", "Dep. Variable: y R-squared: 0.640\n", "Model: OLS Adj. R-squared: 0.460\n", "Method: Least Squares F-statistic: 3.556\n", "Date: Fri, 09 Nov 2018 Prob (F-statistic): 0.200\n", "Time: 15:41:47 Log-Likelihood: -6.8513\n", "No. Observations: 4 AIC: 17.70\n", "Df Residuals: 2 BIC: 16.48\n", "Df Model: 1 \n", "Covariance Type: nonrobust \n", "==============================================================================\n", " coef std err t P>|t| [0.025 0.975]\n", "------------------------------------------------------------------------------\n", "const 1.0000 2.324 0.430 0.709 -8.998 10.998\n", "x1 1.6000 0.849 1.886 0.200 -2.051 5.251\n", "==============================================================================\n", "Omnibus: nan Durbin-Watson: 3.400\n", "Prob(Omnibus): nan Jarque-Bera (JB): 0.308\n", "Skew: -0.000 Prob(JB): 0.857\n", "Kurtosis: 1.640 Cond. No. 7.47\n", "==============================================================================\n", "\n", "Warnings:\n", "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\miles\\Anaconda3\\lib\\site-packages\\statsmodels\\stats\\stattools.py:72: ValueWarning: omni_normtest is not valid with less than 8 observations; 4 samples were given.\n", " \"samples were given.\" % int(n), ValueWarning)\n" ] } ], "source": [ "print(results2.summary())\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## OLS solution\n", "\n", "$$(X^TX)^{-1}X^TY$$" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/plain": [ "array([[1., 1.],\n", " [1., 2.],\n", " [1., 3.],\n", " [1., 4.]])" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/plain": [ "array([1. , 1.6])" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.linalg.inv(X.T @ X) @ (X.T @ y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot Interaction of Categorical Factors\n", "\n", "https://www.statsmodels.org/dev/examples/notebooks/generated/categorical_interaction_plot.html\n", "\n", "In this example, we will visualize the interaction between categorical factors. First, we will create some categorical data. Then, we will plot it using the interaction_plot function, which internally re-codes the x-factor categories to integers." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Consumption Gender Income\n", "0 51 Male 80\n", "1 52 Male 80\n", "2 53 Male 90\n", "3 54 Male 90\n", "4 56 Male 100\n", "5 57 Male 100\n", "6 55 Female 80\n", "7 56 Female 80\n", "8 58 Female 90\n", "9 59 Female 90\n", "10 62 Female 100\n", "11 63 Female 100\n" ] } ], "source": [ "# https://stackoverflow.com/questions/55663474/interaction-plot-from-statsmodels-formula-api-using-python\n", "\n", "import pandas as pd\n", "from statsmodels.formula.api import ols\n", "\n", "Consumption = [51, 52, 53, 54, 56, 57, 55, 56, 58, 59, 62, 63]\n", "Gender = [\"Male\", \"Male\", \"Male\", \"Male\", \"Male\", \"Male\", \"Female\",\n", " \"Female\", \"Female\", \"Female\", \"Female\", \"Female\"]\n", "Income = [80, 80, 90, 90, 100, 100, 80, 80, 90, 90, 100, 100]\n", "\n", "df = pd.DataFrame( {\"Consumption\": Consumption, \"Gender\": Gender, \"Income\": Income})\n", "print(df)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/anaconda3/lib/python3.9/site-packages/scipy/stats/stats.py:1541: UserWarning: kurtosistest only valid for n>=20 ... continuing anyway, n=12\n", " warnings.warn(\"kurtosistest only valid for n>=20 ... continuing \"\n" ] }, { "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", "
OLS Regression Results
Dep. Variable: Consumption R-squared: 0.976
Model: OLS Adj. R-squared: 0.967
Method: Least Squares F-statistic: 108.4
Date: Thu, 13 Jan 2022 Prob (F-statistic): 8.11e-07
Time: 14:41:06 Log-Likelihood: -9.9135
No. Observations: 12 AIC: 27.83
Df Residuals: 8 BIC: 29.77
Df Model: 3
Covariance Type: nonrobust
\n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "
coef std err t P>|t| [0.025 0.975]
Intercept 27.3333 3.059 8.935 0.000 20.279 34.387
Gender[T.Male] 4.0000 4.326 0.925 0.382 -5.976 13.976
Income 0.3500 0.034 10.340 0.000 0.272 0.428
Gender[T.Male]:Income -0.1000 0.048 -2.089 0.070 -0.210 0.010
\n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", "
Omnibus: 2.522 Durbin-Watson: 3.273
Prob(Omnibus): 0.283 Jarque-Bera (JB): 0.970
Skew: -0.055 Prob(JB): 0.616
Kurtosis: 1.612 Cond. No. 2.62e+03


Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
[2] The condition number is large, 2.62e+03. This might indicate that there are
strong multicollinearity or other numerical problems." ], "text/plain": [ "\n", "\"\"\"\n", " OLS Regression Results \n", "==============================================================================\n", "Dep. Variable: Consumption R-squared: 0.976\n", "Model: OLS Adj. R-squared: 0.967\n", "Method: Least Squares F-statistic: 108.4\n", "Date: Thu, 13 Jan 2022 Prob (F-statistic): 8.11e-07\n", "Time: 14:41:06 Log-Likelihood: -9.9135\n", "No. Observations: 12 AIC: 27.83\n", "Df Residuals: 8 BIC: 29.77\n", "Df Model: 3 \n", "Covariance Type: nonrobust \n", "=========================================================================================\n", " coef std err t P>|t| [0.025 0.975]\n", "-----------------------------------------------------------------------------------------\n", "Intercept 27.3333 3.059 8.935 0.000 20.279 34.387\n", "Gender[T.Male] 4.0000 4.326 0.925 0.382 -5.976 13.976\n", "Income 0.3500 0.034 10.340 0.000 0.272 0.428\n", "Gender[T.Male]:Income -0.1000 0.048 -2.089 0.070 -0.210 0.010\n", "==============================================================================\n", "Omnibus: 2.522 Durbin-Watson: 3.273\n", "Prob(Omnibus): 0.283 Jarque-Bera (JB): 0.970\n", "Skew: -0.055 Prob(JB): 0.616\n", "Kurtosis: 1.612 Cond. No. 2.62e+03\n", "==============================================================================\n", "\n", "Notes:\n", "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n", "[2] The condition number is large, 2.62e+03. This might indicate that there are\n", "strong multicollinearity or other numerical problems.\n", "\"\"\"" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Reg = ols(formula = \"Consumption ~ Gender + Income + Gender*Income\", data = df)\n", "Fit = Reg.fit()\n", "Fit.summary()" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEJCAYAAAByupuRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA6dElEQVR4nO3dd3hUZdr48e/0ySSEkAIYYEEENBTpNZGWARELvhBFFAmw6i6wqCC236uyuqiwoqigYkHeBFZEl2rBklAFkSZNkCZRIBhKGkmmz/n9cWAQksgAyUySuT/X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BAihEkSEEKIECZJQAghQpgkASGECGGSBIQQIoT9fyuSUiWkpTLGAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "from statsmodels.graphics.factorplots import interaction_plot\n", "plt.style.use('ggplot')\n", "\n", "fig = interaction_plot(\n", " x = Income,\n", " trace = Gender,\n", " response = Fit.fittedvalues,\n", " colors = ['red','blue'],\n", " markers = ['D','^'])\n", "plt.xlabel('Income')\n", "plt.ylabel('Consumption')\n", "plt.legend().set_title(None)\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }