## Report on diamond prices

Test the hypothesis that the average price of diamonds in the available data is larger than $4500 after filtering out the cheapest diamonds (< $1000)

```{r fig.width=7, fig.height=7.38, dpi = 72}
result <- single_mean(dataset = "diamonds", var = "price", comp_value = 4500, alternative = "greater", data_filter = "price >= 1000")
summary(result)
plot(result, plots = c("hist", "simulate"))
```

Compare diamond prices by the quality of the 'cut'. It seems that diamonds with a premium cut cost more than diamonds with a ideal cut. Seems strange. Perhaps we should use regression to control for the carats of the diamond. Try it!

```{r fig.width=7, fig.height=11.08, dpi = 72}
result <- compare_means(dataset = "diamonds", var1 = "cut", var2 = "price", adjust = "bonf", data_filter = "price >= 1000")
summary(result, show = FALSE)
plot(result, plots = c("scatter", "density", "bar"))
```

Visualize the relationship between diamond prices, carats, and the cut of the diamond.

```{r fig.width=6.46, fig.height=5.54, dpi = 72}
visualize(dataset = "diamonds", xvar = "carat", yvar = "price", type = "scatter", facet_row = "cut", color = "cut", data_filter = "price >= 1000", custom = FALSE)
```

## Diamond prices

Prices of 3,000 round cut diamonds

### Description

A dataset containing the prices and other attributes of a sample of 3000 diamonds. The variables are as follows:

### Variables

- price = price in US dollars ($338--$18,791)
- carat = weight of the diamond (0.2--3.00)
- clarity = a measurement of how clear the diamond is (I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))
- cut = quality of the cut (Fair, Good, Very Good, Premium, Ideal)
- color = diamond color, from J (worst) to D (best)
- depth = total depth percentage = z / mean(x, y) = 2 * z / (x + y) (54.2--70.80)
- table = width of top of diamond relative to widest point (50--69)
- x = length in mm (3.73--9.42)
- y = width in mm (3.71--9.29)
- z = depth in mm (2.33--5.58)

### Additional information

<a href="http://www.diamondse.info/diamonds-clarity.asp" target="_blank">Diamond search engine</a>