Skip to content

Commit

Permalink
sm -> smf
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-haru committed Jul 23, 2024
1 parent df91cd3 commit 0cda7fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions 8_Solow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -40,7 +40,8 @@
{
"cell_type": "markdown",
"metadata": {
"heading_collapsed": true
"heading_collapsed": true,
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"## はじめに"
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions 9_Convergence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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])"
]
},
Expand Down Expand Up @@ -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])"
]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0cda7fa

Please sign in to comment.