Well travelled or just plain old?

A friend of mine has always said that young cars with high mileage are better than old cars with low mileage. The theory being that company cars, which have spent their time cruising on the motorways, have had a much easier life than their stay-at-home cousins who’ve done short hops around town and sat on their driveways seizing up.

So I pointed some very simple Spark queries at the UK government’s open MOT data to see what I could find (you can read about the last time I did this here). First factoid to note is that both mileage and age are relevant when it comes to predicting pass rates. The following two charts show pass rate vs mileage and age.

Pass Rate vs Mileage

Pass Rate vs Age

To look at all three variables together I created the following chart which shows shows age on on the x axis and mileage on the y. Pass rate is a colour scale with red being the worst and green the best. Green squares show combinations of mileage and age at which vehicles are more likely to pass their MOT on the first attempt. Red squares show combinations where a first-try failure is likely.

Pass Rate vs Mileage and Age

There is some truth to my mate’s theory – at least if this chart is to be believed – the pass rate for 3-5 year old cars looks pretty good even at very high mileages. Looking horizontally for very-low-mileage cars of increasing age there seems to be something quite odd going on for vehicles on less than 20k miles. For the 20k-40k range there does seem to be a green stripe across the ages, but it is not as apparent as it’s vertical counterpart.

So should we all be buying a four-year-old car with 180k miles on the clock? Well, no. At least not if we want to keep it for more than a year or two. Cars with high mileages on the clock go into the red much earlier than those with low mileage (based on the fact that vehicles can only move right and up through the chart as they get older and drive further).

Pass Rate vs Mileage and Age… to the MAX

That last chart shows the same heat-matrix view, but to the full extents of the data. There are some interesting facts hidden in that chart… but I’ll leave them as an exercise for the reader!144

UPDATE: Proper Stats:

So it turns out that calculating correlation and covariance with Spark is pretty easy. Here’s the results and the code:

For cars < 20 years and < 250,000 miles
cov(testMileage, pass) = -3615.011
corr(testMileage, pass) = -0.195
cov(age, pass) = -0.401
corr(age, pass) = -0.235
For all data
cov(testMileage, pass) = -3680.0456
corr(testMileage, pass) = -0.177
cov(age, pass) = -0.383
corr(age, pass) = -0.152

Looking at cars in the “normal” range (i.e. less than 20 years old and less than 250k miles) there’s a stronger correlation between age and pass rate than between mileage and pass rate. Interestingly, looking over the full range of the data this relationship is inverted, with mileage being very slightly better.  There’s little to separate the two as a predictor for pass or fail – not least because age and mileage are largely dependant on each other (with a correlation of 0.277 across all data).

Basic statistical functions are available under DataFrame.stat. See the calls hidden in the println lines below:

  it should "calculate covariance and correlation for normal cars" in {
    val motTests = Spark.sqlContext.read.parquet(parquetData).toDF()

    val df = motTests
      .filter("testClass like '4%'") // Cars, not buses, bikes etc
      .filter("testType = 'N'") // only interested in the first test
      .filter("age &amp;lt;= 20")
      .filter("testMileage &amp;lt;= 250000")
      .withColumn("pass", passCodeToInt(col("testResult")))

    println("For cars &amp;lt; 20 years and &amp;lt; 250,000 miles")
    println(s"cov(testMileage, pass) = ${df.stat.cov("testMileage", "pass")}")
    println(s"corr(testMileage, pass) = ${df.stat.corr("testMileage", "pass")}")

    println(s"cov(age, pass) = ${df.stat.cov("age", "pass")}")
    println(s"corr(age, pass) = ${df.stat.corr("age", "pass")}")

MOT done, brakes done in!

On the way back from the passed MOT this evening I pressed down on the brake in a traffic jam and there was a cracking/popping sound from the rear offside area and the pedal went a bit spongy.  I guess the pipe must have been a bit stressed by all the work going on on the wheel hub over the weekend…

Speaking of the wheel hub, before the brakes broke, the garage rang me up at work to tell me the wheel was still wobbly.  Seems I hadn’t tightened the big nuts up against the wheel bearings hard enough so the drive out to the garage had loosened them.  He tightened them up again for me for the princely sum of £15, bringing the total MOT cost up to almost a ton this year.  Worse than that was the blow to my ego.  How can I show my face in public again?

So I have an MOT, my pride is slightly dented and I need to make a new brake pipe and bleed the sodding things again!

Wheel Bearing Wreckage

The Duke failed his first MOT of the year this Monday.  The news wasn’t massively bad – just some play in the rear offside wheel bearing.  So I ordered the parts and took the day off to sort it out today.

The wheel had a really good wobble going on.  To be honest, it’s a miracle it hadn’t fallen off!  On the morning of the epic journey to my stag do last year, Dr J noticed that the hub on this wheel was loose – or at least the bolts weren’t fully tightened.  While performing a roadside repair I snapped one of the bolts half way down.  Then we went away for the weekend and drank until the memory of the event was totally expunged.

So I shouldn’t really be shocked to find that the inner bearing was absolutely, totally and completely destroyed.  The whole area was filled with a muddy greasy gunk and the rollers in the bearing had dropped out of the cage so I had to use tin snips to get it all free.

Thanks to Lorna’s Dad I had all the tools I needed to get the snapped bolt out (really should give those stud extractors back soon…)!

Getting it all back together again was very simple.  I got a kit from Britpart because we are living in difficult times financially and it would not be right to spend my hard earned cash on genuine parts when I need it for beer.  Hopefully I can get a new MOT booked in for next week and get The Duke back on the road!

Got my shoes on wrong…

Lorna came outside to help me bleed the brakes again tonight. A few more bubbles came out and I think we managed to improve things. However, the pedal still goes down to the floor on the first push. On the second pump the pedal seems firm and goes down about half way. A bit of a plus point, but it has to be said that a two-pump operating schedule is probably not ideal for your average fifty-miles-per-hour-towards-children-or-cliff situation.

So clearly something is wrong. But what? My adjusters are wound in tightly and there are no leaks. After much searching on the Internet I found a possible explanation

By the looks of this photo I took the other day after refurbing the brakes, I have placed the leading pad on the back and the trailing pad on the front. Wrong way round. Apparently a slight difference in the shape of the two pads means the cylinders need to move further to actuate the brakes – thus the excessive brake travel on the first pump.

So, next job is to strip the back brakes down and swap things back to the way they should be. Fingers crossed this sorts things out!

After a little digging through the millions of photos in my “Duke” directory, I found a photo which shows that the pads on the other side are the right way round. Less work to do but possibly proof that this isn’t the only cause of the problem. Watch this space!

Welding Whiteout

Snow? What snow? Oh… that massive foot-deep layer of snow covering the whole of Reading. Thanks to the bottomless positivity supplies of Doctor Johnson, the snow and negative temperatures did not stop further progress on The Duke.

Johnson with a chopped off outrigger.

The job in hand was the replacement of the two fuel tank outriggers. We managed to chop both of the old ones off and welded the passenger side back on. At 4pm the lengthening of the shadows and the call of the beer finally lured us back into the warmth.

Here’s the hole that failed the MOT. Doesn’t seem much does it? Not that I’m bitter…

With only one grinder available, I ended up doing more digging than ‘drovering!

Johnson welds on the replacement outrigger.

Pretty lights!

Jason popped round and helped out by undersealing the fuel tanks. They now look smart and will hopefully be protected from the elements for a good few years.

Here’s the new left hand outrigger welded on and undersealed. Looks smart huh?

Still a fair bit to do – the front dumbiron still has a big hole in it and the right hand outrigger needs welding back on. After that I need to fix the driver’s door lock which came back from the garage with a loose (and useless) handle.

Fuel tank seals are sorted and a completely new set of brakes are fitted but need a bit more bleeding to firm them up.

I’ve also ordered a set of new front springs after the good Doctor Johnson managed to snap the bracket when attempting to split them. In a way I’m quite pleased to have an excuse to get new ones. The work involved in a refurb would be far from minor and I’d much rather go for a quick fix and get the MOT done ASAP!