1

want to use R notation for my regression and am using the following code:

import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
d = pd.DataFrame(np.arange(3), columns = ['a'], index = np.arange(3))
d['b'] = np.arange(3)+2
smf.OLS('a ~ b', data=d).fit()

However, I then get a long error message, involving ValueError: unrecognized data structures: / .

What is happening here? Many thanks!

hoelder
  • 43
  • 4

0 Answers0