Description Usage Arguments Details Value Author(s) References
Calculates logarithmic response ratio from a long table where each row represents one measurement.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
X |
data frame |
response |
character vector specifying the names of the columns for which the response ratio should be calculated. |
levels |
Name of the column that contains factor which should be used to separate response ratios. |
groups |
character vector specifying the names of the columns, which should used as grouping factors. |
control |
the name of the control/base factor level in |
ci.type |
indicates the distribution to be used for confidence intervals. |
ci.conf |
the confidence level for the confidence interval. Defaults to 0.95 (95%). |
base |
either "e" (default), 2 or 10 defining the base for the log response ratio. While "e" (i.e. |
paired_tests |
Logical indicating whether wilcox.test should be used to "confirm" the results indicated by the confidence intervals for the response ratios. |
unlog |
logical indicating whether the output should be unlogged. Defaults to |
all.data |
logical indicating whether all data used in calculations should be returned instead of a concise table of relevant results. Defaults to |
signif |
number of significant digits in output. Defaults to 2. If |
sqrt_transform |
Logical indicating whether values should be square root transformed prior calculation of means. This option makes the distributions more normally distributed, but might change the outcome. Highly experimental. DO NOT USE in publications. |
The calculations are based on Hedges et al. (1999), with the exception that t-distribution is used to acquire confidence intervals instead of normal distribution. The difference is minimal for sample sizes > 20, but the confidence intervals will be a lot more conservative for small sample sizes leading to fewer false positives. Use ci.type = "z"
to use normal distribution for CI estimation as described in the original source.
Note that the function does not currently calculate dependent sample response ratios, as the pooled variance needs to be penalized by the correlation term for such analyses. See Lajeunesse (2011) and CrossValidated for further information.
The square root transformation routine is experimental and little tested, but seems to produce slightly less nonconforming test results against wilcox.test for non-normal data.
It is recommended to plot your raw values to confirm any results given by this function.
Returns a list where $data
element contains the calculated response ratios for each response
in a separate list named by the response's column name. $info
contains information how the response ratios were calculated and, if paired_tests = TRUE
, the $tests
element gives wilcox.test results to "confirm" significance of the confidence intervals for the response ratios. Nonconforming tests are listed under $nonconforming
.
Mikko Vihtakari
Hedges, L. V, Gurevitch, J., & Curtis, P.S. (1999) The meta-analysis of response ratios in experimental ecology. Ecology, 80, 1150–1156.
Lajeunesse, M. J. (2011). On the meta-analysis of response ratios for studies with correlated and multi-group designs. Ecology, 92, 2049-2055.
Greenacre, M., (2016). Data reporting and visualization in ecology. Polar Biology 39, 2189–2205. doi:10.1007/s00300-016-2047-2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.