data(cholesterol)
# adjusted p-values for all-pairwise comparisons in a one-way layout
# tests for restricted combinations
simtest(response ~ trt, data=cholesterol, type="Tukey",
ttype="logical")
# adjusted p-values all-pairwise comparisons in a one-way layout
# (tests for free combinations -> p-values will be larger)
simtest(response ~ trt, data=cholesterol, type="Tukey",
ttype="free")
# enter now the estimates as parameters
# begin with degrees of freedom
nu <- as.integer(45)
# estimates
parm <- c(10.6151, -4.8331, -1.3901, 1.7597, 4.7461, 10.3325)
# build the covariance matrix
N <- rep(2, 5)
contrast <- contrMat(N, type="Tukey")
covm <- rep(-0.20254649, 36)
covm <- matrix(covm, ncol=6)
covm[1,2:6] <- rep(0.02893521, 5)
covm[2:6,1] <- rep(0.02893521, 5)
covm[1,1] <- 0.14467606
for (i in 2:6) { covm[i,i] <- 0.83912115 }
# use the work-horse directly (and add zero column for the intercept)
csimint(estpar=parm, df=nu, covm=covm, cmatrix=cbind(0, contrast))
csimtest(estpar=parm, df=nu, covm=covm, cmatrix=cbind(0, contrast),
ttype="logical")
Run the code above in your browser using DataLab