In [1]: import numpy as np
In [2]: import statsmodels.api as sm In [3]: import statsmodels.formula.api as smf # Load data In [4]: dat = sm.datasets.get_rdataset("Guerry", "HistData").data # Fit regression model (using the natural log of one of the regressors) In [5]: results = smf.ols('Lottery ~ Literacy + np.log(Pop1831)', data=dat).fit() # Inspect the results In [6]: print(results.summary())
No comments:
Post a Comment