Friday, October 07, 2011

Stratified Randomisation 2: The Working Version

Yesterday I posted a basic proof-of-concept class for generating a randomisation schedule based on strata. Unfortunately, this code was flawed and was incorrect in its results: because it uses block randomisation within each stratum, the most a single stratum could differ by is the size of the block used minus 1. The following updated code is now completely self-contained, having no dependencies on the original article's code, and uses a generator to produce the schedule.

Thursday, October 06, 2011

Stratified Randomisation

The next randomisation protocol to be implemented is used to ensure treatment balance across 'strata', participant characteristics that are relevant for the trial study.

Wednesday, October 05, 2011

Balancing Randomness

As part of a project, I'm required to implement various protocols for randomisation of statistical trials. The most basic of these we call "simple": it's the equivalent of flipping a coin every item. This is generally enough for most purposes, although even with a perfectly weighted coin there is still the possibility of a variance between the number of heads and the number of tails. For a clinical trial, for statistical purposes it can be preferred that both heads and tails - in this case, experimental treatments, placebos and/or controls - end up flipping the same number of times, while still requiring each individual result to be completely random.

Tuesday, August 16, 2011

Python: null values, no values and ellipses

One issue I've found that occasionally crops up in dynamic languages like Python & PHP is the overloaded use of the None/NULL value.