Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Phidelity.xlsx data: An analyst in Phidelity Investments wants to develop a regression model to predict the annual rate of return for a stock based on
Phidelity.xlsx data:
An analyst in Phidelity Investments wants to develop a regression model to predict the annual rate of return for a stock based on the price-earnings (PE) ratio of the stock and a measure of the stock's risk. The data found in the file Phidelity.xlsx were collected for a random sample of stocks. Q2.1. First read the data from the file. Q2.2. Plot scatter plot for each independent variable versus dependend variable. In [ ]: M Y=df[[?] X=df[ '?' ] plt.scatter(X,Y) \# scatter of PE vs. Return In [ ]: M Y=df[ Risk' ] X=df[Return] plt.scatter (X,Y) \# scatter of Risk vs. Return Q2.3. Conduct a regression model for the following equation. Y=b0+aX1+b X 2 where Y is Return, X1 is PE Ratio, and X2 is Risk. In [ ]: M Y=df[[?] X=df[[] result = smf.ols(formula ="?, data =df ). fit() print(result. summary()) print(result.params) Q2.4: Conduct a regression model for the following equation. Y=b0+aX1+bX2+cX3+dX4 where Y is Return, X1 is PE Ratio, and X2 is Risk, X3 is X1 2 and X4 is X22 In [ ]: MY=df[Return] \# add a new column called ' X3 ' whoch is Risk'2 df[X33]=pd. .? (dff?) \# add a new column called 'X4' whoch is Risk'2 df[X4]=pd. . P(dff?) X=df[ [?] ] result =5mf.01s( formula =?, data =dd)fit() print(result. summary()) print(result.params) \begin{tabular}{c|c|c|c|} \hline & A & B & C \\ \hline 1 & PE Ratio & Risk & Return \\ \hline 2 & 7.4 & 1.0 & 7.6 \\ \hline 3 & 11.1 & 1.3 & 13.0 \\ \hline 4 & 8.7 & 1.1 & 8.9 \\ \hline 5 & 11.2 & 1.2 & 10.9 \\ \hline 6 & 11.6 & 1.7 & 12.1 \\ \hline 7 & 12.2 & 1.3 & 12.8 \\ \hline 8 & 12.5 & 1.2 & 11.3 \\ \hline 9 & 12.5 & 1.3 & 14.1 \\ \hline 10 & 13.0 & 1.6 & 14.8 \\ \hline 11 & 13.4 & 1.4 & 16.7 \\ \hline \end{tabular}
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