Posts Tagged ‘method’

Bad Cereal Science

Thursday, January 13th, 2011

I noticed this morning that my cereal box has the following claim on it:
“A study shows that 8 out of 10 who eats Kellogg’s All-Bran at least 3 times a week experience better  digestion*”.

“*Source: Nordic study based on 643 respondents (who eats Kellogg’s All-Bran at least 3 times per week). The Nielsen Company 2007.”

This claim is reiterated on the Norwegian site, but the US site makes no such claims. (googling for “Kellogg’s health claims” might explain why).

Now, when making a health claim one would usually (unless you’re a homeopath, faith healer, acupuncturist, chiropractor, aura cleanser, can shoot rainbows out of your tummy, etc..) back up that claim with good scientific evidence, in other words you can show to a collection of scientifically valid experiments/studies.

This so called study as described above certainly raises a couple of red flags, and I suspect this “study” is of extremely poor quality, or maybe even be just a simple poll (not a scientific study at all).

Of course being a curious fella I sent the following mail to Kellogg’s:

Regarding the study being referred to on the All-Bran packaging and the website (http://www.allbran.no), carried out by The Nielsen company 2007.

  1. How may I obtain a copy of this study?
  2. How did the selection of participants for the study take place?
  3. What’s the distribution of participants between the different nordic countries, age composition and sex composition?
  4. What where the criteria for participant selection?
  5. Which questions where used, and how were the answers quantified?
  6. Of the 643 persons referred to in the study, how big a part of the total participants in the study do these represent?
  7. Is the data collected only based on self reporting of the daily intake of All-Bra, and the self reporting of the perceived increase in digestive function?
  8. Which methods were used to account for the  placebo effect?

I’ll update this post when I get a reply :)

Oups

Monday, March 15th, 2010

While cleaning up in the core classes of Trekwar yesterday (documenting functions, formatting/structuring code, minor improvements) I also saw lots of equals(Object o) methods. And in my infinite wisdom I decided to use generics since it is used pretty extensively throughout the code anyway, so I changed basically all the equals methods.

example:

public boolean equals(Object o) {
        if(o instanceof Structure)
            return equals((Structure)o);
        return false;
    }

was changed to:

public boolean equals(Structure s2) {
        return name.equals(s2.getName());
    }

Now this is not a problem when writing code, as you pretty much always compare objects of the same type. However, the code also uses the Java Collections contains() method a few places, and it always uses the equals(Object) version. So when my classes no longer provided this method, the default one inherited from java.lang.Object was used instead. This caused a strange array of bugs to appear (star systems on the map not shown with faction color/icon except for the Cardassians for some strange reason, users not having any technologies, unable to build any structures, generally erratic behavior, etc..). Luckily I discovered the cause pretty quickly and only wasted about an hour or so on this :)

I guess the lesson is that objects that needs to be compared, directly or indirectly by contains() or other methods, should always define an equals(Object) method that just passes the call along to the equals method written with generics.

public boolean equals(Object o) {
        if(o instanceof Structure) {
            return equals((Structure)o);
        }
        return false;
    }

And perhaps that you should not mess around with your code for hours on end without stopping to test if you broke it once in a while :)