R/esmcp.R

esmcp <-
function(x,tr=.2,nboot=100,SEED=TRUE){
#
#  Compute a heteroscedastic robust measure of effect size
#  based on a robust analog of explanatory power
#
#  A one-way design is assumed
#
#  Can be used with independent or dependent groups.
#  The same effect size reported by yuenv2 is computed.
#
#  OUTPUT: effect size for all pairs of groups
#
if(is.data.frame(x))x=as.matrix(x)
if(SEED)set.seed(2)
if(is.matrix(x))x<-listm(x)
J<-length(x)
JALL=(J^2-J)/2
est=matrix(NA,JALL,3)
dimnames(est)=list(NULL,c("Group","Group","Effect Size"))
ic=0
for(j in 1:J){
for(k in 1:J){
if(j<k){
ic=ic+1
est[ic,1]=j
est[ic,2]=k
est[ic,3]=yuenv2(x[[j]],x[[k]],SEED=SEED,tr=tr,nboot=nboot)$Effect.Size
}}}
list(Estimates=est)
}
musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.