2

Is it possible to create a coefplot graph in python?

I have a regression model from the following code (whereas data is my data frame):

import statsmodels.formula.api as sm
df = pd.DataFrame({"A": data['percentWatched'], "B": data['agreement'], "C": data['credibility'], "D": data['trust'],  "E": data['age'], "F": data['partIdeology7'], "G": data['vidLength'], "H": data['gender'], "I": data['agreeable'], "J": data['openness']})
result = sm.ols(formula="A ~ B + C + D + E + F + G + H + I + J", data=df).fit()
print(result.params)

print(result.summary())

I would love to chart the results on a coefplot, similar to something like this:

enter image description here

Is that possible in python?

Oliver G
  • 1,021
  • 2
  • 9
  • 20
  • 1
    I know it's a bit late but I just wrote something on this: https://zhiyzuo.github.io/Python-Plot-Regression-Coefficient/ Any comment/suggestions are welcome :) – Zhiya Feb 23 '18 at 03:58

0 Answers0