Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: stats
See also: twboxcox hinesplot boxcoxdens

Quantlet: boxcox
Description: computes the Box-Cox transformation of x

Usage: y = boxcox (x, p)
Input:
x n x q
p scalar
Output:
y n x q transformed data

Example:
; loads the library stats
library("stats")
; loads the library graphic
library("graphic")
; reset random generator
randomize(0)
; generate x(skewed)
x = 0.05+0.9.*uniform(250)
x = qfc(x, 2)
; create a display
t = createdisplay(1,2)
; show a qq-plot of x
xp = grqqn(x)
show(t, 1, 1, xp)
; now transform with boxcox(p=0)
y = boxcox(x, 0)
; show a qq-plot of y
yp = grqqn(y)
show(t, 1, 2, yp)

Result:
shows first a qq plot with the original data. The data are
skewed. The second plot shows a qq-plot with the
transformed data. The data are less skewed now and the
distribution looks more normal.



Author: M. Dranganska, U. Dorazelski, S. Hannappel, S. Klinke, 19970820
(C) MD*TECH Method and Data Technologies, 05.02.2006