Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: How to find the best transformation for each variable in 120 periods

 From Maarten Buis To statalist@hsphsun2.harvard.edu Subject Re: st: How to find the best transformation for each variable in 120 periods Date Fri, 22 Feb 2013 16:03:55 +0100

```To answer that you first need to define what "best" is. This will
crucially depend on how you want to use those variables and it will
involve some sort of trade-off and this trade-off will be such that it
has to be made by humans. So if you are looking for an automatic (or
automagic) solution than we'll have dissappoint you: no such sollution
can exist.

Instead you should just inspect your data, and see if there are some
obvious annomalies, than fit your model of choice, and see if it fits.
If it does not fit, fix it. This "fixing" may or may not require any
transformations. Especially, for the
dependent/explained/left-hand-side/y variable you will want to
transformation.

-- Maarten

On Fri, Feb 22, 2013 at 3:44 PM, Xixi Lin wrote:
> Hi,
>
> I am trying to find the best transformation for each variable in 120
> periods. I know that command ladder gives the following result:
> Transformation          formula         chi2(2)         P(chi2)
> cubic                           Return^3                .               .
> square                   Return^2               .               0.000
> identity                         Return         64.81           0.000
> square root             sqrt(Return)            .               .
> log                              log(Return)            .               .
> 1/(square root)         1/sqrt(Return)          .               .
> inverse                  1/Return               .               .
> 1/square                        1/(Return^2)            .               .
> 1/cubic                 1/(Return^3)            .               .
>         .
>  How can I write a loop to find the best transformation fit for each
> variable in 120 periods if available?
>
> Thanks for any help!
>
> Best,
> Xixi Lin
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

--
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```