Four months into legal recreational marijuana in Colorado, the market for medical cannabis is still by far the most cost-effective way to purchase pot in the state, a FiveThirtyEight analysis has found.

Colorado legalized the sale of recreational marijuana in 2012, setting the stage for the first open recreational marijuana economy in the United States. The first sales of recreational cannabis began this year. The medical marijuana economy had been established in Colorado for several years already, and has continued to be robust.

To see how prices compare across the two markets, I looked at data provided by WeedMaps, a site that posts locations, menus and prices of recreational and medical cannabis for sale in legal areas. The data set comprises 19,484 cannabis flower prices from 814 Colorado medical dispensaries starting in February 2013 and 1,940 cannabis flower prices from 104 Colorado recreational dispensaries, which opened Jan. 1, 2014. I found that at every price point, medical marijuana is cheaper than recreational pot.

There are a number of reasons for this, but the primary ones are an unexpected decrease in supply in these first few months after recreational marijuana legalization and a series of excise and sales taxes levied by the state of Colorado and the City and County of Denver.

While it’s still too early to make generalizations about the success of the recreational regime in Colorado, some interesting trends emerged from my analysis of the marijuana pricing curve.

Cannabis flowers are sold by weight, typically in five quantities. Customers above the age of 21 can purchase as little as a gram of marijuana and as much as an ounce at retail stores. (There are 28.35 grams in an ounce.) Typically, there’s a discount when cannabis is purchased in larger quantities.

Below are the median prices of medical and recreational marijuana in Colorado. At smaller quantities, the price difference is stark: An eighth of an ounce of recreational cannabis is about 50 percent more expensive than an eighth of an ounce of medical cannabis.

Looking at the unit price, we observe that the median per-gram price is substantially lower for medical cannabis. For quantities larger than a gram, the median recreational price per gram ranges between $7.00 and $8.50, while the median medical price per gram is consistently about $5.60.

To understand these price differentials, I spoke to Kayvan Khalatbari, co-founder of Denver Relief, a marijuana dispensary. Khalatbari is also a principal at Denver Relief Consulting, which advises new and existing marijuana businesses in both the medical and recreational markets.

Khalatbari identified two main reasons for the pricing distinction. The first is the additional taxes levied on recreational marijuana. Medical marijuana sold in Denver carries a sales tax of 7.72 percent. Recreational marijuana carries that tax plus a 10 percent marijuana state sales tax and 3.5 percent marijuana sales tax from the City and County of Denver applied at the point of sale. And that’s on top of a 15 percent excise tax applied when a wholesaler sells cannabis in bulk to a retailer.

But if that were the whole story — taxes make things more expensive, tell your friends — it wouldn’t be particularly interesting. Since the sales taxes are applied at the point of sale, we would only expect that 15 percent excise tax to make a difference between the medical price and the recreational price in this data. Yet we see a price difference of upwards of 30 percent across the board.

The second reason Khalatbari cited is a bottleneck in the recreational market. He said that while the state has awarded more than 300 licenses for recreational businesses, only about 15 to 20 percent have received the necessary local approval. As a result, the vast majority of state-licensed recreational dispensaries aren’t in business yet. In addition, Khalatbari said the industry has been slow to scale up production, as many of the expansions in progress — some marijuana-growing facilities are expanding up to 100,000 square feet in size — have seen delays, coupled with the six-month lead time for cultivating the plants.

There’s also the fact that not all marijuana is grown equal. There are wide disparities in quality that we can observe by looking at pricing percentiles. The marijuana market in Colorado shows strong similarities to the market for beer — there are many different qualities and brands available at many different price points, and a large segment of the consumer population has acquired a taste for a product of a certain quality. For marijuana, this means some firms, including Denver Relief, have become private boutique clubs with capped memberships and substantially higher prices for higher-quality cannabis, while other firms target the broader segment of the consumer and tourist population with low- to mid-grade cannabis, priced accordingly.

The chart below the prices of different quantities of marijuana at the 10th and 90th price percentiles, in addition to median prices, for both medical and recreational cannabis.

The medical market has a lower and tighter price curve than the brand-new recreational market.

Of particular interest in the recreational marijuana data is the difference between the low and high ends of the market. For example, at the half-ounce level, the 10th percentile price is 40 percent cheaper than the median price, whereas the 90th percentile price is a whopping 90 percent more expensive than the median price. What gives?

Khalatbari volunteered two theories of why this is happening, both of which seem plausible. The first is that the demand for high-quality recreational cannabis is currently exceeding the supply. The second is that many of the recreational cannabis growers, in anticipation of legalization, automated their production process. When that happens, he said, “you’re going to see a degradation in product,” which then means a larger segment of the recreational cannabis market could be of somewhat lower — and thus cheaper — quality.

Some might wonder whether the recreational marijuana is just better than the medical marijuana — or altogether different stuff. However, it does it appear as though the two markets are selling the same products. I pulled the records for Sour Diesel, a popular strain of cannabis essentially around the 75th price percentile on both the recreational and medical side, and looked at the median prices in each market.

Consumers appear to have noticed that it’s cheaper to purchase medical marijuana. “We’re starting to see more people go and get their medical cards back,” Khalatbari said. “A lot of people ditched them at the end of last year and said, ‘I’m not going to renew, recreational will be here and all will be well,’ but then they’re seeing these higher prices and the lack of product availability.”

Obtaining a medical marijuana card involves some annual costs — typically between $45 and $75 for a doctor’s visit and $15 for the Colorado application fee — but these costs can be made back quickly when factoring in the additional taxes and general price hikes on recreational marijuana. If you’re buying an ounce of marijuana at the median price, you’ll save $60, even before sales taxes, if you go the medical route.

When Colorado passed recreational marijuana legalization, supporters sold it to non-smokers by saying the recreational regime would bring in additional tax revenue. The fact that prices for recreational cannabis are higher due to factors unrelated to direct taxation, and that those prices are turning some recreational users back into medical ones, signals a potential problem for the public coffers.

And given the focus on revenue, it’s interesting that Colorado lowered its medical marijuana application fee from $35 to $15 in mid-December. If the state wanted to incentivize people to pay continual taxes on recreational pot instead of a one-time fee for medical pot, slashing that up-front cost was probably not the best strategy.

The state obviously still cares about collecting taxes, and architects of the marijuana legalization effort both in Colorado and nationally have a vested interest in demonstrating that legal cannabis can be a revenue-generator for states. Since it’s considered fairly easy for a healthy person to obtain a medical marijuana card, recreational prices pushing people back toward medical in the first four months of legal pot in Colorado may not be the best thing for the movement.

It’s far too early to make a conclusive judgment on the industry’s ability to deliver those revenues. Perhaps after the recreational market scales up production, and prices there start to match those in the medical market, consumers will decide that paying the taxes for recreational pot is worth not having to get a cannabis prescription.