Description Usage Arguments Details Value Author(s) Examples

This function performs different data transformations.

1 2 |

`trait` |
The trait to transform. |

`type` |
The transformation type. See details. |

`base` |
Base for the logarithmic transformation. Base 10 by default. |

`n` |
Additional parameter for arc-sine transformation. See details. |

`dfr` |
The name of the data frame. |

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.

Raul Eyzaguirre.

1 |

reyzaguirre/st4gi documentation built on Oct. 7, 2018, 11:05 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.