#load the data
data(icu.data)
#the covariate matrix is
X = as.matrix(subset(icu.data, select = -c(open_bin, icu_bed)))
#the treatment
D = icu.data$icu_bed
#the instrument
Z = icu.data$open_bin
#the subclass
subclass = icu.data$site
#can uncomment the following code for examples
#permutation test for complete randomization (for the treatment)
#permTest.absBias(X = X, D = D,
#assignment = "complete", perms = 500)
#permutation test for complete randomization (for the instrument)
#permTest.absBias(X = X, D = D, Z = Z,
#assignment = "complete", perms = 500)
#permutation test for block randomization (for the treatment)
#permTest.absBias(X = X, D = D,
#assignment = "block", subclass = subclass, perms = 500)
#permutation test for block randomization (for the instrument)
#permTest.absBias(X = X, D = D, Z = Z,
#assignment = "block",
#subclass = subclass, perms = 500)
#permutation test for bernoulli trials (for the treatment)
#permTest.absBias(X = X, D = D,
#assignment = "bernoulli", perms = 500)
#permutation test for bernoulli randomization (for the instrument)
#permTest.absBias(X = X, D = D, Z = Z,
#assignment = "bernoulli", perms = 500)
Run the code above in your browser using DataLab