Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In your jupyter notebook import the following library according to this code import numpy as np import pandas as pd from matplotlib import pyplot import
In your jupyter notebook import the following library according to this code | ||||||||
import numpy as np | ||||||||
import pandas as pd | ||||||||
from matplotlib import pyplot | ||||||||
import statsmodels.api as sm | ||||||||
import statsmodels.formula.api as smf | ||||||||
Place the csv file''Health_sector_returns_20170531-20220627.csv'' in your working directory and read it into a dataframe named returns. Use this file to answer questions in this activity | ||||||||
27 | The number of rows and columns in returns is | |||||||
# rows | # columns | |||||||
1 | 1000 | 10 | ||||||
2 | 10 | 1000 | ||||||
3 | 1300 | 13 | ||||||
4 | 13 | 1300 | ||||||
5 | None of the above | |||||||
Define a dataframe X = returns[['SPY_ret']] and a panda series Y=returns['MRK_ret'] . Add a constant column if 1 to X, and fit an OLS regression model and output its summary. (Hint: review how we did it in the previous video and the part of the notebook implemented for LLY_ret | ||||||||
28 | According to your regression output, the R_squared of the regression is | |||||||
1 | 0.2234 | |||||||
2 | 0.3245 | |||||||
3 | 0.0845 | |||||||
4 | 0.2745 | |||||||
5 | None of the above | |||||||
29 | The corelation between MRK_ret and SPY_ret is | |||||||
1 | 0.432 | |||||||
2 | 0.5239 | |||||||
3 | -0.5235 | |||||||
4 | 0.6734 | |||||||
5 | None of the above | |||||||
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started