OTTAWA - The illegal production and consumption of non-medical cannabis was worth about $3.3 billion in 2016, according to a Statistics Canada analysis of the underground economy.

The agency generally hasn't included illegal drugs and prostitution in its analysis of the underground economy, but it has been providing more cannabis-related data ahead of Oct. 17, when recreational use of pot becomes legal in Canada.

StatCan said Friday that underground economic activity totalled $51.6 billion or 2.5 per cent of Canadian gross domestic product in 2016.

If illegal cannabis had been included, the underground economy would have accounted for 2.7 per cent of 2016 GDP.

It said three industries accounted for more than half of the underground economy in 2016: residential construction (26.6 per cent), retail trade (13.5 per cent) and accommodation and food services (12.1 per cent).

Statistics Canada noted the underground economy as a proportion of GDP has been relatively stable, reaching a high of 2.7 per cent in 1994 and a low of 2.2 per cent in 2000 but would have been between 0.2 and 0.3 percentage points higher each year if non-medical cannabis were included.