R/CADEbasic.R

Defines functions Productlist Meanlist Difflist

##### basic functions for calculating the CADE

Difflist=function(a,b){
  J=length(a)
  c=a
  for (j in 1:J){
    c[[j]]=a[[j]]-b[[j]]
  }
  return(c)
}

Meanlist=function(a){
  J=length(a)
  s=0
  for(j in 1:J){
    s=s+mean(a[[j]])
  }
  return(s/J)
}

Productlist=function(a,b){
  J=length(a)
  c=a
  for (j in 1:J){
    c[[j]]=a[[j]]*b[[j]]
  }
  return(c)
}

Try the experiment package in your browser

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

experiment documentation built on April 30, 2018, 5:04 p.m.