Page 1 of 1

How do I do a Box-Cox Transformation?

Posted: Mon Aug 19, 2013 3:29 am
by JohnYork
I am using E-Views 7.

I wish to compare the results for Linear and Non-Linear Equations (the latter having different dependent variables due to the use of logs).

I've been told I need to do a 'Box-Cox' transformation of my data but can only find one reference to Box-Cox transformations in the User Manual (in Data Graphing).

How then do I apply a Box-Cox transformation to my data in E-Views so that I can get comparable r-squareds etc.

Thanks
John

Re: How do I do a Box-Cox Transformation?

Posted: Mon Aug 19, 2013 7:37 am
by EViews Gareth

Code: Select all

series y_boxcox = (y^a-1)/a
Where Y is the series you're transforming, and a is the Box-Cox parameter.

Re: How do I do a Box-Cox Transformation?

Posted: Mon Aug 19, 2013 9:59 am
by EViews Glenn
...and of course

Code: Select all

series y=log(y)
if a=0 (Gareth only handles the difficult cases :))

If you are not sure whether a is zero at the onset of the command and don't want to have to test and then switch between the two formulations, you could use @recode.

Code: Select all

series y_boxcox=@recode(a=0, log(y), (y^a-1)/a)

Re: How do I do a Box-Cox Transformation?

Posted: Sun Jul 09, 2017 8:14 am
by CherifEViews
Hello,
It's possible to estimate the best value of lamda Box-Cox transformation with "use Spitzer(1982) algorithm diriving from L(lamda)".
First, compute the geometric mean of Y(t), with Y(t)<>0.

Code: Select all

series gm=@gmean(Y)
Second, scale Yt by its geometric mean:

Code: Select all

series z=y/gm
third, the “trick” simplifies L(λ) considerably. Ignoring constant terms, L(lamda)...
my question is: How can estimate the best lamda value with Spitzer(1982) algorithm or via simple program, honestly i have a difficulty to interpret the third step by LogL.
Could someone help me.
Best Cherif.