library(BSagri)
coefs=c("TratamentoA"=-1.0618,"TratamentoB"=1.1470,"TratamentoC"=0.3068,"TratamentoC"=0.2501)
VarCov=matrix(data = NA, nrow = 4, ncol = 4, byrow = FALSE,dimnames=NULL)
VarCov[1,]=c(0.3133311,-0.1618691,-0.1736806,-0.1712345)
VarCov[2,]=c(-0.1618697,0.4510964,0.1595845,0.1622442)
VarCov[3,]=c(-0.1736809,0.1595843,0.2729564,0.1617069)
VarCov[4,]=c(-0.1712371,0.1622446,0.1617080,0.2757233)
VarCov
n=c("TratamentoA"=40,"TratamentoB"=20,"TratamentoC"=60,"TratamentoD"=60)
cmat1<-contrMat(n=n, type="Dunnett")
cmat1
test1<-simplesimint(coef=coefs, vcov=VarCov, df=NULL, cmat=cmat1, alternative="two.sided")
plotCI(test1)
cmat2<-contrMat(n=n, type="Tukey")
cmat2
test2<-simplesimint(coef=coefs, vcov=VarCov, df=NULL, cmat=cmat2, alternative="two.sided")
##ERRO!!
#Erro em uniroot(pfct, interval = interval) :
# f() values at end points not of opposite sign