R/leveneTest.R

"leveneTest" <-
function(x, memSubjects, alpha = 0.05, ...)
{
  xc<-x[memSubjects==1]
  xn<-x[memSubjects==0]

  vc<-var(xc, na.rm=TRUE)
  vn<-var(xn, na.rm=TRUE)

  res<-levene.test(y=x, group=as.factor(memSubjects),...)

  if(vc > vn)
  {
    res2<-c(res$p.value, res$statistic)
  } else {
    res2<-c(res$p.value, -res$statistic)
  }
  names(res2)<-c("p.value", "statistic")
  return(res2)
}

Try the MMDvariance package in your browser

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

MMDvariance documentation built on May 1, 2019, 10:01 p.m.