File: boxCoxVariable.R

package info (click to toggle)
car 3.1-3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,520 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
#-------------------------------------------------------------------------------
# Revision history:
# 2009-09-29 by J. Fox (renamed)
#-------------------------------------------------------------------------------

# constructed variable for Box-Cox transformation (J. Fox)

boxCoxVariable <- function(y) {
	geo.mean <- exp(mean(log(y), na.rm=TRUE))
	y*(log(y/geo.mean) - 1)
}