# NOT RUN {
##1.example: null case
##simulate a normal data with mean 0 and variance 1:
X <-matrix(rnorm(500,mean=0,sd=1),20,25)
## Generate adjacency matrix:
dmat<-dist(X)
W <-exp(-as.matrix(dmat)^2/(2*quantile(dmat,.5)^2))
## test of structure:
h0.test<-LP.struct.test(W, m = 4 , n.iter = 50)
###extract p-value:
h0.test$pval
##2.example: two sample location alternative
##simulate a two sample locational difference normal data:
X1<-matrix(rnorm(250,mean=0,sd=1),10,25)
X2<-matrix(rnorm(250,mean=0.5,sd=1),10,25)
X<-rbind(X1,X2)
## Generate adjacency matrix:
dmat<-dist(X)
W <-exp(-as.matrix(dmat)^2/(2*quantile(dmat,.5)^2))
## test of structure:
h1.test<-LP.struct.test(W, m = 4 , n.iter = 50)
###extract p-value:
h1.test$pval
# }
Run the code above in your browser using DataLab