FAQ/randall - CBU statistics Wiki

Revision 3 as of 2013-12-10 10:22:25

Clear message
location: FAQ / randall

Algorithms for matching and allocating randomly to groups during clinical trials

Matching Algorithms

It is often advantageous to match controls to cases prior to statistical analysis (e.g. matching controls to patients coming in for hospital admissions) to remove confounding effects. Bland and Altman (1994) mention that only individual matching should be regarded as yielding a matched study.

Exact matching, however, may not always be possible and a more pragmatic approach incorporated into the R Package Matching (http://sekhon.berkeley.edu/matching) uses a distance measure to match controls to cases with the smallest distance between them.

The algorithm GenMatch produces optimal matches which can be tested using paired t-tests ansd McNemar tests. An example below generates simulated data representing age and gender and matches the cases with the controls based upon these values.

install.packages(c("Matching"))
library(Matching)
Y <- rnorm(1:100)
X <- matrix(NA,100,2)
lds <- matrix(NA,100,1)
notlds <- matrix(NA,100,1)
x <- c(0,1)
gp <- rep(x,each=50)
X[,1] <- rep(x,each=2)
X[,2] <- round(rnorm(100,50,3))
mat <- GenMatch(Tr=gp,X=X) # 1-1 matching with replacement
mat <- GenMatch(Tr=gp,X=X,replace=F) #with no replacement matching gp on X
age <- X[,2]
gen <- X[,1]

id1 <- mat$matches[,1]
id2 <- mat$matches[,2]

row <- c(1:100)
for (k in 1:50) {
lds[k] <- age[id1[k]]
notlds[k] <- age[id2[k]]
}

t.test(lds,notlds, paired=TRUE) # stats sig! need a lot of non-lds compared to lds ; the last few matches have higher ages since fewer matches to choose from!

row <- c(1:100)
for (k in 1:50) {
lds[k] <- gen[id1[k]]
notlds[k] <- gen[id2[k]]
}

lds <- as.factor(lds)
notlds <- as.factor(notlds)

mcnemar.test(lds,notlds) # also stats.sig! (gender differences)

 __Minimisation__

When the groups are determined by the researcher e.g. treatment/placebo in a clinical trial a randomized allocation procedure may be used for group allocation. A popular technique is minimization which attempts to allocate people to groups to best balance confounding group variables (stratifiers) such as age or gender. Minimisation computes an imbalance score within each factor should the patient be allocated to a particular treatment group. The various imbalances are added together to give the overall imbalance in the study. The treatment group that would minimise the imbalance can be chosen directly, or a random element may be added (perhaps allocating a higher chance to the groups that will minimise the imbalance, or perhaps only allocating a chance to groups that will minimise the imbalance). The technique allocates to each group as each new individual ebters the clinical trial.

QMinimP (Saghaei and Saghei 2011) is available both on-line or as free downloadable software. Minim is also free downloadable software available for use on MS DOS (See [[http://www-users.york.ac.uk/~mb55/guide/minim.htm | here]]).

References

Bland JM and Altham DG (1994) Statistics notes: Matching. BMJ 309 1128.

Saghaei, M & Saghaei, S (2011) Implementation of an open-source customizable minimization program for allocation of patients to parallel groups in clinical trials (2011) J. Biomedical Science and Engineering 4 734-739.