多元线性回归Python statsmodel在输出中显示predictorVariable [T.x]

时间:2018-04-22 05:17:44

标签: python linear-regression google-trends

   OLS Regression Results                            
==============================================================================
Dep. Variable:                 BTCUSD   R-squared:                       0.989
Model:                            OLS   Adj. R-squared:                  0.985
Method:                 Least Squares   F-statistic:                     260.6
Date:                Sun, 22 Apr 2018   Prob (F-statistic):          1.87e-171
Time:                        13:10:27   Log-Likelihood:                -2119.3
No. Observations:                 280   AIC:                             4383.
Df Residuals:                     208   BIC:                             4644.
Df Model:                          71                                         
Covariance Type:            nonrobust                                         
==========================================================================================================
                                             coef    std err          t      P>|t|      [0.025      0.975]
----------------------------------------------------------------------------------------------------------
Intercept                              -3.013e+05    1.8e+05     -1.674      0.096   -6.56e+05    5.36e+04
howtobuycryptocurrencyWorldwide[T.1]     284.2228    436.490      0.651      0.516    -576.289    1144.735
howtobuycryptocurrencyWorldwide[T.2]    -834.5288    918.605     -0.908      0.365   -2645.499     976.442
howtobuycryptocurrencyWorldwide[T.3]   -1639.0373    892.061     -1.837      0.068   -3397.677     119.603
howtobuycryptocurrencyWorldwide[T.4]   -1822.9216   1349.968     -1.350      0.178   -4484.296     838.453
howtobuycryptocurrencyWorldwide[T.5]    -461.3566    751.629     -0.614      0.540   -1943.144    1020.431
howtobuycryptocurrencyWorldwide[T.6]   -1590.4795   1084.831     -1.466      0.144   -3729.153     548.194
howtobuycryptocurrencyWorldwide[T.7]    -667.8484    506.288     -1.319      0.189   -1665.962     330.265
howtobuycryptocurrencyWorldwide[T.8]    -575.7590   1297.502     -0.444      0.658   -3133.698    1982.180
howtobuycryptocurrencyWorldwide[T.9]   -2449.3509   1565.416     -1.565      0.119   -5535.466     636.764
howtobuycryptocurrencyWorldwide[T.10]   1362.5353   1131.645      1.204      0.230    -868.429    3593.499
howtobuycryptocurrencyWorldwide[T.11]   1.206e+04   5006.070      2.408      0.017    2186.460    2.19e+04
howtobuycryptocurrencyWorldwide[T.13]  -8135.2934   3056.663     -2.661      0.008   -1.42e+04   -2109.283
howtobuycryptocurrencyWorldwide[T.14]   -333.8614   1012.361     -0.330      0.742   -2329.665    1661.943
howtobuycryptocurrencyWorldwide[T.17]  -9448.2497   3586.911     -2.634      0.009   -1.65e+04   -2376.888
howtobuycryptocurrencyWorldwide[T.19]  -8515.1383   3795.035     -2.244      0.026    -1.6e+04   -1033.475
howtobuycryptocurrencyWorldwide[T.35]     -4.1140   1172.341     -0.004      0.997   -2315.308    2307.080
howtobuycryptocurrencyWorldwide[T.36]  -1.713e+04   6089.825     -2.814      0.005   -2.91e+04   -5128.168
howtobuycryptocurrencyWorldwide[T.54]  -1.193e+04   4885.490     -2.441      0.015   -2.16e+04   -2294.187
howtobuycryptocurrencyWorldwide[T.62]  -1.653e+04   5836.682     -2.833      0.005    -2.8e+04   -5027.678
howtobuycryptocurrencyWorldwide[T.72]  -1.193e+04   4509.585     -2.645      0.009   -2.08e+04   -3038.531
howtobuycryptocurrencyWorldwide[T.95]  -8206.0353   3263.856     -2.514      0.013   -1.46e+04   -1771.556
howtobuycryptocurrencyWorldwide[T.100] -2.327e+04   8503.289     -2.737      0.007      -4e+04   -6507.457
howtobuycryptocurrencyWorldwide[T.<1]    -72.6343    359.855     -0.202      0.840    -782.065     636.797

运行线性回归的Python代码:

mod3 = smf.ols('BTCUSD ~ <other variables> +howtobuycryptocurrencyWorldwide+howtobuybitcoinWorldwide+bitcoinWorldwide+howtobuyethereumWorldwide+ethereumWorldwide+howtobuyrippleWorldwide+rippleWorldwide+howtobuylitecoinWorldwide+litecoinWorldwide+bitcoinWorldwideYoutube+ethereumWorldwideYoutube+rippleWorldwideYoutube+litecoinWorldwideYoutube+vitalikWorldwide+satoshiWorldwide',data=cryptos).fit()
  print(mod3.summary())

我不理解预测变量[T.x]符号。有人可以解释一下吗?

1 个答案:

答案 0 :(得分:0)

问题是Google趋势数据已经&#39;&lt; 1&#39;在必须转换的结果中。 我基本上在密码是Dataframe的地方。

cryptos.replace('<1', 0.1 , inplace=True)