# Distinighsing Between Groups on a Bimodal Varaible

I am working with the diamonds data set from the tidyverse package in R.

library(tidyverse)
View(diamonds)


When I plot a histogram of the price variable with 300 bins there looks to be 3 groups.

When I take the log of price these groups become much more vivid. There might even be 4 groups instead of 3!

My question is, how do I make sure there are groups here? What are these groups? Lastly, if I do not have the data on what these groups actually are, let's say for our case the groups are continent from which the diamond was found.

Once I distinguish the groups (maybe through GMM) how do I incorporate it in a regression model, where I regress prices on carat?

Thank you kindly.

Edit** I am editing this comment due to Henry's comment. It's more of friendly rebuttal to the comment - try to explain the DV with features in the data set before trying to group the DV.

If we take a look at the iris data set (not knowing there are three different flowers) and regress Petal Width ~ Sepal Width we would conclude that Sepal Width is not a good predictor.

However, if we originally run our GMM on the Petal Width we get back 3 groups and can visually see that Sepal Width is a good predictor.

• There is a curious gap in prices between $\$1455$and$\$1545$, but the idea of groups just from the charts may be slightly spurious. There is a more understandable marketing tendency for weights to cluster at $1$, $1.5$ or $2$ carats or just above rather than just below, but that is not enough to explain the price patterns. You have the data on that and on other factors that affect price such as cut and clarity and color so you can investigate further Jan 1 '20 at 4:47
• Hi Henry, I am a bit confused on what you think my next steps should be. Price is my DV. Are you saying I should regress the price on other variables to see if I have a variable that explains the grouping? A concern I have is if on a new data set my dependent variables do not describe the grouping. Thanks Jan 1 '20 at 4:55
• What I am saying is that just looking at the distribution of price may be misleading. If you have potential explanatory variables likely to affect price, as you do here, then you should investigate them before concluding there are a particular number of groups Jan 1 '20 at 4:58
• Henry I added to my original post. Thank you for taking the time Jan 1 '20 at 7:20