Skip to content

Instantly share code, notes, and snippets.

@ckholmes5
Created August 17, 2016 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckholmes5/9679e1ca8dd068fbccdf5dfc91c2e323 to your computer and use it in GitHub Desktop.
Save ckholmes5/9679e1ca8dd068fbccdf5dfc91c2e323 to your computer and use it in GitHub Desktop.
#SM requires that intercept be manually entered
intercept = [1] * len(df)
df['intercept'] = intercept
x = df[['months','group', 'female', 'Asia', 'North_America', 'South_America', 'Europe', 'Africa', 'intercept']]
y = np.array(df[['expired']])
y = y.ravel()
print sm.Logit(y,x).fit().summary2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment