Box-Cox function help find best transformation to normalise variable

  • Box-Cox transformation will do series of test to find the best transformation method to normalise your variable

    • This is useful when you’re working on a more complex variable and the suitable method for normalising the variable isn’t visually clear. See transformation can make relationship linear Private or Broken Links
      The page you're looking for is either not available or private!
    • As this is iterative in nature, I don’t think it’s possible to do manually like other transformation. Snippet below is R code to run the transformation
        boxcox(object,    # lm or aov objects or formulas
               lambda = seq(-2, 2, 1/10), # Vector of values of lambda
               plotit = TRUE,  # Create a plot or not
               interp,         # Logical. Controls if spline interpolation is used
               eps = 1/50,     # Tolerance for lambda. Defaults to 0.02.
               xlab = expression(lambda), # X-axis title
               ylab = "log-Likelihood",   # Y-axis title
               ) # Additional arguments for model fitting
      		
        # install.packages(MASS)
        library(MASS)
        # x is an array or single variable/column from a dataframe
        boxcox(lm(x ~ 1))
      

References

Metadata

  • topic:: 00 Statistics00 Statistics
    #MOC / Hub for notes related to general statistical knowledge
  • updated:: 2022-10-10 Private or Broken Links
    The page you're looking for is either not available or private!
  • reviewed:: 2022-10-10 Private or Broken Links
    The page you're looking for is either not available or private!
  • #PermanentNote