Skip to content

SUMM/ENH: nonlinear transformation to normality - utility functions #3224

Open

Description

@josef-pkt

#3220 We use transformation in several places to make the data or statistics closer to normally distributed.

However, we don't have a central collection of recipes or helper functions.

We have the delta method for inference based on normal distribution. It's used in a "hardcoded" way in some of the hypothesis tests and related, e.g. for proportions and correlation coefficients.
We also have it for nonlinear prediction and for nonlinear transformation of parameters, e.g. eform in Logit and Poisson.
For transforming data we have Box-Cox and related transformation.

missing reference: quite a while ago I saw a reference that mentioned general variance stabilizing transformtion, maybe by integrating the variance function. I don't remember, and it was just in the context of discussing an implementation detail in a PR (?).

case right now: I'd like to use something like Fisher z-transform for spearman rho and kendalls tau to calculate confidence intervals (but I'm not sure I remember correctly, and don't have a helper function handy.)

aside for confidence intervals:
It looks like we go in different directions, transformation to normality or transformation from normality.
from normality: In the eform (exp(params)) case we assume params has a pretty close to normal distribution, and we we are interested in the non-normal transformed variable.
to normality: When using Fisher's z-transform we are interested in the original statistic, but we do the transformation to have a better approximation by the normal distribution.
End point transformation for confidence intervals needs to go in the right direction, i.e. we cannot directly reuse the eform transformation code.

example proportion
AFAICS: we don't use any transformation in statsmodels.stats.proportion
http://support.sas.com/documentation/cdl/en/imlsug/62558/HTML/default/viewer.htm#ugvartransform_sect6.htm lists a few available transformations.
We have some of them in the context of GLM and the discrete models. but not for pure stats, AFAIR.
related parameterized transforms or link functions for binomial proportion
http://stats.stackexchange.com/questions/10975/transforming-proportion-data-when-arcsin-square-root-is-not-enough

(barely related aside: Can we do a GLM like model with a Fisher z-transform link function to estimate a regression model for correlations? in analogy to logit for proportions. I guess that should be better than least squares, i.e. minimize MSE. Gaussian MLE has proper objective but full parametric assumption. ???)

Activity

  1. josef-pkt commented on Feb 18, 2019

    @josef-pkt
    MemberAuthor

    bump: helper functions would avoid having to remember the details

    e.g.
    How do we get normal scores using ppf (I don't remember right now)
    Many control charts for binomial proportion and poisson rates or weibull random variable are also based on transformation to normality.

  2. josef-pkt commented on Jan 3, 2021

    @josef-pkt
    MemberAuthor

    R package for some transformation to normality, mostly on real line R or R+

    Medina, Lily, Ann-Kristin Kreutzmann, Natalia Rojas-Perilla, and Piedad Castro. 2019. “The R Package Trafo for Transforming Linear Regression Models.” The R Journal 11 (2): 99. https://doi.org/10.32614/RJ-2019-054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions