%matplotlib inline
import random
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
import statsmodels.formula.api as smf
sns.set_context("talk")
dataset
I 7.500909
II 7.500909
III 7.500000
IV 7.500909
Name: y, dtype: float64
dataset
I 4.127269
II 4.127629
III 4.122620
IV 4.123249
Name: y, dtype: float64
df = anascombe.groupby('dataset')['x']
X = []
for key, x in df:
X.append(x.values)
df = anascombe.groupby('dataset')['y']
Y = []
for key, y in df:
Y.append(y.values)
for i in range(0,len(X)):
print(np.corrcoef(X[i],Y[i])[0][1])
%matplotlib inlineimport randomimport numpy as npimport scipy as spimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport statsmodels.api as smimport statsmodels.form...