data(plantdist)
round(plantdist)
plantsfm <- fullmatch(plantdist) # A full match with unrestricted
# treatment-control balance
PR <- logical(26)
PR[match(dimnames(plantdist)[[1]], names(plantsfm))] <- TRUE
table(plantsfm, # treatment-control balance,
ifelse(PR,'treated', 'control')) # by matched set
stratumStructure(plantsfm) # summary of sets' trt-ctl balance
sum(plantdist* # sum of matched distances
outer(plantsfm[PR], plantsfm[!PR],
"==") )
plantsfm1 <- fullmatch(plantdist, # A full match with
min.controls=2, max.controls=3) # restrictions on matched sets'
# treatment-control balance
stratumStructure(plantsfm1) # treatment-control balance is
# improved by restrictionsRun the code above in your browser using DataLab