[R] simulation of levene's test

Özgür Asar oasar at metu.edu.tr
Mon May 28 18:14:02 CEST 2012


Dear Dila,

Try the following:

library(Rcmdr)
asim <- 1000
pv<-NULL
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)))
pv<-c(pv,leveneTest(x,group)$"Pr(>F)"[1])
} 

Best
Ozgur

-----
************************************
Ozgur ASAR

Research Assistant
Middle East Technical University
Department of Statistics
06531, Ankara Turkey
Ph: 90-312-2105309
http://www.stat.metu.edu.tr/people/assistants/ozgur/
--
View this message in context: http://r.789695.n4.nabble.com/simulation-of-levene-s-test-tp4631578p4631600.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list