##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
corr=diag(4)
corr12=0.3508
corr[1,2]=corr12
corr[2,1]=corr12
corr13=0.3508
corr[1,3]=corr13
corr[3,1]=corr13
corr14=0.4979
corr[1,4]=corr14
corr[4,1]=corr14
corr23=0.3016
corr[2,3]=corr23
corr[3,2]=corr23
corr24=0.5630
corr[2,4]=corr24
corr[4,2]=corr24
corr34=0.5630
corr[3,4]=corr34
corr[4,3]=corr34
quantile=c(0.4308,0.9804,1.8603)
k=c(-200,quantile)
# -200 is small enough to send the lower bound to be -Inf
alphaofx=pmvnorm(lower=c(-200,quantile),corr=corr)
multistageselection(k=c(-200,quantile),corr=corr,alphaofx,sumdimofxandy=4)
#####
# new code for adapt the window input of the red-R
#####
k=c(-200,0.4308,0.9804,1.8603)
corr=matrix( c(1, 0.3508,0.3508,0.4979,
0.3508 ,1, 0.3016,0.5630,
0.3508, 0.3016,1 ,0.5630,
0.4979, 0.5630,0.5630,1),
nrow=4
)
sumdimofxandy=4
alphaofx=pmvnorm(lower=k,corr=corr)
multistageselection(k=k,corr=corr,alphaofx,sumdimofxandy=4)
Run the code above in your browser using DataLab