R/sumSqCat.R

# Weighted sum of squares of distance of mean values of each group
# from the background values.
# Hypothesis is fixed by the background mean and groups.
sumSqCat<-function(resp,groups,backMean) {
  
  grMeans<-tapply(resp,groups,mean)-backMean
  grNums<-tapply(resp,groups,length)
  
  sum(grMeans * grMeans * grNums,na.rm=T)
}
  

Try the EffectsRelBaseline package in your browser

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

EffectsRelBaseline documentation built on May 2, 2019, 9:44 a.m.