Wha, good evening, badgeman!
All right.
Welcome to the Cannabis Data Science Meetup for March 24th.
Last week we talked about market concentration.
So this week we'll do a slightly more formal look and we'll actually look at measures of
market concentration.
Just to set the stage, we've been looking at Colorado data and just from the total revenue
we have and the total number of distributors, we can just calculate the average revenue
per distributor just to get a gauge of what the market share may look like.
This may not actually be representative since it's just an average, but if we do a plot,
we'll see that medical average market share is relatively constant and retail decreases
from 2014 to 2017, indicating that the Colorado cannabis market is becoming more competitive
over time.
So we'll try to measure the market concentration and see if it changes over time.
And how will we do that?
Well, the Herfindale-Herschman Index is a measure of market concentration.
This is widely accepted.
It's used in legal cases and it's a go-to tool for economists.
The Herfindale-Herschman Index is a simple calculation.
It's simply the square of all market shares.
For example, if there were two ferns in the market and each one had a 50% market share,
think Coca-Cola has 50% market share, Pepsi has 50% market share, then you would have
a Herfindale-Herschman Index of 5,000.
What you'll note is, as there are more and more firms in the market and they each have
a relatively equal market size, HHI will approach zero.
And if there is one firm with 100, so 100 squared, then the HHI would be 10,000.
So the HHI increases as the market becomes less competitive and it decreases as the market
becomes more competitive.
Why does that matter?
Well, the HHI is often used in legal cases to take into consideration if certain policies
increase or decrease market concentration.
For example, HHI's between 1,500 and 2,500 are considered concentrated.
Anything above 2,500, as we saw earlier, the two firms, that would be considered highly
concentrated.
So if a market truly were dominated by two firms with each 50% market share, that would
be considered a highly concentrated market.
It's not typical to see market shares greater than 30%, but the cannabis industry is new,
so there are turbulent markets and market shares, and a lot of variance in market shares.
Good.
Nick, joining us?
Welcome, Nick.
We are discussing, essentially, we're discussing the average market share, and this can be
measured by the Herfindale-Herschman index, which is just a square of market shares.
And the reason this is important is, for example, if there are a policy decision, and it's going
to increase the Herfindale-Herschman index by more than 200 points, that's going to increase
somebody's market power.
So it's just interesting to see how different policy decisions may affect market concentration.
So we're just going to go ahead and jump into that with the data here.
So as always, the first step is look at the data.
So let me go ahead and...
All right.
And so this will be available on the Cannabis Data Science GitHub here in just one second.
So essentially, what we're going to do is we're going to attempt to measure the market
concentration, and we're going to do it in Washington State.
So we have wholesale sales.
We have it in two different formats here.
So you have it in columns.
So we have monthly wholesale sales for these six months, from August of 2020 to January
of 2021.
And we have the firms and their monthly sales.
And a common way that you can look at this is what it's called panel data.
So this is what you would consider panel data, where you have your organization, you have
their sales, and you have their month.
So you'll see, for example, you'll have each organization, and you'll have their sales
by month.
All right.
So we've got our data.
So now let's see if we can't estimate this.
So we're going to jump over to SPDR and go ahead and read in this data.
And I'm going to try working with the panel data to begin with.
All right.
So let's look at our data, as always.
So we have our organization, our sales, and our month.
All right.
So I've broken this down into the various steps we need to do.
And we're going to see if we can't code this up here in the next 15 minutes.
So we need the total sale by month.
So we can get our months.
All right.
So let's just start hacking at this.
So I guess we just need sales by month.
So there's probably more elegant ways to do this, but let's just get it done to begin
with.
So for month and months.
All right.
So we'll just need to do.
Right.
So data.sales.
We don't want all of the data, so we'll just want to.
Create a page where our month is equal to the month.
So let's see if this snippet of code.
All right.
This is actually some.
I forgot to.
Record the.
All right.
So we now have total sales by month.
So now we need to calculate the market share for each wholesaler.
By month.
So.
That will actually be fairly easy.
To do.
Let's just think about how to do that.
So.
Well.
This is probably not going to be the most elegant way to do things, but we'll come back
and we can refactor as need be.
All right, let's just iterate over the.
The data for him.
So let's just.
Create a series so.
We're just going to iterate over the rows and then the market share is simply going
to be.
The sales.
Divided by.
The sales by month.
Of that particular month.
And I wonder.
If we could just assign this to the data itself.
So.
Think this is.
Yeah.
lt.
Right.
It's sort of having a mind space of how to assign a value to.
And.
Okay, let's see if.
So that dirty piece of code, like I said.
Always refactor.
So we've now calculated the market share for each organization.
So, rule number one.
Look at the data.
So.
Just the mean market share is close to 1%.
And just as a sanity check.
In Colorado, the market share was dipping down to 0.1%.
So that's interesting.
All right. And so we can actually now calculate the HHI by month.
So let's go ahead and do that to see how concentrated these markets are.
And I'm going to do that in a similar way as we calculated total sales by month.
So.
We'll just look at the data for that particular month.
All right. And so then we'll want to calculate the HHI.
And so now we'll iterate over all the firms. So for.
And remember the HHI.
We're going to add the square of the market share.
And we'll keep track of that value.
And let's see if this works.
So.
We now have the Herfindale Hirschman index and let's go ahead and see if we can plot this real quick in the last five minutes, because that's not doing us any good right there.
So.
Let's see if we can create a series out of this somehow.
I just wish I could sort this.
Let's see if we can.
So.
Real quick.
You're right.
Oh, you're correct, Charles. So that's incredibly helpful.
And just to polish this off in the last two minutes here, we have now in 30 minutes, we have discussed market share.
We've introduced the Herfindale Hirschman index, which is a common measure of market concentration.
We've discussed what the HHI is and how low values represent competitive markets and high values represent less competitive markets.
And we've noticed that it can be used in the legal system to determine if policy decisions increase or decrease market concentration.
We have then compiled wholesale sales from open Washington state data. And if you need the data source, we've compiled it here from OpenTHC, who gets their data from the open records requests.
We have then read in the data. We calculated sales by month.
We then calculated market share for each wholesaler by month.
We finally calculated the HHI by month and we plotted it so we can visualize it. So this is a complete data science exercise in 30 minutes.
And our takeaway is it looks like the market concentration is relatively constant and perhaps even decreasing, except for this quite noticeable spike in October of 2020, where there was a sharp decrease in market competitiveness.
So I think I need to end it here to let people get to the Cannabis Sciences Virtual Conference, where they'll be talking about laboratory information management systems for testing cannabis.
However, I'm going to pass this off to the group and discuss why we may have seen a rise in market concentration in October.
So just to throw my idea out there, that is harvest month. But I'll leave that there for the group, because I actually have to go ahead and be wrapping this up today.
I've got to get to the Cannabis Science Conference.
Awesome. So sorry that was a short day, but I'll try to do an extra offering sometime next week in the afternoon to make up for lost time.
So thanks for attending today.
Thank you. It was great.
Oh, I'm glad you learned something and I'll post this code so that you can go through it and extend upon it.
Okay.
Awesome, Charles. And Nick, thank you for coming today.
Have a nice day. Bye.