R/logshift.R

Defines functions logshift

Documented in logshift

#' Log shift transformation for linear models
#'
#' The function transforms the dependent variable of a linear model using the 
#' Log shift transformation. The shift parameter is determined by y + shift > 0. 
#'
#' @param object an object of type lm. 
#' @return an object of class \code{trafo}.
# #' @examples
# #' # Load data
# #' data("cars", package = "datasets")
# #' 
# #' # Fit linear model
# #' lm_cars <- lm(dist ~ speed, data = cars)
# #' 
# #' # Transform dependent variable 
# #' logshift(object = lm_cars)
#' @keywords internal

logshift <- function(object) {
  
  trafo <- "logshift"
  woparam(object = object, trafo = trafo)
}

Try the trafo package in your browser

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

trafo documentation built on May 2, 2019, 2:13 p.m.