# Simple ANOVA model with 3 groups (N=20 per group) (artifical data)
set.seed(1234)
Y <- cbind(c(rnorm(20,0,1), rnorm(20,0.5,1), rnorm(20,1,1)))
grp <- c(rep("1", 20), rep("2", 20), rep("3", 20))
Data <- data.frame(Y, grp)
#create model matrix
fit.lm <- lm(Y ~ grp, data = Data)
mfit <- fit.lm$model
mm <- model.matrix(mfit)
Y <- model.response(mfit)
X <- data.frame(mm[,2:3])
names(X) <- c("d1", "d2")
Data.new <- data.frame(Y, X)
# model
model <- 'Y ~ 1 + a1*d1 + a2*d2'
# constraints syntax: mu1 < mu2 < mu3
constraints <- ' a1 > 0
a1 < a2 '
# we only generate 10 bootstrap samples in this example; in practice
# you may wish to use a much higher number, say > 10.000. The double bootstrap
# is not necessary in case of an univariate ANOVA model.
example <- InformativeTesting(model = model, data = Data.new,
R = 10L, double.bootstrap = "no",
constraints = constraints)
example
# plot(example)
Run the code above in your browser using DataLab