Created
June 4, 2021 15:10
-
-
Save jasher4994/fc5a89e3454bd2d312bbd0b4680cc904 to your computer and use it in GitHub Desktop.
This file contains 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 pandas as pd | |
import numpy as np | |
from sklearn.linear_model import LinearRegression | |
import statsmodels.api as sm | |
from scipy import stats | |
X = df.loc[:, ['CenntralisedAge', 'CanDrink']] #could add interactions in here | |
y = df.MRA | |
X = np.array(X) | |
y = np.array(y) | |
X2 = sm.add_constant(X2) #not all problems require a constant | |
est = sm.OLS(y, X2) | |
est2 = est.fit() | |
print(est2.summary()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment