# Monthly Archives: November 2009

## My implementation of Berry and Berry’s hierarchical Bayes algorithm for adverse events

November 20, 2009
By

I've been working on this for quite some time (see here for a little background), so I'm pleased that it looks close to done at least as far as the core algorithm. It uses global variables for now, and I'm sure there are a couple of other bugs lurking, but here it is, after the jump.const.sqrt2pi

## Mapping Biomes

November 20, 2009
By

Recently (2008) the European Space Agency produced GlobCover (ESA GlobCover Project, led by MEDIAS-France), the highest resolution (300m) global land cover map to date. GlobCover uses 21 primary land cover classes and many more sub-classes. Land cover classification (LCC) schemes divide the earth into biomes. Biomes are the simplest way to classify vegetation which can

## Working on a drug safety project

November 20, 2009
By

In order to move some of my personal interests along, I have been trying to implement the methodology found in Berry and Berry's article Accounting for Multiplicities in Assessing Drug Safety. This methodology uses the MedDRA hierarchy to improve the p...

## Tactical asset allocation using blotter

November 18, 2009
By

blotter is an R package that tracks the P&L of your trading systems (or simulations), even if your portfolio spans many security types and/or currencies. This post uses blotter to track a simple two-ETF trading system. The contents of this post b...

## Design of Experiments – Power Calculations

November 18, 2009
By

Prior to conducting an experiment researchers will often undertake power calculations to determine the sample size required in their work to detect a meaningful scientific effect with sufficient power. In R there are functions to calculate either a minimum sample size for a specific power for a test or the power of a test for

## Confidence we seek…

November 18, 2009
By
$Confidence we seek…$

Estimating a proportion at first looks elementary. Hail to aymptotics, right? Well, initially it might seem efficient to iuse the fact that . In other words the classical confidence interval relies on the inversion of Wald’s test. A function to ease the computation is the following (not really needed!). waldci

## Quantitative link strength for APE cophyloplot

November 17, 2009
By

Just add a third column with link strength to the association matrix plotCophylo2

## swfDevice is nearing completion

November 17, 2009
By

My new R package, swfDevice, is getting close to its first release. This package enables native R graphics output as swf (flash) files. It also as the ability to create animations with player controls. The main project page is here and the results of the test suite are here. Here are some samples: http://swfdevice.r-forge.r-project.org/swfDevice_test29.swf http://swfdevice.r-forge.r-project.org/swfDevice_test28.swf

## R tip: Extracting median from survfit object

November 17, 2009
By

A colleague wanted to extract the median value from a survival analysis object, which turned out to be a pain as the value is not stored in the object, but calculated on the fly by a print method. __ library(survival)__ fit __ survfit(fit)Call: survfit(formula = fit)records n.max n.start events median 0.95LCL 0.95UCL ...

## R functions for Dienes (2008) Understanding Psychology as a Science

November 17, 2009
By

I recently wrote a review of Understanding psychology as a science: an introduction to scientific and statistical inference by Zoltan Dienes (2008). Dienes' book covers Neyman-Pearson null hypothesis significance testing, Bayesian inference and the lik...