regression
regression
In [3]: fin.dropna(inplace=True)
In [4]: y=fin['returnOnAssets']
In [6]: x
In [9]: X=sm.add_constant(x)
In [10]: X
Out[10]: const currentRatio debtToEquity ebitda
In [13]: print(model.summary())
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly s
pecified.
[2] The condition number is large, 4.42e+10. This might indicate that there are
strong multicollinearity or other numerical problems.
In [17]: y.test_pred
59 0.084129
Out[17]:
198 0.070687
5 0.064327
21 0.097716
207 0.065393
184 0.087238
86 0.071619
167 0.066811
114 0.075085
37 0.073800
13 0.085601
139 0.093931
62 0.087591
74 0.132399
51 0.073887
183 0.047443
140 0.055721
7 0.132760
42 0.144428
165 0.042749
90 0.062389
121 0.143262
141 0.065798
185 0.050141
196 0.042206
148 0.058587
169 0.071995
123 0.076719
174 0.058076
99 0.071946
200 0.081539
212 0.061014
135 0.083448
187 0.059122
102 0.108028
19 0.069159
208 0.090854
146 0.055471
25 0.074840
84 0.053265
49 0.064228
4 0.098656
81 0.056132
144 0.069132
156 0.056807
132 0.060130
30 0.054889
93 0.101201
162 0.082719
204 0.053697
8 0.064203
100 0.057359
dtype: float64
In [20]: # r square
model.rsquared
0.20885212614490956
Out[20]:
In [ ]: