Last active
July 24, 2019 19:44
-
-
Save mberrien-fitzsimons/e8b3607bd4e66bf0a858c77ba327bcc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import required library | |
from statsmodels.formula.api import ols | |
#Define the Problem | |
outcome = 'volume' | |
x_cols = ['Friday', 'Monday', 'Thursday', 'Tuesday', 'Wednesday'] | |
#Fitting the actual model | |
predictors = '+'.join(x_cols) | |
formula = outcome + "~" + predictors | |
model = ols(formula=formula, data=msft_model_df).fit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment