7
7
import pandas .stats .common as common
8
8
from pandas .util .decorators import cache_readonly
9
9
10
+ # flake8: noqa
10
11
11
12
def fama_macbeth (** kwargs ):
12
13
"""Runs Fama-MacBeth regression.
@@ -28,6 +29,7 @@ def fama_macbeth(**kwargs):
28
29
29
30
30
31
class FamaMacBeth (StringMixin ):
32
+
31
33
def __init__ (self , y , x , intercept = True , nw_lags = None ,
32
34
nw_lags_beta = None ,
33
35
entity_effects = False , time_effects = False , x_effects = None ,
@@ -39,7 +41,7 @@ def __init__(self, y, x, intercept=True, nw_lags=None,
39
41
FutureWarning , stacklevel = 4 )
40
42
41
43
if dropped_dummies is None :
42
- dropped_dummies = {}
44
+ dropped_dummies = {}
43
45
self ._nw_lags_beta = nw_lags_beta
44
46
45
47
from pandas .stats .plm import MovingPanelOLS
@@ -99,7 +101,7 @@ def _results(self):
99
101
def _coef_table (self ):
100
102
buffer = StringIO ()
101
103
buffer .write ('%13s %13s %13s %13s %13s %13s\n ' %
102
- ('Variable' , 'Beta' , 'Std Err' , 't-stat' , 'CI 2.5%' , 'CI 97.5%' ))
104
+ ('Variable' , 'Beta' , 'Std Err' , 't-stat' , 'CI 2.5%' , 'CI 97.5%' ))
103
105
template = '%13s %13.4f %13.4f %13.2f %13.4f %13.4f\n '
104
106
105
107
for i , name in enumerate (self ._cols ):
@@ -148,12 +150,13 @@ def summary(self):
148
150
149
151
150
152
class MovingFamaMacBeth (FamaMacBeth ):
153
+
151
154
def __init__ (self , y , x , window_type = 'rolling' , window = 10 ,
152
155
intercept = True , nw_lags = None , nw_lags_beta = None ,
153
156
entity_effects = False , time_effects = False , x_effects = None ,
154
157
cluster = None , dropped_dummies = None , verbose = False ):
155
158
if dropped_dummies is None :
156
- dropped_dummies = {}
159
+ dropped_dummies = {}
157
160
self ._window_type = common ._get_window_type (window_type )
158
161
self ._window = window
159
162
0 commit comments