diff --git a/8_Solow.ipynb b/8_Solow.ipynb index 361cb3dc..0639394a 100644 --- a/8_Solow.ipynb +++ b/8_Solow.ipynb @@ -28,7 +28,7 @@ "import numpy as np\n", "import pandas as pd\n", "import py4macro\n", - "import statsmodels.formula.api as sm\n", + "import statsmodels.formula.api as smf\n", "\n", "# numpy v1の表示を使用\n", "np.set_printoptions(legacy='1.25')\n", @@ -40,7 +40,8 @@ { "cell_type": "markdown", "metadata": { - "heading_collapsed": true + "heading_collapsed": true, + "jp-MarkdownHeadingCollapsed": true }, "source": [ "## はじめに" @@ -1431,7 +1432,7 @@ "for var in ky_ratio.columns[-3:]: # 1\n", " \n", " df_temp = ky_ratio.copy() # 2\n", - " res = sm.ols(f'ky_ratio ~ {var}', # 3\n", + " res = smf.ols(f'ky_ratio ~ {var}', # 3\n", " data=df_temp).fit() # 4\n", " bhat = res.params.iloc[1] # 5\n", " pval = res.pvalues.iloc[1] # 6\n", diff --git a/9_Convergence.ipynb b/9_Convergence.ipynb index dd89a237..f19b1197 100644 --- a/9_Convergence.ipynb +++ b/9_Convergence.ipynb @@ -31,7 +31,7 @@ "import numpy as np\n", "import pandas as pd\n", "import py4macro\n", - "import statsmodels.formula.api as sm\n", + "import statsmodels.formula.api as smf\n", "\n", "# numpy v1の表示を使用\n", "np.set_printoptions(legacy='1.25')\n", @@ -1532,7 +1532,7 @@ "outputs": [], "source": [ "formula_absolute = 'gdp_pc_growth ~ gdp_pc_init_log'\n", - "res_absolute = sm.ols(formula_absolute, data=df_convergence).fit()\n", + "res_absolute = smf.ols(formula_absolute, data=df_convergence).fit()\n", "print(res_absolute.summary().tables[1])" ] }, @@ -1792,7 +1792,7 @@ " 'depreciation +'\n", " 'gdp_pc_init_log' )\n", "\n", - "res_conditional = sm.ols(formula_conditional, data=df_convergence).fit()\n", + "res_conditional = smf.ols(formula_conditional, data=df_convergence).fit()\n", "\n", "print(res_conditional.summary().tables[1])" ] @@ -2084,7 +2084,7 @@ "for yr in range(1950, 2010): # 7\n", " \n", " df0 = data_for_regression(yr) # 8 \n", - " res = sm.ols(formula, data=df0).fit() # 9\n", + " res = smf.ols(formula, data=df0).fit() # 9\n", " c = res.params # 10\n", " p = res.pvalues # 11\n", " \n", @@ -2316,7 +2316,7 @@ "for yr in range(1950, 2000): # 11\n", " \n", " df0 = data_for_regression(yr) # 12\n", - " res = sm.ols(formula, data=df0).fit() # 13\n", + " res = smf.ols(formula, data=df0).fit() # 13\n", " c = res.params # 14\n", " p = res.pvalues # 15\n", " hypothesis = ( 'saving_rate=0,' # 16\n", @@ -2772,7 +2772,7 @@ " for yr in range(init_yr, 2000):\n", "\n", " df0 = data_for_regression_group(yr, **kwargs) # 2\n", - " res = sm.ols(formula, data=df0).fit()\n", + " res = smf.ols(formula, data=df0).fit()\n", " c = res.params\n", " p = res.pvalues\n", " hypothesis = ( 'saving_rate=0,'\n",