In [13]:
import statsmodels.formula.api as smf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
final=pd.read_excel('final_version_patrick.xlsx')

In [14]:
Kategorien_IP=final[final['Kategorie']=='IP'].head()

In [18]:
Kategorien_IP_Group = final[[u'ifIncentive',u'ifPartner',u'OeffnungsrateClean']]
Kategorien_IP_Group.head()


Out[18]:
ifIncentive ifPartner OeffnungsrateClean
0 0 1 0.307655
1 1 1 0.301537
2 1 0 0.248967
3 1 0 0.229486
4 1 0 0.212406

In [19]:
mod = smf.ols(formula='OeffnungsrateClean ~ ifPartner + ifIncentive',data=Kategorien_IP_Group)
res = mod.fit()
print res.summary()


                            OLS Regression Results                            
==============================================================================
Dep. Variable:     OeffnungsrateClean   R-squared:                       0.034
Model:                            OLS   Adj. R-squared:                  0.029
Method:                 Least Squares   F-statistic:                     6.821
Date:                Mon, 01 Jun 2015   Prob (F-statistic):            0.00123
Time:                        15:22:24   Log-Likelihood:                 467.61
No. Observations:                 389   AIC:                            -929.2
Df Residuals:                     386   BIC:                            -917.3
Df Model:                           2                                         
Covariance Type:            nonrobust                                         
===============================================================================
                  coef    std err          t      P>|t|      [95.0% Conf. Int.]
-------------------------------------------------------------------------------
Intercept       0.2734      0.008     35.870      0.000         0.258     0.288
ifPartner       0.0104      0.008      1.366      0.173        -0.005     0.025
ifIncentive    -0.0289      0.008     -3.469      0.001        -0.045    -0.013
==============================================================================
Omnibus:                      174.594   Durbin-Watson:                   2.194
Prob(Omnibus):                  0.000   Jarque-Bera (JB):             1612.884
Skew:                           1.656   Prob(JB):                         0.00
Kurtosis:                      12.410   Cond. No.                         3.88
==============================================================================

Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.

In [ ]: