The big six energy companies have been repeatedly taking advantage of brief spikes in the wholesale price of electricity to pass on much longer-term increases to householders, new analysis for the Guardian shows.

The revelations of potential profiteering over many years were described as appalling by one MP and come amid mounting political pressure for a competition inquiry into the energy sector.

Npower, British Gas and others have repeatedly denied claims of profiteering and have blamed "green taxes" for increasing costs. But new calculations by statisticians at Manchester University show a widening gap between wholesale and retail prices, even before the last couple of months when domestic bills have soared and yet wholesale prices have slumped.

"There is a clear trend and this shows a widening gap between the price consumers pay and the wholesale cost paid by the energy companies," said Dr Nathan Green, a statistician at the university.

The Guardian obtained data on retail prices paid by consumers for their electricity and compared it with a composite measure of wholesale prices paid by electricity companies, generated by information specialist Mintec. This data shows retail prices, even excluding the impact of the relatively new climate change levy, increasing at a faster rate than wholesale electricity prices.

In the first six months of 2004, retail electricity prices were on average £1.93 per 100 kilowatt hour higher than the wholesale measure. By 2010 this gap had more than doubled, to over £4. It narrowed in 2011 as a result of well-publicised cost increases in the wholesale market, but averaged £2.73 in summer – even before the price rises passed on to householders by the big six this autumn.

Green said: "When you take into account seasonal variation, random fluctuations and the time lags between wholesale costs rising and retail prices following, there is never a time at which the energy companies are losing money."

Green's statistical model suggested around 80% of the winter price spike was passed to the consumer price, but when wholesale markets fell in summer, retail prices moved far less – only around 50% of the amount. The data also shows that when wholesale prices suddenly spike – as they did in 2009 – consumer prices rapidly follow suit. However, prices fall back more slowly and to a lesser degree after the wholesale price spike abates.

Richard Lloyd, executive director at consumer group Which?, said the new analysis was alarming. "People don't trust energy companies to charge them a fair price, and this widening gap between wholesale and retail costs will do nothing to put anyone's mind at rest. Suppliers have a long way to go before they can prove that recent price increases are justified," he said.

John Robertson, an opposition MP who has been at the forefront of campaigns against fuel poverty, believed that the study proved what he and others had been saying for years.

"I find it appalling that [regulator] Ofgem have taken so long to catch on to this as MPs like myself have been telling them till we were blue in the face that the wholesale market price and the rise in prices by energy companies is way off kilter. Ofgem couldn't have moved any slower on this issue. If they had, they would have stood still. It's taken them years to realise what the rest of us from customers to MPs saw as obvious," he said.

Centrica, the parent company of British Gas, upset critics earlier this year when it reported annual pre-tax profits of £1.9bn – its largest ever – and then months later raised consumer gas and electricity prices by 18% and 16% respectively.

Christine McGourty, director of Energy UK, the lobby group that works on behalf of the big power groups, said the Guardian data did not provide a meaningful picture of the costs of providing energy to consumers.

"Companies buy much of their energy in advance, at different times, ensuring the energy is available when it's needed and allowing them to smooth out prices for consumers over time," she said.

"In addition, what consumers pay for in their energy bills is not just the cost of the gas and electricity they use but a wide range of other factors which have been increasing, such as environmental and social obligations and the costs of using the energy networks."

Independent industry experts such as Utilyx say the lack of transparency in power company costs and prices make it very hard to judge what is going on. But they note that energy companies hiked retail prices by up to 18% late summer and yet wholesale gas prices have plunged since from 78p per therm in early September to 58p now. Electricity prices are down heavily too due to mild weather and other factors.

Volker Beckers, chief executive of RWE npower, insisted recently that his company made just £1.50 profit on every £100 spent, while making a loss per average customer between 2004 and 2009.

He said: "These are not the figures associated with an industry that is profiteering or uncompetitive."