They are the secret losers of last month's general election: Scotland's ancient universities.

For some years the country's four oldest varsities have dominated the backgrounds of politicians at both Westminster and Holyrood.

More than class, more than old school tie, the single thing MPs and MSPs were likely to have in common was attending Glasgow, Edinburgh, Aberdeen or St Andrews.

A new analysis of the class of 2017 - the 59 men and women elected in June's Westminster elections - shows this is not quite as true as it once was.

Some 24 MPs spent at least some of their youth at one of the big four, compared with 33 just two years earlier.

Even adding Dundee, which as a former St Andrews college is entitled to award MA or MSc degrees to graduates, does not give the ancients a majority of seats.

This compares starkly with Holyrood where a single ancient Scottish university, Glasgow, dominates the benches proportionately more than England's high prestige institutions of Oxford and Cambridge.

Experts are reluctant to equate Glasgow or Edinburgh to Oxbridge because the Scottish universities are less likely than their English equivalents to recruit students from public or private schools rather than state ones.

Professor Paul Cairney of Stirling University - which educated four MPs elected last month - has long studied the backgrounds of politicians.

He said: "These figures help confirm that there is no direct equivalent in Scotland to the historic recruitment of so many MPs, and cabinet members in particular, from Oxford and Cambridge.

"For a while, it looked like the closest equivalent was Glasgow, but there is not as clear a long term trend.

"Still, far more MPs have been to University, and the 'ancient' Universities, than the general population.

"It perhaps reflects the fact that Universities give students early chances to discuss active politics and the skills to be successful in politics.

"I taught two MPs when they were undergraduates at Aberdeen, but they were already Conservatives by then."

Edinburgh University

All but one MP, Peter Grant of the SNP, has provided details of their educational background. All but 11 of the 58 who co-operated with The Herald went to university, roughly four out of five.

That figure is far higher than the national average.

Scotland, along with Canada and Russia, ranks among the countries in the world with the highest level of tertiary education, around 45 per cent of the population aged between 25 and 64.

But still a majority of non-retired adults did not go to university. MPs therefore do not, at least in this respect, reflect the society they represent. However, the gulf is even higher in England and Wales: a survey by the Sutton Trust, the educational think tank, found 86 per cent of MPs had gone to university and that some 23 per cent of members had attended either Oxford or Cambridge.

Not all of the politicians we record as going to university finished their degrees. For example, Kirsty Blackman, the MP for Aberdeen North, entered Aberdeen University to study medicine but decided the course was not for her. However, academics who study political backgrounds believe university as a shared experience is as interesting as university as a qualification.

Edinburgh University researcher Lucy Blackburn welcomed greater diversity among universities attended. She added: "There is no reason why you have to go to university to be a good politician. But if there is a bigger mix of universities represented, then that is a good thing."

Ms Blackburn also stressed the importance of having politicians who had experienced college, such as the SNP's Chris Stephens, who went to James Watt in Greenock.

Politicians often meet at university. Glasgow University accounts for half of all Scottish ministers and seven out of 10 cabinet ministers, including First Minister Nicola Sturgeon.

Nicola Sturgeon

Theresa May is the 27th prime minister to have gone to Oxford. She was one of seven Oxford graduates in her first cabinet. Mrs May's cabinet has the lowest proportion of privately educated members since Labour's Clem Attlee's in 1945.

The Herald yesterday published details of the schooling of the latest batch of MPs. Four of the 57 MPs - two Tories and two Nationalists who revealed their details - experienced fee-paying education. It has now emerged Lib Democrat Jamie Stone went to his local secondary, Royal Tain Academy, before going to Gordonstoun aged 15. So a total of five out of 58 MPs to discuss their childhood had some private education.

Where the MPs of the class of 2015 went to university

READ MORE: Analysis of MPs education in 2015

Holyrood MPs also tend to have studied at university, most often one of the ancients. 

READ More: Where MSPs went to to university