Created
April 28, 2024 20:53
-
-
Save otuva/7d511853a5a913d2b338e75423184a94 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 statsmodels.api as sm | |
# Veriler | |
y = np.array([500.0, 550.0, 556.4, 600.0, 450.0, 425.0, 300.0, 725.0, 315.0, 621.1]) | |
x = np.array([70.00, 72.00, 72.56, 77.00, 66.40, 65.10, 41.20, 82.10, 43.00, 80.00]) | |
# Doğrusal regresyon modeli | |
x = sm.add_constant(x) # Model için sabit ekleniyor | |
model = sm.OLS(y, x) | |
results = model.fit() | |
# Eğim (slope) için t-test istatistiği | |
slope_t_stat = results.tvalues[1] # Sabit değil, eğim parametresi için t istatistiği | |
slope_t_stat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment