File: bct.R

package info (click to toggle)
r-cran-teachingdemos 2.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,168 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 177 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
"bct" <-
function(y,lambda){

  gm <- exp( mean( log(y) ) )

  if(lambda==0) return( log(y)*gm )
  
  yt <- (y^lambda - 1)/( lambda * gm^(lambda-1) )
  return(yt)
}