Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reverse IHS transformation

    Dear Stata users,

    I am using an IHS transformation for my dependent variables (different measures of wealth) as they are highly skewed, but also contain negative values. I am using the following code to do this:

    *define theta (parameter in inverse hyperbolic sine function)
    global theta=1

    ***IHS transformation
    foreach var in xx xy yy{
    gen `var'_ihs=(log($theta*`var' + sqrt(($theta^2)*(`var'^2) + 1)))/$theta
    }

    I then run multiple imputations using these transformed variables. After the imputation, I would like to 'reverse' the ihs transformation of these variables as I need to generate other variables with these imputed, back transformed variables. I am however not quite sure on how to reverse the ihs transformation in Stata. Can anyone help with this? Or has anyone got any tips on how to do this?

    Thanks,
    Nicole







  • #2
    Hi Nicole,

    Stata has built-in hyperbolic functions. Your starting point should be something similar to:

    Code:
    foreach var in xx xy yy {
    gen asinh_`var' = asinh(`var')
    }
    Then you should be able to reverse it by simply using the function -sinh-.

    Also see the help manual:
    Code:
    help asinh
    help sinh

    Comment


    • #3
      Thanks so much Panos! This is exactly what I needed

      Comment

      Working...
      X