hello, I try to run simulation of levene's test to find the p-value but the error of replacement has length zero occur, could anyone help me to fix this problem?
asim <- 1000 pv<-rep(NA,asim) for(i in 1:asim) {print(i) set.seed(i) g1 <- rnorm(20,0,2) g2 <- rnorm(20,0,2) g3 <- rnorm(20,0,2) x <- c(g1,g2,g3) group<-as.factor(c(rep(1,20),rep(2,20),rep(3,20))) library(Rcmdr) pv[i]<-leveneTest(x,group)$p.value } -- View this message in context: http://r.789695.n4.nabble.com/simulation-of-levene-s-test-tp4631578.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.