Wednesday, 9 August 2006

Joaoaoaoa Pessoaoaoa

Meh. Blogger ate the first version of my beautiful insights. So, quickly and dirtily... I arrived in Joao Pessoa yesterday morning. On the bus from Salvador I met a student returning from some kind of goddamn Communist conference. I tried to convince him of the error of his ways (with my 20 words of Portuguese) and he ended up inviting me to crash at his. This leads eventually to a night of crazy dancing with a bunch of students at the State University of Paraiba... forro (very fast side-to-side butt-shaking a deux) followed by a ?? quadrille which is kind of like a barn dance except they shouted out all the moves themselves. Big love to Marcos, Junior and Mariana e todos os outros... Marcos whipped up a poem which I will reproduce here without trying to translate:

Vejo o trabalhador
hoje como companheiro
Ombro a ombro caminhames
Seguindo nosso roteiro

Caminhamos sempre juntos
Olhando para horizonte
Contemplando a Utopia
De um dia sermos iguias
Com as nossas diferencas

not bad for five minutes eh? Marcos, fui muito legal de conhecer-te e seus amigos. Espero que nos nos encontramos de novo... 'ta bem... Dave o capitalist "Chicago Boy".



Monday, 7 August 2006

in Salvador bus station

... arrived from Lencois and heading up to Joao de Pessoa in a couple of days. I did 2 days trekking in Lencois (the Chiapada Diamantida) which is fab. beautiful and very hard work.

Since leaving my friends in Sao Paulo I seem to have been sucked into the "traveller" circuit a bit. Lots of nice people but the culture pisses me off slightly. Joe Tourist has two weeks holiday and decides how much to spend on it. These young people have X amount of money and try to make it last as long as possible, which inevitably means they end up haggling bitterly over, like, 25 pence. And they smoke dope. Meh. I dunno, am probably just a crusty old man but occasionally I feel they need a HOLIDAY IN CAMBODIA...

Monday, 31 July 2006

in Brazil

I arrived in Sao Paulo on Friday, four hours late after a traumatic flight with American Airlines. Like an experiment in 'how crap can we be and still survive in a capitalist economy?' We were stuck for three hours on the runway at JFK and nobody told us what was happening. The food, which used to be halfway decent, is now just "chicken or beef?" and vegetarian options are not possible. I assume these guys are zombies, waiting to go bust under pressure from cheapo airline competition and the weight of their debts, pensions & salaries.

Brazil is awesome. The food is delicious, people are friendly, my Portuguese is terrible. Being a political obsessive I am asking everybody about Lula. The outside world is pretty favourable to him, seeing him as one of the "good Left" as opposed to the old Chavez-style populists. Everyone here, by contrast, seems very disappointed. The corruption scandals were really serious - vote buying, links to crime etc. On the other hand, there are no very inspiring alternatives and I have not yet heard any really cogent arguments against the PT's policies. The problem if anything is what they are not doing (fixing the police and education). People believe Lula will win again and it's hard to disagree.

On Saturday morning, Norman Gall from the Fernand Braudel Institute in Sao Paulo invited me to one of their reading circles. A dozen teenagers from state schools were reading Adam Smith in Portuguese. It was inspiring to see so much talent, dedication and enthusiasm. People here become very gloomy when you ask them about politics or society. I see a lot of positives. There's tremendous energy in Sao Paulo. Little charismatic churches have popped up all over the place, scandalizing educated humanists with their unsophisticated approach (anyone can become a priest without even having studied theology!) When you stop at traffic lights, a kid will jump out in front of your car and juggle tennis balls, more or less expertly. English schools are everywhere.

BTW, for a good read on Brazil today check out Norman's paper Lula and Mephistopheles. Starts from the corruption scandals and broadens out to diagnose the whole society.

Wednesday, 5 July 2006

Essex vaut un blog

In between very dull data importing, I thought I could find time to mention Essex. I am about to leave and spend a year at Northwestern.

I've been at two universities in my life, and have had an incredibly happy time at both of them.
Among the great things this place has are psycho ducks and rabbits, Wivenhoe (aka Wiv, The Hoe, Thundercatshoe to various deranged residents), the Wivenhoe trail, and the main building , which is cunningly designed as an ornamental maze. Then there's the amazingly international student body: a sample of young, determined and smart people from all over the world.

The best thing though is the academic community, which is closeknit, friendly, unpretentious and professional. People here are incredibly generous with their time and knowledge. The seminars are great - informal but tough. The PhD students are a very varied and interesting bunch. And Essex is imbued with the spirit of the 60s, from the not-beautiful-but-just-about-lovable architecture to the democratic optimism.

Things I won't miss? The food. Not that it's bad.... I just feel that I have eaten enough Cafe Vert paninis for one lifetime.

See y'all in a year. I'm off to Chicago!

"Are you ready for the city? Is the city ready for you?"
Futureheads The City is Here for You to Use

interpolating data in R

Here's a little function that does linear interpolation of data. For example, if you have a matrix like

[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] NA 1 NA NA 6 NA NA
[2,] NA 8 NA NA 5 NA NA
[3,] NA 1 NA NA 4 NA NA
[4,] NA 7 NA NA 7 NA NA
[5,] NA 9 NA NA 1 NA NA

it will be turned into

[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1 1 2.666667 4.333333 6 6 6
[2,] 8 8 7.000000 6.000000 5 5 5
[3,] 1 1 2.000000 3.000000 4 4 4
[4,] 7 7 7.000000 7.000000 7 7 7
[5,] 9 9 6.333333 3.666667 1 1 1

Columns 1, 6 and 7 have just been copied from columns 2 and 5 - i.e. this doesn't do extrapolation. Columns 3 and 4 have been interpolated linearly.

The columns of the input matrix must be either all valid, or all NA. Otherwise it will get confused. Fixes welcome.



do.interpolate <- function (m) {
if (any(is.na(m[,1]))) m[] <- rep(m[,ncol(m)], ncol(m))
else if (any(is.na(m[,ncol(m)]))) m[] <- rep(m[,1], ncol(m))
else {
p <- ncol(m)-1
m <- as.matrix(m[,c(1, ncol(m))]) %*% matrix(c(p:0/p, 0:p/p), nrow=2,
byrow=T)
}

return (m)
}

# m is a matrix with missing data
mass.interpolate <- function (m) {
for (c in 1:ncol(m))
if (any(is.na(m[,c])) & ! all(is.na(m[,c])))
stop("column ", colnames(m)[c], " of matrix m is incomplete")
valid <- c(1, which(apply(m, 2, function (x) ! any(is.na(x)))))
rvalid <- c(valid[-1], ncol(m))

for (i in 1:length(valid)) {
if (valid[i] == rvalid[i]) next # if left or rightmost cols are valid
m[ ,valid[i]:rvalid[i] ] <- do.interpolate(m[ ,valid[i]:rvalid[i],
drop=F])
}

return(m)
}

Usage: mass.interpolate(my.matrix)

Wednesday, 28 June 2006

‘Big Brother’ eyes make us act more honestly

‘Big Brother’ eyes make us act more honestly

From the article:
"We all know the scene: the departmental coffee room, with the price list for tea and coffee on the wall and the “honesty box” where you pay for your drinks – or not, because no one is watching.
"In a finding that will have office managers everywhere scurrying for the photocopier, researchers have discovered that merely a picture of watching eyes nearly trebled the amount of money put in the box....
"... In previous experiments, people consistently appeared to behave more generously than they needed to for their own self-interest, even when told their actions were anonymous. This has led an influential school of economists to argue that altruism in humans is innate, rather than being based on cynical self-interest.
"But if just a photocopied pair of eyes can treble honesty, the Newcastle team suspects that these previous experiments may somehow have been spoiled by subliminal cues that made people feel they were being watched. "

Sunday, 25 June 2006

One more juicy R tip

If you're like me, you get tired of writing:

mydata[complex.row.condition, complex.column.condition] <- mydata[complex.row.condition, complex.column.condition]+1

or similar. One solution is:

crc <- complex.row.condition
ccc <- complex.column.condition
mydata[crc,ccc]<-mydata[crc,ccc]+1
rm(ccc,crc)

which saves writing out the complex conditions more than once. But it also makes it very cluttered to read and unclear what you are doing.

My alternative solution is to place this function definition in your Rprofile.site file:

inplace <- function (f, arg=1) eval.parent(call("<-",substitute(f)[[arg+1]], f),2)

Now instead of writing, e.g.

foo[bar,baz] <- foo[bar,baz]*2

you can just write

inplace(foo[bar,baz] *2)

or instead of

foo[bar,baz] <- paste(foo[bar,baz], 1:10)

do

inplace(paste(foo[bar,baz], 1:10))

The second argument of the inplace function allows you to use it when your target for assignment is not the first argument of your inner function. For example:

inplace(sub("old", "new", foo[bar,baz]), 3)

is the same as

foo[bar,baz] <- sub("old", "new", foo[bar,baz])

What remains valid in Marxist economics?

Tyler Cowen has a go at answering this question and comes up with five ideas. They are a bit focused on early Marx for me. I would suggest:

  1. His focus on explaining institutions rather than just assuming them. This is still key to modern political economy.
  2. His class-based framework for understanding politics. This is quite a simple schema: the bourgeoisie can ally with the aristocracy or the proletariat. It's still enormously productive. Modern political science, since Olson, has been much less happy with the assumption that classes, which are groups, can automatically solve their collective action problem and come together to defend their interests. But humans seem to be better at this than theory would predict: in particular, they're willing to punish each other to maintain group norms, even at cost to themselves.
  3. Ideology. To find out why an idea is popular it is always worth asking: whose interest is it in?

Tuesday, 13 June 2006

copied and pasted from the UCEA website

I know I'm slightly behind the times with this. The recent AUT strike has interested me, partly because my landlord is a keen supporter. I wanted to find proper time-series data on university lecturers' pay scales, but it would just take too long to put it together - unfortunately, the national statistics web interface is not much use.

Anyway, this is just nicked from a UCEA (employers') press release, so if you disagree, feel free to say why. My italics.

11. During the 1980s and 1990s, declining university funding did not allow for real terms
improvements in academic pay. However, since 2000/01, the sector’s finances have
started to improve. New pay negotiating machinery was introduced at the same time
and average earnings for academic staff have increased by 20.3% since 2001. Over
the same period, the unit of funding per student (representing the income universities
and colleges of higher education get per student they teach) has increased by just
under 16%.
12. In real terms (deflated by the RPI), since 2001 the pay of higher education teaching
professionals has increased by 8.7% compared with 3.9% for all employees, and 6.2%
for all professional occupations.
13. According to the Office of National Statistics (ONS), the average annual earnings of
full-time ‘higher education teaching professionals’ were £40,657 in 2005, placing
academics in the top 20% of earners in the UK. That compares with national average
earnings of £28,210 for all full-time employees, and £36,894 for all professional
occupations.
...
Employers also contribute additional sums – equivalent to 14% of salaries – to
generous final salary pension schemes.


At Essex, the Trots or someone have posted up posters representing the lecturers as Oliver Twist and the Vice-Chancellor as a ruthless workhouse manager: "MORE PAY! I promised you more, but now I say NO!!"

I though point 13 in particular might provide a little context.
I hate to disturb all you bleeding heart liberals, but there is a simple statistical fact here: for three people to commit suicide on the same night, out of spontaneous, independent desperation, is a blinding coincidence. It seems pretty clear that these suicides were planned.

Having said that, the US rhetoric about an "act of war", driven by a half-conscious analogy with suicide-bombing, is disingenuous. You might as well call Jan Palach a terrorist. Perhaps the three deaths were planned as a protest against the Guantanamo regime. If so, as holding people indefinitely without trial is indeed unjust, cruel and totalitarian, it is hard not to sympathize with their point.

Monday, 12 June 2006

R tips

I've been working with large datasets in R and thought I would share some tips. Of interest to statisticians only!

1. On Windows, get tinn-R. You don't want to be working with the basic R editor. On Linux, use emacs or vi as you prefer - emacs is supposedly pretty good.

2. Record everything you do - don't rely on saving the history for this, as it will be indecipherably messy. The ideal is that anyone should be able to replicate your results, from publicly available data, just by running your file of commands. It also helps a lot when you lose data and have to go back and redo it.

3. You will probably end up with a lot of temporary variables. To know which variables you can safely delete, give temporary variables a dot at the end of their name, like:

for (yr. in dataset$years)


4. Save shortened versions of often-used commands in your Rprofile file (on Windows, this will be in c:\program files\R\R-\etc\Rprofile.site).

For example, I like to type hs instead of help.search. If I just put

hs <- help.search

in Rprofile.site, I will get an error on startup. This is because help.search is in the utils package which is not loaded until after the Rprofile has been executed. So you have to be a little sneaky:

setHook(packageEvent("utils", "onLoad"), function (...) {
hs <<- utils::help.search
})

This means that when utils gets loaded, the function help.search gets assigned to hs. The double-headed arrow, by the way, is for global assignment. Otherwise, the assignment would only happen in the body of our function, which would be useless.

5. You can create new operators. For example, I like to be able to type
1:5 %-% 3
and get c(1, 2, 4, 5), i.e. the numbers from 1 to 5 with 3 removed. Another line in my Rprofile.site:
"%-%" <<- setdiff
The setdiff function does what I want, but with %-% it's quicker and more intuitive to read. Similarly

"%like%" <<- function(x,y) grep(y,x, perl=T)
means I can type state[state$name %like% "Al.*",] and get data for Alabama and Alaska.

6. Statisticians tend to want to put everything in one huge table. So for example, if they have 50000 Eurobarometer respondents and they want to use respondent's nation's GDP as an independent variable, they'll create a big table with 50000 rows:
name | nation | GDP | ... other national variables
This is fine until you want to take the log of GDP and it takes the computer five minutes to create 50000 new variables, most of which are duplicates. Take a hint from database administration: keep national variables in a separate data frame, with one row for each nation. Then merge them once you have created all your independent variables, before you start running regressions.

(If you want to know more about how to create good databases, here's a good guide.)

7. Tired of typing brackets all the time to run simple commands? Here's a neat hack:
print.command <- function (x) {
default.args <- attr(x, "default.args")
if (! length(default.args)) default.args <- list()
print(do.call(x, default.args, envir=parent.frame()))
}

class(ls) <- c("command", class(ls))
class(search) <- c("command", class(search))

Now you can type ls or search at the command line without brackets. The magic here is that the end result of any command line is printed, i.e. the print method is called on the object. If we give ls a class of "command", the function
print.command gets called when we evaluate ls. This then runs the function in the command line environment. To set up default arguments, do, e.g.:

attr(ls, "default.args") <- list(all=T)

It would be nice to be able to type fix foo instead of fix(foo), but I don't think it's possible. Correct me if you know better.

NEW 8. You don't have to save everything in one workspace. This is the easiest way to go at first, but when your data becomes large and takes minutes to load, you can separate it into different workspaces and load only the bits you need. To do this, instead of save.image, use

save(foo1, file="foo1.RData")
save(foo2, file="foo2.RData")

et cetera. You then load these in the normal way.


That's your lot! For more, check out http://wiki.r-project.org or R tips. And of course, the occasionally grumpy but always enlightening R-help mailing list.

Backlash

A friend of mine is involved in Backlash, which was set up to combat the UK Government's proposed legislation banning some kinds of extreme pornography. The site has some punchy arguments.

Monday, 15 May 2006

Clem's bluebell pictures




...from near Bristol. Wivenhoe wood is also looking pretty nice.

My entry for the Pimlott Prize

I wrote this for this year's Pimlott Prize, but didn't get shortlisted so I decided to put it up here. It's quite on the gloomy side but I am reasonably persuaded that the fundamental analysis is valid.

You can’t have your cake and eat it

A Lithuanian acquaintance, a graphic designer turned London scaffolder – better cash – took me on a tour of his neighbourhood, Plaistow in East London. We stopped at the Pakistani family whose home he shared, then visited the local beer hall. After a couple of pints, he asked me if I wanted to see “the whites-only pub”. We wandered in. It was dingy and depressing, not frightening (to me). A fat glum barmaid waited for customers. Silence and decay reigned.

The Left has decided that, after decades of peeling paint and lost custom, British identity needs a makeover – and a new, non-racist ownership. The renewed interest started with David Goodhart's essay in Prospect magazine, “Too Diverse?”, which claimed that too much cultural diversity could undermine solidarity, and that shared values might depend on a shared history. As radical Islam hit the headlines, the argument had legs. Trevor Phillips of the Commission for Racial Equality attacked Goodhart as a “liberal Powellite”, but also broke with multiculturalism. Gordon Brown has weighed in with a speech on British identity. The debate has been lively and open-minded. Cultural relativism, the once-common view that value judgments could not cross cultural boundaries, is rarely heard. Neither are there calls for a return to bland ethnic uniformity. Instead, participants struggle to define Britishness as the core minimum that everyone in our society can and must accept. Do we need shared values? Attachment to institutions? Or a broader sense of history and heritage?

To see why this question has hit the agenda, take the family friend who arrived recently from Pakistan's North-West Frontier. A teenage girl, in Liverpool to study computing and business, she was scandalized by the locals: “No culture! No values! And” (lowering her voice) “we get abuse if we go out alone.” Talk of British identity is not just a response to religious extremism: there is also the guilty sense that our civic values are not what they once were. Hence, when the Home Secretary announced a “Britishness test” for immigrants, the wry cartoons of new arrivals answering questions on Burberry and binge-drinking.

How will redefining Britishness work in practice? You don't have to be a Marxist to think that a sense of identity can't just be developed by policy wonks, then handed out to the wider community. Before anything else, after all, national identity is about loyalty to a particular group: about whose side you are on. The English language, the common law, chicken tikka masaala, and other components of our national identity – warm beer and old maids on bicycles, as John Major put it, or liberty, fairness and civic pride if you prefer Gordon Brown's version – all ultimately rest on this foundation. At bottom a nation is just a group of people who are prepared to work together for their common good, what the philosopher John Rawls, in a slightly different context, called a “cooperative venture for mutual advantage”. So perhaps our first question should be, is there still a British nation at all?

Historically, British identity was like other nationalisms, bound up with war. National identity was needed because those that had it would defeat those who didn't. The high point of nationalism came after Napoleon's armies demonstrated the power of this principle Europe-wide. Modern warfare required mass citizen armies, which in turn required mass loyalty. In Britain, this loyalty bound classes together in an unequal partnership. Kipling, the poet of nationalism and empire, eulogized the working-class Tommy Atkins. For their part, the working classes in Britain and elsewhere notoriously sided with nation rather than class in 1914. (This was probably a wise choice: losing a war has worse consequences than losing some share of the surplus from economic development.) Historically, also, nations were communities of fate, in the sense that for almost all their inhabitants, migration to another country cost too much to consider except in dire emergency. It made sense to support the country you were born into, because there was no alternative.

However, the past was not an age of unambiguous national solidarity. The ruling classes could be passionately patriotic, but their attachment was to a particular idea of Britain, not necessarily to everyone within it. About a thousand Old Etonians were killed in the Great War – literally decimation, and an example of the disproportionate share of casualties taken by the officer classes – but at the same time the wealthy could teach their children, as George Orwell was taught, that “the lower classes smell”. David Cannadine’s history of imperial views, Ornamentalism, shows the mixed loyalties of British colonial administrators who might prefer native elites to their own countrymen: “in the Raj Quartet, Major Ronald Merrick, whose social background was relatively lowly, believed that ‘the English were superior to all other races, especially black’. But the Cambridge-educated Guy Perron feels a greater affinity with the Indian Hari Kumar, who went to the same public school as he did, than he does with Merrick… .” Kipling himself recognized that national solidarity waxed and waned as it seemed to be required: “... it's Tommy this, an' Tommy that, an' 'Chuck him out, the brute!' / But it's 'Saviour of 'is country' when the guns begin to shoot”. Britain was a partnership between classes, but an uneasy one.

The conditions for this partnership no longer exist. The threat of war in Europe has receded, as have the potential gains from military empire-building, and in any case mass citizen armies are redundant. Cheaper transport means that nations are more and more communities of choice, not fate. In particular, EU citizens have the right to live and work throughout the Union – a right which is particularly easy to exercise for the highly-skilled and rich. Peace and freedom are, needless to say, very good things, but they have removed the old bases for national identity. This is particularly true for political and social elites, who are increasingly integrated into global economic and social networks, and have correspondingly fewer connections with their own countries. (Here's a quick self-test to find out if you fit this description: how many times have you visited Paris? Now, how many times have you visited Liverpool?)

A liberal optimist would welcome the fact that the old nationalism is redundant. Britain can be a successful economy, attracting talent from around the world. In fact, if we pander to xenophobia by erecting barriers to trade or migration, we only harm ourselves by making our economies less efficient. Whose side should we be on? Nobody's and everybody's.

This perspective has undoubted appeal. It is uncompromisingly cosmopolitan and impartial: the welfare of a Chinese textile worker counts as much as that of a Scottish one, so why favour either over the other? And economic freedom, the creation of integrated world markets in goods and maybe one day in labour, genuinely does make the world richer.

The problem is that globalization, economic integration and freedom of movement affect different parts of countries differently and unequally. Divide the world into three parts: already rich, getting rich and getting poorer. London and Silicon Valley are examples of the rich parts – magnets of talent and ambition. People come there to succeed. They power the world's knowledge economy, and their inhabitants reap corresponding rewards. The rich areas nowadays source much of their talent from the “getting rich” areas: India provides about one third of Silicon Valley's engineers. Both sides benefit from the relationship. Workers from developing countries “send money home”, as Western Union's advert puts it, and often return themselves, bringing new skills.

But not everywhere is like this. Some areas are getting poorer – not absolutely, but relatively. They lack the skills and the infrastructure to compete with the rich areas, but have higher labour costs than the developing world. Consider East Germany. Capital from the West has streamed past it to Eastern Europe, while cheap workers have gone in the opposite direction. Since unification its population has shrunk by 2 million. Or think of Southern Italy, which is such a drain on national resources that the Northern League is calling for secession. (The cruel paradox is that political unity with the rich parts of the world, and the corresponding labour market regulation, is often what makes these areas so unappealing to globally mobile capital.)

If the people in these areas only cared about absolute wealth, the gains from globalisation would outweigh the no doubt temporary pains of adjustment to a fairer and more open world. Alas, humans aren't like that. Adam Smith suggested that it was better to be an English peasant than a king in Africa, who might be the absolute ruler of ten thousand people, but was worse clothed and housed. Stanford undergraduates have settled that question empirically: asked whether they would prefer being twice as rich as they were, if everyone around them were four times richer, or twice as poor but with everyone else four times poorer, they overwhelmingly plumped for the latter. This is not just about envy. As Mind The Gap, Richard Wilkinson's book on health and inequality, argues, relative poverty is fundamentally bad for your health, making you more stressed, more prone to heart attacks and likely to die younger.

The logic of globalization is that Coventry, say, will someday soon be poorer than Bombay, and less connected to London. (This inevitable development could not be changed by any improvement in our workforce's education, contrary to New Labour mythology. Large countries are more important markets than small ones, and their commercial centres draw on a greater pool of talent. Besides, why should developing countries be less able to improve their education systems than we are?) Whatever the absolute gains from free trade, this fall in relative status will be bitterly resented, and there will be enormous political pressure to interfere in the market. In effect, the poorer parts of Britain will ask the rich parts: whose side are you on?

Not everybody has yet understood the lost basis of traditional British identity. Perhaps it is least understood by those who have most to lose. The danger is that when they do, and when they see themselves falling increasingly behind the richer areas of the country, they will seek different repositories for their allegiance. These new groups will not represent Britain in the traditional sense – the old agreement between the classes – but they will call themselves British, and very likely define Britishness by ethnicity. Then our politics really will take on a grimly communal cast.

This has happened already elsewhere. The debate over British identity was fuelled by the visibility of militant Islam, but in the long run a more important context may be the emergence of the radical nationalist Right across Europe. We like to think that our relatively weak Far Right is due to the British tradition of tolerance and moderation. In fact it probably has more to do with the first-past-the-post electoral system, which prevents extremists from getting a foothold. That, however, does not apply in political arenas beyond Westminster – arenas which will become more important, if the cross-party consensus in favour of decentralization has practical results.

This worry explains New Labour's sudden interest in defining Britishness, and in particular the focus on what can bind Britons of different races together. The intention is creditable. But if it is going to be more than a public relations exercise, it will require progressive opinion in this country to make choices for which it is rather unprepared, but which follow inevitably from the view that national identity is at bottom about loyalty to people rather than ideas.

The first of these is that you cannot lecture people on national pride until you have some yourself. The British Social Attitudes survey shows that people with a college degree are about half as likely to say they are “very proud” of being British than people without a qualification. Fair enough: nationalism lost popularity with educated people because of changing economic conditions, but also because it was correctly believed to be the root of many 20th century evils. We are now rediscovering the positive side, though, and would like a new patriotism for the 21st century. Doing that calls less for creative, multicultural redefinitions – we have plenty of those already – than for a new commitment to Britain by those who have the most choice in the matter.

Secondly, this commitment must be reflected in policy. Both major parties have rejected economic protectionism in favour of free trade and openness. Retreating into protectionism and populism would indeed be a terrible mistake. The best way to avoid it is to give greater priority, in social policy, to protecting British communities whose status is endangered by globalization. This requires a hard choice between competing values. Take a simple example. A new publication by the Young Foundation, The New East End: Kinship, Race and Conflict, describes the resentment felt by white East End families when the old system for allocating public housing, based on residence and connection to the community, was replaced by one based on need alone. From a universalist perspective, this resentment simply expresses a formerly privileged group’s unjust sense of entitlement. Residents might, and do, reply that they were owed something as Britons, partners in an ongoing social contract which should not have been broken for the sake of charitable motives. Both views are reasonable, but only one is compatible with talking about national identity.

Which leads unavoidably to an issue most Left-wingers won’t like. Bluntly, if you define Britishness without ethnicity, then you need some other way of defining national membership, and that implies a tough line on immigration. The logic of talking about British identity is to tell people in economically deprived and dislocated areas, “we are on your side, we are part of one nation, you can rely on us to help you through the pains of globalization”. That promise means nothing if the group you point at as the focus of your loyalty can be expanded at will to suit the demands of the market. It’s not a racial issue: opinion polls in 2003 showed that majorities of blacks and Asians, like their white compatriots, saw immigration as out of control. This is unsurprising. Pakistanis in Bradford, just like whites in Essex, face the threat of globalization. There are surely prejudices involved, but the most important one is the – no doubt very unjust – prejudice of disadvantaged and economically insecure Britons in favour of themselves.

Specifically, nobody yet knows whether openness to migration, in an age of cheap travel, can be combined with a generous welfare state, including universal free education and healthcare. On the face of it, it seems extremely improbable. More likely is the USA’s pattern of high growth but very large inequalities. (The United States has combined this with a strong sense of patriotism, and a national identity based on immigrants' dreams of prosperity and success. Perhaps the American dream is simply a myth to justify an unfair society. Whatever truth it has comes from the fact that most US citizens are immigrants or their relatively recent descendants: they or their forefathers – with the obvious exception of African Americans – chose to live somewhere with a lot of freedom but not much security. That is clearly not the case for Britons.)

The Left, and the British political system in general, faces a choice of values: internationalism or nationalism? The power and appeal of internationalism, a proud Left tradition, was shown in widespread support for the Make Poverty History campaign against European trade barriers which harm the developing world's peasant farmers. There is nothing wrong with wanting to treat Chinese and Scottish textile workers the same. But you cannot do that and simultaneously call for a renewed sense of national identity.

The Plaistow pub will probably still stand empty for a long while. Who would ever want to go back there? We could build something more modern, a warm, welcoming place for people of all races. But to do this, we need to rebuild from the foundations, rather than merely changing the décor. In other words, we need not just a different way of expressing national identity, but a new nation which citizens of all races and classes are part of. Alternatively, we can embrace the global market, stay on an economically liberal path (with a few prudent concessions to the misguided majority), let the world benefit, and let outmoded loyalties die in peace.