This function performs different data transformations.
The trait to transform.
The transformation type. See details.
Base for the logarithmic transformation. Base 10 by default.
Additional parameter for arc-sine transformation. See details.
The name of the data frame containing the data.
Available transformations are:
none for no transformation.
logy for the logarithmic transformation log(y). This transformation is
recommended for data that follow a multiplicative instead of an additive model.
logy1 for the logarithmic transformation log(y + 1). The same as the
previous case, but when the data set includes small values (e.g. less than 10).
sqrty for the square root transformation sqrt(y). This transformation is
recommended for count data, which typically follow a Poisson distribution where
the variance is proportional to the mean. It is also recommended for percentage
data where the range is between 0 and 20% or between 80 and 100%. However, note
that for Poisson data a Poisson regression model could be a better option.
sqrty1 for the square root transformation sqrt(y + 0.5). The same as the
previous case but when most of the values in the data set are less than 10,
especially if zeros are present.
arcsin for the arc-sine transformation arcsin(y^0.5). This transformation
is recommended for data on proportions, which typically follow a binomial
distribution. Data must lie between 0 and 1. Where the values of 0 or 1 are present,
these should be substituted by 1/4n and 1-1/4n, where
n is the denominator for
the computation of the proportions. When the proportions are in the range 0.2 to 0.8
no transformation could be needed, and where some are on either the range 0 to 0.2 or
0.8 to 1 a square root transformation could be useful. Finally, Note that for binomial
data, a binomial regression model could be a better option.
It returns the transformed trait.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.