Skip to content

data transformation ----Box-Cox Transformations

3 messages · Stuart, Greg Snow, John Fox

#
Hi

Could any one please help how I can trnasform data based on Box-Cox
Transformations. I have massive data set with many variables. If
possible someone can write few lines so I can read in all data set
once and transform it.


g1	g2	g2
97.03703704	89.25925926	4.444444444
24.90740741	69.25925926	35.55555556
62.22222222	85.18518519	36.85185185
18.51851852	84.25925926	21.66666667
93.7037037	95.92592593	54.07407407
26.66666667	23.33333333	99.25925926
63.33333333	97.03703704	27.40740741
95.74074074	3.611111111	59.25925926
46.66666667	49.44444444	39.16666667
21.85185185	2.592592593	63.14814815
94.72222222	17.77777778	81.11111111


any help will be much appreciated

Cheers
Sbroad
#
There is the bct function in the TeachingDemos package that does Box-Cox transforms (though you could also write your own fairly simply).  The lappy/sapply functions will apply a function to each column of a data frame.
#
Dear Stuart,

See ?bcPower and ?powerTransform in the car package, the latter for
univariate and multivariate conditional and unconditional ML Box-Cox.

I hope this helps,
 John

--------------------------------
John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox