# P Value

When you perform a hypothesis test in statistics, a p-value helps you determine the significance of your results.

• A small p-value (typically ≤ 0.05) indicates strong evidence against the null hypothesis, so you reject the null hypothesis.

• A large p-value (> 0.05) indicates weak evidence against the null hypothesis, so you fail to reject the null hypothesis.

• p-values very close to the cutoff (0.05) are considered to be marginal (could go either way). Always report the p-value so your readers can draw their own conclusions.

import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model

x=[[1],[2],[3],[7],[5]]
y=[1,2,3,4,5]
regr = linear_model.LinearRegression()

# Train the model using the training sets
regr.fit(x, y)

regr.predict(4)
# Plot outputs
plt.scatter(x, y, color=’black’)
plt.plot(x, y, color=’blue’, linewidth=3)

plt.xticks(())
plt.yticks(())

plt.show()

var=sm.OLS(x,y)
ss=var.fit()
ss.summary()

Dep. Variable: R-squared: y 0.927 OLS 0.909 Least Squares 51.16 Mon, 08 Jan 2018 0.00202 18:22:40 -7.7047 5 17.41 4 17.02 1 nonrobust
coef std err t P>|t| [0.025 0.975] 1.2182 0.170 7.152 0.002 0.745 1.691
 Omnibus: Durbin-Watson: nan 2.85 nan 1.307 1.252 0.52 2.956 1