Question: The diamonds data in the ggplot2 package contains the prices and other measurements of almost 54,000 round cut diamonds. (a) Use scatterplots to explore possible

The diamonds data in the ggplot2 package contains the prices and other measurements of almost 54,000 round cut diamonds.

(a)

Use scatterplots to explore possible relationships between the four numeric variables carat, depth, table, and price. Based on these plots, which two variables seem to have the strongest relationship? Does this relationship appear to be linear or nonlinear?

Hint 1: Visualizing all possible relationships can be done with a single command. Hint 2: Since the diamonds data contains many observations, consider using optional arguments to remove redundant plots and/or shrink points to make the plot(s) take less time to generate.

(b)

Construct a scatterplot between the two numeric variables with the strongest relationship. Put the variable with higher variability on the y-axis.

  • Change the point character from the default open circle to a different symbol of your choice.

  • Shrink the size of the points to between 10 and 50% of the default size so that the points are easier to distinguish.

  • Set the col argument to the clarity variable (i.e., col = clarity) to color the points in the scatterplot according to the clarity of each diamond.

  • Add a legend that explains the color coding in the plot. Explain why the default colors of 1 to 8 are chosen.

Explain why the default colors of 1 to 8 are chosen.

(c)

Construct the same scatterplot from (b) again, but change the default colors to different colors of your choice. The color of the points should still correspond to the clarity of each diamond. Be sure to update the legend to correspond to your new color scheme.

(d)

Interpret the scatterplot from (b) or (c). What does the three-way relationship you observe tell you about the diamonds in the data?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!