CommencerCommencer gratuitement

New stocks description (2)

Now that you know what the new stocks look like, you want to find out if any of them provide diversification benefits to your existing portfolio. You can do this by looking at the correlation of each stock to our portfolio, visualized through regression lines.

In this exercise, you are provided with four individual series containing the return of the same four stocks:

  • Goldman Sachs (gs)
  • Coca-Cola (ko)
  • Walt Disney (dis)
  • Caterpillar (cat)

The return of your existing portfolio in portfolio are also available in your workspace. Now it's your turn to analyze the relationships!

Cet exercice fait partie du cours

Visualizing Time Series Data in R

Afficher le cours

Instructions

  • Draw the scatterplot of gs against the portfolio
  • Add a regression line in red and twice as thick as normal
  • On a single graphical window, draw the scatterplots and the regression lines of the four stocks against the portfolio in the order given in the assignment text; add a regression line in red and twice as thick as normal to each plot

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Draw the scatterplot of gs against the portfolio


# Add a regression line in red


# Plot scatterplots and regression lines to a 2x2 window












Modifier et exécuter le code