# EXAMPLE#1 Simple Simulation & ordering inference

In the first step, we generate a simple dataset. where C1 and C2 are dominated by C3, C3 is dominated by C4, and is C4 dominated by C5. There is no dominant-distribution relation between C1 and C2.

```# Simulation section
nInv<-100
initMean=10
stepMean=20
std=8
simData1<-c()
simData1\$Values<-rnorm(nInv,mean=initMean,sd=std)
simData1\$Group<-rep(c("C1"),times=nInv)
simData1\$Values<-c(simData1\$Values,rnorm(nInv,mean=initMean,sd=std) )
simData1\$Group<-c(simData1\$Group,rep(c("C2"),times=nInv))
simData1\$Values<-c(simData1\$Values,rnorm(nInv,mean=initMean+2*stepMean,sd=std) )
simData1\$Group<-c(simData1\$Group,rep(c("C3"),times=nInv) )
simData1\$Values<-c(simData1\$Values,rnorm(nInv,mean=initMean+3*stepMean,sd=std) )
simData1\$Group<-c(simData1\$Group, rep(c("C4"),times=nInv) )
simData1\$Values<-c(simData1\$Values,rnorm(nInv,mean=initMean+4*stepMean,sd=std) )
simData1\$Group<-c(simData1\$Group, rep(c("C5"),times=nInv) )
```

The framework is used to analyze the data below.

```# Simple ordering inference section
library(EDOIF)
# parameter setting
bootT=1000 # Number of times of sampling with replacement
alpha=0.05 # significance  significance level

#======= input
Values=simData1\$Values
Group=simData1\$Group
#=============
A1<-EDOIF(Values,Group,bootT = bootT, alpha=alpha )
```

We print the result of our framework below.

```print(A1) # print results in text
```

The first plot is the plot of mean-difference confidence intervals

```plot(A1,options =1)
```

The second plot is the plot of mean confidence intervals

```plot(A1,options =2)
```

The third plot is a dominant-distribution network.

```out<-plot(A1,options =3)
```

# EXAMPLE#2 Non-normal-Distribution Simulation & ordering inference

We generate more complicated dataset of mixture distributions. C1, C2, C3, and C4 are dominated by C5. There is no dominant-distribution relation among C1, C2, C3, and C4.

```library(EDOIF)
# parameter setting
bootT=1000
alpha=0.05
nInv<-1200

start_time <- Sys.time()
#======= input
simData3<-SimNonNormalDist(nInv=nInv,noisePer=0.01)
Values=simData3\$Values
Group=simData3\$Group
#=============
A3<-EDOIF(Values,Group, bootT=bootT, alpha=alpha, methodType ="perc")
A3
plot(A3)
end_time <- Sys.time()
end_time - start_time
```

# Uniform noise

Generating \$A\$ dominates \$B\$ with different degrees of uniform noise

```library(ggplot2)

nInv<-1000
simData3<-SimNonNormalDist(nInv=nInv,noisePer=0.01)
#plot(density(simData3\$V3))

dat <- data.frame(dens = c(simData3\$V3, simData3\$V5)
, lines = rep(c("B", "A"), each = nInv))
#Plot.
p1<-ggplot(dat, aes(x = dens, fill = lines)) + geom_density(alpha = 0.5) +xlim(-400, 400)+ ylim(0, 0.07) + ylab("Density [0,1]") +xlab("Values") + theme( axis.text.x = element_text(face="bold",
size=12) )
theme_update(text = element_text(face="bold", size=12)  )
p1\$labels\$fill<-"Categories"
plot(p1)
```

## Try the EDOIF package in your browser

Any scripts or data that you put into this service are public.

EDOIF documentation built on March 28, 2021, 9:11 a.m.