Practical - 5 Test for correlation coefficient using Python 1. Find the value of the correlation coefficient and the regression equation to the following table:

PHOTO EMBED

Tue Oct 10 2023 03:38:08 GMT+0000 (Coordinated Universal Time)

Saved by @bvc #undefined

Practical - 5
Test for correlation coefficient using Python
1. Find the value of the correlation coefficient and the regression equation to the following table:
Age
43
21
25
42
57
59
Glucose Level
99
65
79
75
87
81
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt # To visualize
from scipy.stats import pearsonr
from sklearn.linear_model import LinearRegression
table = pd.read_excel("C:/Users/Naveen/OneDrive/Desktop/measures of central tendency.xlsx")
print(table.head())
corr = pearsonr(table.marks, table.hours)
corr
plt.scatter(table.marks, table.hours)
plt.xlabel(“Age”)
plt.ylabel(“Glucose Level”)
content_copyCOPY