Answer:
(a)
import pandas as pd
import matplotlib.pyplot as plt
y = pd.Series([1,0,1,2,5,1,4,6,2,3,5,4,6,8,5,7,9,7,6])
x = pd.Series([60,63,65,70,70,70,80,90,80,80,85,59,90,90,90,94,100,100,100])
plt.scatter(x,y)
(b)
import statsmodels.api as sm
model = sm.OLS(x,y)
res = model.fit()
print(res.summary())
(c)
5
(d)
The ANOVA table is given by print(res.summary())
Explanation:
(a)
For the first part, using python you can use the pandas and matplotlib.pyplot libraries to do an scatter plot then you assign x = the values you are given and y = the values you are give and use the pyplot scatter plot command. The code would look like this. (I also attach the graph)
import pandas as pd
import matplotlib.pyplot as plt
y = pd.Series([1,0,1,2,5,1,4,6,2,3,5,4,6,8,5,7,9,7,6])
x = pd.Series([60,63,65,70,70,70,80,90,80,80,85,59,90,90,90,94,100,100,100])
plt.scatter(x,y)
(b)
For the second part you can use the statsmodel library from python and fit the model with the information given and then the summary function which will give you information about the
, in python
would be
, the code would look like this.
import statsmodels.api as sm
model = sm.OLS(x,y)
res = model.fit()
print(res.summary())
(c)
According to the information of the problem the predicted mean rise in blood pressure level associated with a sound pressure level of 85 decibles is 5.
(d)
According to the table it would be x1 15.0084
(e)
The ANOVA table is given by print(res.summary())