Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using R studio. The diamonds data frame in ggplot2 package (which is part of tidyverse) contains the prices and other attributes of almost 54,000 diamonds.
Using R studio. The diamonds data frame in ggplot2 package (which is part of tidyverse) contains the prices and other attributes of almost 54,000 diamonds. The variables are as follows:
- Price: price in US dollars
- Carat: weight of the diamond
- Cut: quality of the cut (Fair, Good, Very Good, Premium, Ideal)
- Color: diamond colour, from J (worst) to D (best)
- Clarity: a measurement of how clear the diamond is (I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))
- X: length in mm
- Y: width in mm
- Z: depth in mm
- Depth: total depth percentage = z / mean(x, y) = 2 * z / (x + y)
- Table: width of top of diamond relative to widest point
- Extract all rows from 20001 to 30000 and the first 5 columns of diamonds data and save it as a data frame. Then, answer the following questions based on this subset of diamonds data.
- Is there any linear relationship between price and weight (measured in carat)? Use appropriate charts and/or summary statistics to support your answer.
- Do the following:
- For each cut quality, calculate the following summary statistics for the price of diamonds: mean, median, standard deviation, Q1, Q3, minimum, and maximum. Is it true that the higher the cut quality the higher the price?
- Make boxplots to show the distribution of price by cut quality. (So, you will make 5 boxplots that appear side-by-side.) Discuss the results briefly (e.g., how is diamond price related to cut quality? Are the distributions of diamond price symmetric, right-skewed, or left-skewed?)
- Are you somewhat surprised by the results above? If yes, please try to explain what might have caused the surprise.
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