Friday, 29 April 2005

beat that suckaz

Election quiz.


Your score is...


+67.9


That means that you're...


* better informed than 92% of people who've already taken the quiz


* better informed than 96% of Labour supporters who've already taken the quiz


* better informed than 91% of Conservative supporters who've already taken the quiz


* better informed than 90% of Liberal Democrat supporters who've already taken the quiz


W00t!

Wednesday, 27 April 2005

The I word

I've been having a few arguments about the immigration issue. It is, as they say, an emotive issue. What follows are just some thoughts.


First, some commentators in the media - Roy Hattersley in yesterday's Guardian, for example - are angry with the Conservatives for playing on people's fears, and turning this into an ugly election. I find this curious. The way the Tories have raised the issue is about as unexceptionable as you could ask for. Their posters have made two claims: "It's not racist to set limits to immigration" and "It's time to set limits to immigration". The first of these is surely right and nobody seems to be disputing it. What about the second? I don't know whether it is time to set limits to immigration: but the Tory advert is simply a statement of their platform. It's not racist or xenophobic in any way. As for the manifesto, it's hardly inflammatory: "Britain has benefited from immigration. We all gain from the social diversity, economic vibrancy and cultural richness that immigration brings."


So I don't see what's wrong with how the Tories are raising the issue. In fact, I rather suspect that what is causing the anger is that they raised it at all. They broke an old taboo in British politics, like the one on the death penalty. Now it is fine to think that democracy is not always a very good way to settle issues. I am a liberal first and a democrat second - as we all should be. But surely if there is any issue that has to be decided collectively, it is that of immigration: and surely if nations do have any rights, they have the right to decide on their immigration policy.


Second, many people in the media have attacked the Tories for confusing the issue, and specifically, for confusing asylum and immigration. Asylum is a matter of our legal and moral obligations; immigration is a matter of economic interest. The Tories are using worries about the asylum system to stir up feeling against immigration.


Is this really fair? Surely the reason people are worried about asylum is that they think the asylum system is being abused by economic migrants. No matter how important the legal distinction between asylum-seekers and immigrants may be in the legal system, in the communities which receive them it is a distinction without a difference.


The attentive reader will notice that so far, I haven't said anything about the actual issues. Is immigration out of control? Is it time to limit immigration? Is the asylum system being abused?


To use the most important words in the language: I don't know.


Some things about immigration are unequivocally good, some are equally clearly bad, and most of the important things are in between. The goods: immigration brings smart, enterprising people into our society. It provides more working-age people to help pay for pensions (although perhaps we should be thinking about why we don't have enough people working as it is....)


The bads: immigration makes a small country fuller of people. It puts pressure on public services like the NHS which find it hard to meet with increased demand (although perhaps we should be thinking about why our public services aren't more flexible....)


As I said the real kicker is what is in between. Culturally, we gain from the diversity; but we can also lose, in a quite straightforward way, as when schools have to deal with children who speak many different first languages. Economically, Britain gains from having more workers; but perhaps employers use migrant labour to drive down wages or even to avoid minimum-wage laws - so that workers in some parts of the economy may lose out. How do we balance these competing judgments? I don't know. What I am sure of is that the way to decide is by looking for proper social scientific evidence.


How high is immigration? A good place to start is the Home Office statistics. In particular, take a look at the chart on page 8 of this document. It shows "grants of settlement" - ie, people being allowed to stay permanently in the UK - for 1983-2003. Over the past few years - since 1997, say - there has certainly been a substantial rise. Whether you think the figures (about 120,000 per year for the past couple of years) are too high or too low depends on your views on the points above. You should also bear in mind that other people have left the UK, so these are not net figures. That matters if you worry about the effects of population pressure, but less if you worry about the difficulties of getting along between different cultures. Some people might also worry about people staying in the UK unofficially: I don't know whether they are right.


Is immigration out of control? There are several points here. First of all, is the asylum system working as it should? There seems to be a widespread consensus that it wasn't - that large backlogs were unfair to all concerned and also allowed people to drop out of the system. On the other hand, the government is now trying to tighten this up and has had some success (asylum applications are substantially down on a few years ago). Second, there is a rather gloomy possibility. Perhaps the asylum system itself - even if it works as intended - intrinsically prevents us from controlling immigration, because it means that we have duties to take in refugees fleeing persecution, and there are potentially millions of such people in the world. It would be grim indeed to be faced with a choice between controlling our immigration policy and fulfilling a basic humanitarian goal. Nevertheless, I can't be sure that this isn't the case. Perhaps a proactive ethical foreign policy would mitigate this problem by lessening persecution abroad. Third, there is the issue of Europe. The Tories want more national control of immigration policy. What the situation is as it stands, I don't know: this EU policy document seems like a good starting point.


Is the asylum system being abused? By definition, reliable statistics about this are hard to come by. The Home Office rejects a lot of asylum applications, but that may be because of applicants failing to fulfil bureaucratic procedures, rather than because they are not genuinely fleeing persecution. My view is based on my own judgments about human behaviour. If I lived in a poor and dangerous country, I would like to come to the UK, and I might well be prepared to lie to do it. So I would be astounded if some asylum-seekers were not, as the tabloids say, "bogus". On the other hand, I strongly suspect that Home Office immigration officials are under pressure to turn down applications, even if they didn't want to themselves - after all, what kind of person works in this kind of job? - so I would also be surprised if some genuine refugees fleeing persecution were not turned down and sent back to really dangerous situations. How many are there of each? I have no idea.


Finally, a general point. Until a few years ago, multiculturalism was, according to all decent upstanding opinion, unequivocally a good thing, and anyone who said the opposite was probably a racist and certainly dangerous - like that dreadful Norman Tebbit with his cricket test. Then, in a surprisingly short time, this consensus broke down. Doubts were expressed. Important people like Trevor Phillips started saying that integration into a common culture was needed. And now, hardly anyone says that multiculturalism is simply a good thing.


From this I learnt that opinions based on what other people will think of you are likely to change very fast: in fact, speaking for myself, I don't think they are worth having.

Wednesday, 13 April 2005

Just had to quote a bit more ...

52. The form controls Firefox draws in Web pages are not just inconsistent with those in the rest of the operating system, they are quite possibly the ugliest interactive controls seen in any graphical interface since AmigaDOS 2.04. For example, text fields have borders that, by default, are visible on only two sides out of four. <select> elements are rendered not as normal option menus, but as much less efficient drop-down scrolling listboxes. And radio buttons look like they were drawn in the dark with a broken pencil.


Other than that, Firefox is a nice browser. Just for the record.


I actually find this stuff really encouraging. The open source desktop is now only about as bad as Windows.

I like it

A snarky look at Linux/Gnome usability. It's supposedly about the cool new Ubuntu distro, but in fact a lot is relevant to all of Gnome. Some of it's a bit wacky:


18. Ubuntu supports the annoying and near-useless Insert and Caps Lock keys, with no obvious way to deactivate them. (Windows and Mac OS also make the mistake of supporting Caps Lock.


But some of it is bang on and extremely funny:


20. A lot of technical gibberish is displayed when the computer starts up, and when it shuts down.


25. The dialog for choosing what language to use lists languages in a control that does not look clickable. Among other options, the list includes â??Lastâ?? without telling me which language that was, â??System Defaultâ?? without telling me which language that is, and â??POSIX/C Englishâ?? which is an oxymoron.


It's good stuff. Better still, this guy is apparently an Ubuntu employee, so hopefully he will have some leverage to get things fixed...


Currying in R

I'm deep in the R language as I attempt to make sense of my data. Here's a nice trick I've learnt for when you want to customize one of R's panel plots.


Suppose you want to produce a set of plots for some of your variables. You fire up the pairs function:


pairs(~ AGE + LIBERALISM + EDUCATION)


and you get a nice set of 6 little plots showing AGE against LIBERALISM, AGE against EDUCATION, etc. etc. As it is hard to take all the information in, you decide to add a smoothing line in there:


pairs(~ AGE + LIBERALISM + EDUCATION, panel=panel.smooth)


But suppose you want to change the way panel.smooth operates. You could just pass in extra parameters, but that isn't always the case, and perhaps in any case you want to reuse the same parameters over again elsewhere - but without setting them globally via par.set().


We'll use a little computer science trick known as currying. Currying means creating a new function, based on the old one but with some arguments "pre-filled in".


First, make a copy of your target function:


mysmooth = panel.smooth


Now have a look at its arguments:


formals(mysmooth)


You should see a list of named parameters. There's one called col.smooth, which chooses the colour of the smoothing line. Let's edit it.


formals(mysmooth)$col.smooth = "turquoise"


And we'll change the plotting symbol to something smaller:


formals(mysmooth)$pch = "."


Now just pass this new function into pairs():


pairs(~ AGE + LIBERALISM + EDUCATION, panel=mysmooth)


and there you go. You can keep your mysmooth function around for whenever you want a particular "look and feel", but without remembering all the individual graphics parameters to set.


Tuesday, 5 April 2005

HOWTO deal with panel data in R, part one

These are really just notes for myself, but they may be useful to others. I am learning as I go.


There aren't really any easy introductions online, as far as I can tell. A useful resource appears to be the S-plus users' guide to nlme.


First of all, load the "nlme" library.


>library(nlme)


Now you can create your panel data object. Assume your data is loaded in a data frame called "df"; the time variable is called "year"; the panel id variable is called, say, "country". You also have a dependent variable called "GDP".


> panel.data <- groupedData(GDP ~ year | country, df)


Note that nlme doesn't specifically know that this is time data. It is just grouped data. It knows that variables with the same score on "year", have something in common; and so do variables with the same value of "country".


You might also have multiple "grouping factors" - for example, if you have data for male and female test subjects, from different cities, tested at different time periods, you could do


> panel.data <- groupedData( dependent.variable ~ time.period | city/sex , data.frame )


Your cases may also have some other things in common. For example, population may vary with time in your observations, but presumably the country's physical area does not. You can tell R that as follows:


> panel.data <- groupedData(GDP ~ year | country, df, outer = ~ area)


I am not yet sure exactly how that information gets used, but it seems important. I am also not yet sure how you specify multiple "outer" variables; or when exactly a variable should be "outer" and when it should be a "grouping factor". (But often the latter is intuitive - countries are groups but country area is not a group.)

Monday, 4 April 2005

Mark Twain quote

"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain