Title: | Effect Sizes for Meta-Analysis of Interactions from Factorial Experiments |
Version: | 0.1.0 |
Description: | Compute effect sizes and their sampling variances from factorial experimental designs. The package supports calculation of simple effects, overall effects, and interaction effects for use in factorial meta-analyses. See Gurevitch et al. (2000) <doi:10.1086/303337>, Morris et al. (2007) <doi:10.1890/06-0442>, Lajeunesse (2011) <doi:10.1890/11-0423.1> and Macartney et al. (2022) <doi:10.1016/j.neubiorev.2022.104554>. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
URL: | https://fdecunta.github.io/minter/ |
BugReports: | https://github.com/fdecunta/minter/issues |
Imports: | checkmate |
Depends: | R (≥ 3.5) |
LazyData: | true |
Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2025-09-09 14:35:41 UTC; fdecunta |
Author: | Facundo Decunta |
Maintainer: | Facundo Decunta <fdecunta@agro.uba.ar> |
Repository: | CRAN |
Date/Publication: | 2025-10-06 06:00:02 UTC |
Compute And Format
Description
Compute effect size and do some pre-return tasks
Usage
.compute_and_format(effsize_func, effsize_args, data, col_names, append)
Arguments
effsize_func |
Function used to compute the effect size |
effsize_args |
Arguments needed for that function |
data |
Data frame to use |
col_names |
Vector of length 2 with the name of the columns |
append |
Logical. If append or not the effect sizes to the data |
Interaction effect: Standardized mean difference
Description
Computes the interaction effect between factors A and B in factorial data.
Usage
.interaction_SMD(
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n,
hedges_correction = TRUE
)
Arguments
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
hedges_correction |
Logical. Apply or not Hedges' correction for small-sample bias. Default is TRUE |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
data <- data.frame(
study_id = 1:2,
control_mean = c(24.8, 27.2), control_sd = c(4.1, 4.6), control_n = c(18, 16),
salinity_mean = c(19.3, 21.7), salinity_sd = c(3.8, 4.2), salinity_n = c(17, 18),
temperature_mean = c(28.9, 31.4), temperature_sd = c(4.7, 5.1), temperature_n = c(19, 15),
salt_temp_mean = c(15.2, 17.8), salt_temp_sd = c(3.1, 3.5), salt_temp_n = c(16, 17)
)
result <- SMD_inter(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "salinity_mean", A_sd = "salinity_sd", A_n = "salinity_n",
B_mean = "temperature_mean", B_sd = "temperature_sd", B_n = "temperature_n",
AB_mean = "salt_temp_mean", AB_sd = "salt_temp_sd", AB_n = "salt_temp_n"
)
Correction for small-sample bias
Description
Small-sample bias correction for Hedges' g
Usage
.j_correction(m)
Arguments
m |
Degrees of freedom. They change between individual and main effects. |
Required columns for computing lnVR
Description
'inter' use the same arguments than 'main',
Usage
.lnVR_args
Format
An object of class list
of length 2.
Main effect: Standardized Mean Difference
Description
Computes the main effect of Factor A across levels of Factor B, analogous to the main effect in a factorial ANOVA.
Usage
.main_SMD(
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n,
hedges_correction = TRUE
)
Arguments
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the A treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
hedges_correction |
Boolean. If TRUE correct for small-sample bias. Default is TRUE. |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
# Main effect of Mycorrhiza in 2x2 factorial design (AMF x Phosphorus)
data <- data.frame(
study_id = 1:2,
control_mean = c(12.4, 15.1), control_sd = c(2.8, 3.2), control_n = c(16, 14),
mycorrhizae_mean = c(18.7, 21.3), mycorrhizae_sd = c(3.4, 3.9), mycorrhizae_n = c(15, 16),
phosphorus_mean = c(14.9, 17.8), phosphorus_sd = c(3.1, 3.6), phosphorus_n = c(17, 13),
myco_phos_mean = c(22.1, 25.4), myco_phos_sd = c(4.2, 4.8), myco_phos_n = c(14, 15)
)
result <- SMD_main(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "mycorrhizae_mean", A_sd = "mycorrhizae_sd", A_n = "mycorrhizae_n",
B_mean = "phosphorus_mean", B_sd = "phosphorus_sd", B_n = "phosphorus_n",
AB_mean = "myco_phos_mean", AB_sd = "myco_phos_sd", AB_n = "myco_phos_n"
)
Pooled Standard Deviation for SMD in factorial experiments
Description
Compute the pooled standard deviation for SMD. It computes the pooled SD for 2 or 4 groups depending on the arguments passed. Simple SMD has only 2 groups, while main and interactions had 4 groups.
Usage
.pooled_sd(
Ctrl_sd,
Ctrl_n,
A_sd,
A_n,
B_sd = NULL,
B_n = NULL,
AB_n = NULL,
AB_sd = NULL
)
Arguments
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_n |
Sample size from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
References
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Simple effect: Standardized Mean Difference
Description
Computes the individual or simple effect of Factor A over the Control.
Usage
.simple_SMD(
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
hedges_correction = TRUE
)
Arguments
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the experimental treatment |
A_sd |
Standard deviation from the experimental treatment |
A_n |
Sample size from the experimental treatment |
hedges_correction |
Boolean. If TRUE correct for small-sample bias. Default is TRUE. |
Details
It is the classic Standardized Mean Difference (SMD), which can also be computed
with metafor's escalc()
function using measure = "SMD"
.
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
data <- data.frame(
study_id = 1:3,
control_mean = c(45.2, 52.8, 38.9),
control_sd = c(8.1, 11.2, 7.3),
control_n = c(18, 23, 16),
pollinator_exclusion_mean = c(28.7, 35.4, 22.1),
pollinator_exclusion_sd = c(6.8, 9.1, 5.9),
pollinator_exclusion_n = c(20, 22, 18)
)
# With Hedges' correction (default)
result <- SMD_ind(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "pollinator_exclusion_mean",
A_sd = "pollinator_exclusion_sd",
A_n = "pollinator_exclusion_n",
hedges_correction = TRUE
)
# Without Hedges' correction
result_no_hedges <- SMD_ind(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "pollinator_exclusion_mean",
A_sd = "pollinator_exclusion_sd",
A_n = "pollinator_exclusion_n",
hedges_correction = FALSE
)
Standardized Mean Difference for the interaction between Experimental Treatment and Time
Description
Standardized Mean Difference for the interaction between Experimental Treatment and Time
Usage
.time_interaction_SMD(
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor,
hedges_correction = TRUE
)
Arguments
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Correlation between the means of the experimental group at t0 and t1 |
hedges_correction |
Logical. Apply or not Hedges' correction for small-sample bias. Default is TRUE. |
References
Shinichi Nakagawa and Daniel Noble, personal communication.
Log Coefficient of Variation Ratio: Interaction Between Experimental Treatment and Time
Description
Log Coefficient of Variation Ratio: Interaction Between Experimental Treatment and Time
Usage
.time_interaction_lnCVR(
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Correlation between the means of the experimental group at t0 and t1 |
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Log Response Ratio: Interaction Between Experimental Treatment and Time
Description
Log Response Ratio: Interaction Between Experimental Treatment and Time
Usage
.time_interaction_lnRR(
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Correlation between the means of the experimental group at t0 and t1 |
Log of Variability Ratio: Interaction Between Experimental Treatment and Time
Description
Log of Variability Ratio: Interaction Between Experimental Treatment and Time
Usage
.time_interaction_lnVR(
t0_Ctrl_sd,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_sd,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Correlation between the means of the control group at t0 and t1 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Correlation between the means of the experimental group at t0 and t1 |
Pooled Standard Deviation for SMD in non-independent factorial
Description
Pooled Standard Deviation for SMD in non-independent factorial
Usage
.time_pooled_sd(t0_Ctrl_sd, t1_Ctrl_sd, Ctrl_n, t0_Exp_sd, t1_Exp_sd, Exp_n)
Arguments
t0_Ctrl_sd |
Standard deviation from Control treatment at time 0 |
t1_Ctrl_sd |
Standard deviation from Control treatment at time 1 |
Ctrl_n |
Sample size from Control treatment |
t0_Exp_sd |
Standard deviation from Experimental treatment at time 0 |
t1_Exp_sd |
Standard deviation from Experimental treatment at time 1 |
Exp_n |
Sample size from Experimental treatment |
Simple effect: Standardized Mean Difference
Description
Computes the individual or simple effect of Factor A over the Control.
Usage
SMD_ind(
data,
col_names = c("yi", "vi"),
append = TRUE,
hedges_correction = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
hedges_correction |
Boolean. If TRUE correct for small-sample bias. Default is TRUE. |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the experimental treatment |
A_sd |
Standard deviation from the experimental treatment |
A_n |
Sample size from the experimental treatment |
Details
It is the classic Standardized Mean Difference (SMD), which can also be computed
with metafor's escalc()
function using measure = "SMD"
.
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
data <- data.frame(
study_id = 1:3,
control_mean = c(45.2, 52.8, 38.9),
control_sd = c(8.1, 11.2, 7.3),
control_n = c(18, 23, 16),
pollinator_exclusion_mean = c(28.7, 35.4, 22.1),
pollinator_exclusion_sd = c(6.8, 9.1, 5.9),
pollinator_exclusion_n = c(20, 22, 18)
)
# With Hedges' correction (default)
result <- SMD_ind(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "pollinator_exclusion_mean",
A_sd = "pollinator_exclusion_sd",
A_n = "pollinator_exclusion_n",
hedges_correction = TRUE
)
# Without Hedges' correction
result_no_hedges <- SMD_ind(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "pollinator_exclusion_mean",
A_sd = "pollinator_exclusion_sd",
A_n = "pollinator_exclusion_n",
hedges_correction = FALSE
)
Interaction effect: Standardized mean difference
Description
Computes the interaction effect between factors A and B in factorial data.
Usage
SMD_inter(
data,
col_names = c("yi", "vi"),
append = TRUE,
hedges_correction = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
hedges_correction |
Logical. Apply or not Hedges' correction for small-sample bias. Default is TRUE |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
data <- data.frame(
study_id = 1:2,
control_mean = c(24.8, 27.2), control_sd = c(4.1, 4.6), control_n = c(18, 16),
salinity_mean = c(19.3, 21.7), salinity_sd = c(3.8, 4.2), salinity_n = c(17, 18),
temperature_mean = c(28.9, 31.4), temperature_sd = c(4.7, 5.1), temperature_n = c(19, 15),
salt_temp_mean = c(15.2, 17.8), salt_temp_sd = c(3.1, 3.5), salt_temp_n = c(16, 17)
)
result <- SMD_inter(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "salinity_mean", A_sd = "salinity_sd", A_n = "salinity_n",
B_mean = "temperature_mean", B_sd = "temperature_sd", B_n = "temperature_n",
AB_mean = "salt_temp_mean", AB_sd = "salt_temp_sd", AB_n = "salt_temp_n"
)
Main effect: Standardized Mean Difference
Description
Computes the main effect of Factor A across levels of Factor B, analogous to the main effect in a factorial ANOVA.
Usage
SMD_main(
data,
col_names = c("yi", "vi"),
append = TRUE,
hedges_correction = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
hedges_correction |
Boolean. If TRUE correct for small-sample bias. Default is TRUE. |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the A treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Gurevitch, J., Morrison, J. A., & Hedges, L. V. (2000). The interaction between competition and predation: a meta-analysis of field experiments. The American Naturalist, 155(4), 435-453.
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
# Main effect of Mycorrhiza in 2x2 factorial design (AMF x Phosphorus)
data <- data.frame(
study_id = 1:2,
control_mean = c(12.4, 15.1), control_sd = c(2.8, 3.2), control_n = c(16, 14),
mycorrhizae_mean = c(18.7, 21.3), mycorrhizae_sd = c(3.4, 3.9), mycorrhizae_n = c(15, 16),
phosphorus_mean = c(14.9, 17.8), phosphorus_sd = c(3.1, 3.6), phosphorus_n = c(17, 13),
myco_phos_mean = c(22.1, 25.4), myco_phos_sd = c(4.2, 4.8), myco_phos_n = c(14, 15)
)
result <- SMD_main(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "mycorrhizae_mean", A_sd = "mycorrhizae_sd", A_n = "mycorrhizae_n",
B_mean = "phosphorus_mean", B_sd = "phosphorus_sd", B_n = "phosphorus_n",
AB_mean = "myco_phos_mean", AB_sd = "myco_phos_sd", AB_n = "myco_phos_n"
)
Individual Effect: Log Coefficient Of Variation Ratio
Description
Computes the Log of the Coefficient of Variation Ratio between Factor A and the Control treatment.
Usage
lnCVR_ind(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Nakagawa, S., Poulin, R., Mengersen, K., Reinhold, K., Engqvist, L., Lagisz, M., & Senior, A. M. (2015). Meta‐analysis of variation: ecological and evolutionary applications and beyond. Methods in Ecology and Evolution, 6(2), 143-152.
Examples
data <- data.frame(
study_id = 1:3,
control_mean = c(8.5, 12.3, 6.8),
control_sd = c(1.8, 2.9, 1.4),
control_n = c(18, 24, 16),
nutrient_mean = c(11.2, 16.7, 9.3),
nutrient_sd = c(3.1, 4.8, 2.7),
nutrient_n = c(19, 22, 17)
)
result <- lnCVR_ind(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "nutrient_mean", A_sd = "nutrient_sd", A_n = "nutrient_n"
)
Interaction Effect: Log Coefficient of Variation Ratio
Description
Computes the interaction effect between Factors A and B in factorial experiments on the coefficient of variation ratio.
Usage
lnCVR_inter(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
Examples
# Interaction effect logCVR (Light x Nutrients)
data <- data.frame(
study_id = 1:2,
control_mean = c(7.3, 8.9),
control_sd = c(1.4, 1.7),
control_n = c(20, 18),
light_mean = c(12.8, 14.2),
light_sd = c(3.1, 3.5),
light_n = c(19, 20),
nutrients_mean = c(9.6, 11.1),
nutrients_sd = c(1.9, 2.2),
nutrients_n = c(21, 17),
light_nutrients_mean = c(18.4, 20.7),
light_nutrients_sd = c(4.8, 5.3),
light_nutrients_n = c(18, 19)
)
result <- lnCVR_inter(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "light_mean",
A_sd = "light_sd",
A_n = "light_n",
B_mean = "nutrients_mean",
B_sd = "nutrients_sd",
B_n = "nutrients_n",
AB_mean = "light_nutrients_mean",
AB_sd = "light_nutrients_sd",
AB_n = "light_nutrients_n"
)
Main Effect: Log Coefficient Of Variation Ration
Description
Computes the main effect of Factor A across levels of Factor B in factorial experiments on the coefficient of variation.
Usage
lnCVR_main(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
Examples
data <- data.frame(
study_id = 1:2,
control_mean = c(14.2, 16.8), control_sd = c(2.8, 3.1), control_n = c(16, 14),
irrigation_mean = c(19.5, 22.1), irrigation_sd = c(5.2, 5.8), irrigation_n = c(15, 16),
co2_mean = c(16.8, 19.4), co2_sd = c(3.1, 3.6), co2_n = c(17, 13),
irrigation_co2_mean = c(24.3, 27.9), irrigation_co2_sd = c(6.8, 7.4), irrigation_co2_n = c(14, 15)
)
result <- lnCVR_main(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "irrigation_mean", A_sd = "irrigation_sd", A_n = "irrigation_n",
B_mean = "co2_mean", B_sd = "co2_sd", B_n = "co2_n",
AB_mean = "irrigation_co2_mean", AB_sd = "irrigation_co2_sd", AB_n = "irrigation_co2_n"
)
Simple effect: Log Response Ratio
Description
Computes the individual or simple effect of Factor A over the Control.
Usage
lnRR_ind(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the experimental treatment |
A_sd |
Standard deviation from the experimental treatment |
A_n |
Sample size from the experimental treatment |
Details
It is the classic Log Response Ratio (lnRR), which can also be computed
with metafor's escalc()
function using measure = "ROM"
.
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Lajeunesse, M. J. (2011). On the meta‐analysis of response ratios for studies with correlated and multi‐group designs. Ecology, 92(11), 2049-2055. https://doi.org/10.1890/11-0423.1
Examples
data <- data.frame(
study_id = 1:3,
control_mean = c(10, 15, 12),
control_sd = c(2.1, 3.2, 2.8),
control_n = c(20, 25, 18),
drought_mean = c(12, 18, 14),
drought_sd = c(2.3, 3.5, 3.1),
drought_n = c(22, 24, 20)
)
# Compute individual effect of drought vs control
result <- lnRR_ind(
data = data,
Ctrl_mean = "control_mean",
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_mean = "drought_mean",
A_sd = "drought_sd",
A_n = "drought_n"
)
Interaction effect: Log Response Ratio
Description
Computes the interaction effect between factors A and B in factorial data.
Usage
lnRR_inter(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Examples
data <- data.frame(
study_id = 1:2,
control_mean = c(25, 28), control_sd = c(3.2, 3.8), control_n = c(15, 17),
predation_mean = c(18, 20), predation_sd = c(2.9, 3.1), predation_n = c(16, 18),
competition_mean = c(22, 24), competition_sd = c(3.0, 3.5), competition_n = c(14, 16),
pred_comp_mean = c(12, 15), pred_comp_sd = c(2.1, 2.6), pred_comp_n = c(15, 17)
)
# Compute interaction effect between predation and competition
result <- lnRR_inter(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "predation_mean", A_sd = "predation_sd", A_n = "predation_n",
B_mean = "competition_mean", B_sd = "competition_sd", B_n = "competition_n",
AB_mean = "pred_comp_mean", AB_sd = "pred_comp_sd", AB_n = "pred_comp_n"
)
Main effect: Log Response Ratio
Description
Computes the main effect of Factor A across levels of Factor B, analogous to the main effect in a factorial ANOVA.
Usage
lnRR_main(
data,
col_names = c("yi", "vi"),
append = TRUE,
method = "nakagawa",
Ctrl_mean,
Ctrl_sd,
Ctrl_n,
A_mean,
A_sd,
A_n,
B_mean,
B_sd,
B_n,
AB_mean,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
method |
Method to compute lnRR. Can be either "nakagawa" or "morris". Default is "nakagawa". |
Ctrl_mean |
Mean outcome from the Control treatment |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_mean |
Mean outcome from the A treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_mean |
Mean outcome from the B treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_mean |
Mean outcome from the interaction AxB treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Morris, W. F., Hufbauer, R. A., Agrawal, A. A., Bever, J. D., Borowicz, V. A., Gilbert, G. S., ... & Vázquez, D. P. (2007). Direct and interactive effects of enemies and mutualists on plant performance: a meta‐analysis. Ecology, 88(4), 1021-1029. https://doi.org/10.1890/06-0442
Lajeunesse, M. J. (2011). On the meta‐analysis of response ratios for studies with correlated and multi‐group designs. Ecology, 92(11), 2049-2055. https://doi.org/10.1890/11-0423.1
Macartney, E. L., Lagisz, M., & Nakagawa, S. (2022). The relative benefits of environmental enrichment on learning and memory are greater when stressed: A meta-analysis of interactions in rodents. Neuroscience & Biobehavioral Reviews, 135, 104554. https://doi.org/10.1016/j.neubiorev.2022.104554
Examples
# Example data for 2x2 factorial design (Fertilization x Warming)
data <- data.frame(
study_id = 1:2,
control_mean = c(10, 12), control_sd = c(2.0, 2.5), control_n = c(20, 18),
fertilization_mean = c(15, 16), fertilization_sd = c(2.2, 2.8), fertilization_n = c(20, 19),
warming_mean = c(11, 13), warming_sd = c(2.1, 2.6), warming_n = c(21, 17),
fert_warm_mean = c(17, 19), fert_warm_sd = c(2.4, 3.0), fert_warm_n = c(19, 20)
)
# Compute main effect of fertilization
result <- lnRR_main(
data = data,
Ctrl_mean = "control_mean", Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_mean = "fertilization_mean", A_sd = "fertilization_sd", A_n = "fertilization_n",
B_mean = "warming_mean", B_sd = "warming_sd", B_n = "warming_n",
AB_mean = "fert_warm_mean", AB_sd = "fert_warm_sd", AB_n = "fert_warm_n"
)
Individual effect: Log of Variability Ratio
Description
Computes the Log of the Variability Ratio between a Factor A and the Control treatment in factorial experiments.
Usage
lnVR_ind(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_sd,
Ctrl_n,
A_sd,
A_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_sd |
Standard deviation from the treatment |
A_n |
Sample size from the treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Nakagawa, S., Poulin, R., Mengersen, K., Reinhold, K., Engqvist, L., Lagisz, M., & Senior, A. M. (2015). Meta‐analysis of variation: ecological and evolutionary applications and beyond. Methods in Ecology and Evolution, 6(2), 143-152.
Examples
# Example focusing on variability differences (Herbivory effect)
data <- data.frame(
study_id = 1:3,
control_sd = c(2.1, 1.8, 2.5),
control_n = c(20, 22, 18),
herbivory_sd = c(3.2, 2.9, 3.8),
herbivory_n = c(21, 20, 19)
)
result <- lnVR_ind(
data = data,
Ctrl_sd = "control_sd",
Ctrl_n = "control_n",
A_sd = "herbivory_sd",
A_n = "herbivory_n"
)
Interaction effect: Log Variability Ratio
Description
Computes the interaction of Factors A and B measured as the log of the variability ratio.
Usage
lnVR_inter(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_sd,
Ctrl_n,
A_sd,
A_n,
B_sd,
B_n,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
Examples
# Example for interaction effect in 2x2 factorial focusing on variability (Drought x Temperature)
data <- data.frame(
study_id = 1:2,
control_sd = c(1.8, 2.1), control_n = c(22, 19),
drought_sd = c(2.6, 2.9), drought_n = c(20, 21),
temperature_sd = c(2.0, 2.3), temperature_n = c(21, 18),
drought_temp_sd = c(3.2, 3.6), drought_temp_n = c(19, 20)
)
result <- lnVR_inter(
data = data,
Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_sd = "drought_sd", A_n = "drought_n",
B_sd = "temperature_sd", B_n = "temperature_n",
AB_sd = "drought_temp_sd", AB_n = "drought_temp_n"
)
Main Effect: Log of the Variability Ratio
Description
Computes the overral log of the variability ratio for Factor A across levels of Factor B.
Usage
lnVR_main(
data,
col_names = c("yi", "vi"),
append = TRUE,
Ctrl_sd,
Ctrl_n,
A_sd,
A_n,
B_sd,
B_n,
AB_sd,
AB_n
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
Ctrl_sd |
Standard deviation from the control treatment |
Ctrl_n |
Sample size from the control treatment |
A_sd |
Standard deviation from the A treatment |
A_n |
Sample size from the A treatment |
B_sd |
Standard deviation from the B treatment |
B_n |
Sample size from the B treatment |
AB_sd |
Standard deviation from the interaction AxB treatment |
AB_n |
Sample size from the interaction AxB treatment |
Details
See the package vignette for a detailed description of the formula.
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
Examples
# Example for main effect in 2x2 factorial focusing on variability (Fire x Grazing)
data <- data.frame(
study_id = 1:2,
control_sd = c(2.0, 2.3), control_n = c(20, 18),
fire_sd = c(2.8, 3.1), fire_n = c(19, 20),
grazing_sd = c(2.2, 2.5), grazing_n = c(21, 17),
fire_grazing_sd = c(3.5, 3.8), fire_grazing_n = c(18, 19)
)
result <- lnVR_main(
data = data,
Ctrl_sd = "control_sd", Ctrl_n = "control_n",
A_sd = "fire_sd", A_n = "fire_n",
B_sd = "grazing_sd", B_n = "grazing_n",
AB_sd = "fire_grazing_sd", AB_n = "fire_grazing_n"
)
Fake factorial dataset with pre-computed effect sizes
Description
This dataset contains fake data from 2×2 factorial experiments with four treatment groups: Control (C), Factor A, Factor B, and the combination AB (A and B together). It includes means, standard deviations, and sample sizes for each group, as well as pre-computed effect sizes: log response ratio (lnRR), standardized mean difference (SMD), and their variances, for the main effects of A, B, and the interaction (AB).
Usage
testing_data
Format
A data frame with 10 rows and 24 columns:
- C_n, C_mean, C_sd
Sample size, mean, and SD of the Control group
- A_n, A_mean, A_sd
Sample size, mean, and SD of the A treatment
- B_n, B_mean, B_sd
Sample size, mean, and SD of the B treatment
- AB_n, AB_mean, AB_sd
Sample size, mean, and SD of the AB (A and B combined) treatment
- A_main_lnRR, A_main_lnRRv
Log response ratio for main effect A and its variance
- B_main_lnRR, B_main_lnRRv
Log response ratio for main effect B and its variance
- AB_main_lnRR, AB_main_lnRRv
Log response ratio for the AB interaction and its variance
- A_main_SMD, A_main_SMDv
Standardized mean difference (Hedges' g) for main effect A and its variance
- B_main_SMD, B_main_SMDv
Standardized mean difference for main effect B and its variance
- AB_main_SMD, AB_main_SMDv
Standardized mean difference for the AB interaction and its variance
Details
This dataset is intended for validating functions that compute or test effect sizes in meta-analysis workflows involving factorial designs.
Source
Fake.
Standardized Mean Difference: Interaction Between Treatment and Time
Description
Standardized Mean Difference: Interaction Between Treatment and Time
Usage
time_SMD(
data,
col_names = c("yi", "vi"),
append = TRUE,
hedges_correction = TRUE,
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
hedges_correction |
Logical. Apply or not Hedges' correction for small-sample bias. Default is TRUE. |
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Number or numeric vector. Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Number or numeric vector. Correlation between the means of the experimental group at t0 and t1 |
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Shinichi Nakagawa and Daniel Noble, personal communication.
Examples
# Pre-post design for standardized mean difference with time interaction (Conservation experiment)
data <- data.frame(
study_id = 1:2,
pre_control_mean = c(18.3, 21.7), pre_control_sd = c(4.1, 4.8),
post_control_mean = c(18.8, 22.1), post_control_sd = c(4.2, 4.9),
control_n = c(16, 14),
pre_conservation_mean = c(18.1, 21.4), pre_conservation_sd = c(4.0, 4.7),
post_conservation_mean = c(26.7, 31.2), post_conservation_sd = c(5.8, 6.4),
conservation_n = c(15, 16)
)
result <- time_SMD(
data = data,
t0_Ctrl_mean = "pre_control_mean", t0_Ctrl_sd = "pre_control_sd",
t1_Ctrl_mean = "post_control_mean", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = 0.9,
t0_Exp_mean = "pre_conservation_mean", t0_Exp_sd = "pre_conservation_sd",
t1_Exp_mean = "post_conservation_mean", t1_Exp_sd = "post_conservation_sd",
Exp_n = "conservation_n", Exp_cor = 0.7,
hedges_correction = TRUE
)
# Without Hedges' correction
result_no_hedges <- time_SMD(
data = data,
t0_Ctrl_mean = "pre_control_mean", t0_Ctrl_sd = "pre_control_sd",
t1_Ctrl_mean = "post_control_mean", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = 0.9,
t0_Exp_mean = "pre_conservation_mean", t0_Exp_sd = "pre_conservation_sd",
t1_Exp_mean = "post_conservation_mean", t1_Exp_sd = "post_conservation_sd",
Exp_n = "conservation_n", Exp_cor = 0.7,
hedges_correction = FALSE
)
Log Coefficient of Variation Ratio: Interaction Between Treatment and Time
Description
Log Coefficient of Variation Ratio: Interaction Between Treatment and Time
Usage
time_lnCVR(
data,
col_names = c("yi", "vi"),
append = TRUE,
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Number or numeric vector. Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Number or numeric vector. Correlation between the means of the experimental group at t0 and t1 |
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Shinichi Nakagawa and Daniel Noble, personal communication.
Examples
# Pre-post design for coefficient of variation changes over time (Disturbance experiment)
data <- data.frame(
study_id = 1:2,
pre_control_mean = c(12.8, 15.4), pre_control_sd = c(2.6, 3.1),
post_control_mean = c(13.2, 15.9), post_control_sd = c(2.7, 3.2),
control_n = c(20, 18),
pre_disturbed_mean = c(12.9, 15.2), pre_disturbed_sd = c(2.5, 3.0),
post_disturbed_mean = c(8.7, 10.1), post_disturbed_sd = c(3.8, 4.3),
disturbed_n = c(19, 21)
)
result <- time_lnCVR(
data = data,
t0_Ctrl_mean = "pre_control_mean", t0_Ctrl_sd = "pre_control_sd",
t1_Ctrl_mean = "post_control_mean", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = 0.8,
t0_Exp_mean = "pre_disturbed_mean", t0_Exp_sd = "pre_disturbed_sd",
t1_Exp_mean = "post_disturbed_mean", t1_Exp_sd = "post_disturbed_sd",
Exp_n = "disturbed_n", Exp_cor = 0.5
)
Log Response Ratio: Interaction Between Treatment and Time
Description
Log Response Ratio: Interaction Between Treatment and Time
Usage
time_lnRR(
data,
col_names = c("yi", "vi"),
append = TRUE,
t0_Ctrl_mean,
t0_Ctrl_sd,
t1_Ctrl_mean,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_mean,
t0_Exp_sd,
t1_Exp_mean,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
t0_Ctrl_mean |
Sample mean from the control group at time 0 |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_mean |
Sample mean from the control group at time 1 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Number or numeric vector. Correlation between the means of the control group at t0 and t1 |
t0_Exp_mean |
Sample mean from the experimental group at time 0 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_mean |
Sample mean from the experimental group at time 1 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Number or numeric vector. Correlation between the means of the experimental group at t0 and t1 |
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Shinichi Nakagawa and Daniel Noble, personal communication.
Examples
data <- data.frame(
study_id = 1:2,
pre_control_mean = c(8.4, 10.2), # Control before restoration
pre_control_sd = c(1.8, 2.1),
post_control_mean = c(8.9, 10.7), # Control after restoration period
post_control_sd = c(1.9, 2.2),
control_n = c(22, 18),
pre_restoration_mean = c(8.6, 10.1), # Restoration sites before
pre_restoration_sd = c(1.9, 2.0),
post_restoration_mean = c(15.3, 17.8), # Restoration sites after
post_restoration_sd = c(3.2, 3.7),
restoration_n = c(20, 19)
)
result <- time_lnRR(
data = data,
t0_Ctrl_mean = "pre_control_mean", t0_Ctrl_sd = "pre_control_sd",
t1_Ctrl_mean = "post_control_mean", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = 0.7, # Correlation within control sites
t0_Exp_mean = "pre_restoration_mean", t0_Exp_sd = "pre_restoration_sd",
t1_Exp_mean = "post_restoration_mean", t1_Exp_sd = "post_restoration_sd",
Exp_n = "restoration_n", Exp_cor = 0.6 # Correlation within restoration sites
)
# Using different correlations for each study
result2 <- time_lnRR(
data = data,
t0_Ctrl_mean = "pre_control_mean", t0_Ctrl_sd = "pre_control_sd",
t1_Ctrl_mean = "post_control_mean", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = c(0.6, 0.8),
t0_Exp_mean = "pre_restoration_mean", t0_Exp_sd = "pre_restoration_sd",
t1_Exp_mean = "post_restoration_mean", t1_Exp_sd = "post_restoration_sd",
Exp_n = "restoration_n", Exp_cor = c(0.5, 0.7)
)
Log of Variability Ratio: Interaction Between Treatment and Time
Description
Log of Variability Ratio: Interaction Between Treatment and Time
Usage
time_lnVR(
data,
col_names = c("yi", "vi"),
append = TRUE,
t0_Ctrl_sd,
t1_Ctrl_sd,
Ctrl_n,
Ctrl_cor,
t0_Exp_sd,
t1_Exp_sd,
Exp_n,
Exp_cor
)
Arguments
data |
Data frame containing the variables used. |
col_names |
Vector of two strings to name the output columns for the effect size and its sampling variance. Default is 'yi' and 'vi'. |
append |
Logical. Append the results to |
t0_Ctrl_sd |
Standard deviation from the control group at time 0 |
t1_Ctrl_sd |
Standard deviation from the control group at time 1 |
Ctrl_n |
Sample size of the control group |
Ctrl_cor |
Number or numeric vector. Correlation between the means of the control group at t0 and t1 |
t0_Exp_sd |
Standard deviation from the experimental group at time 0 |
t1_Exp_sd |
Standard deviation from the experimental group at time 1 |
Exp_n |
Sample size of the experimental group |
Exp_cor |
Number or numeric vector. Correlation between the means of the experimental group at t0 and t1 |
Value
A data frame containing the effect sizes and their sampling variance.
By default, the columns are named yi
(effect size) and vi
(sampling variance).
If append = TRUE
, the results are appended to the input data
; otherwise, only the computed effect size columns are returned.
Author(s)
Facundo Decunta - fdecunta@agro.uba.ar
References
Shinichi Nakagawa and Daniel Noble, personal communication.
Examples
data <- data.frame(
study_id = 1:2,
pre_control_sd = c(2.1, 2.4),
post_control_sd = c(2.2, 2.5),
control_n = c(24, 19),
pre_invaded_sd = c(2.0, 2.3),
post_invaded_sd = c(4.1, 4.6),
invaded_n = c(21, 22)
)
result <- time_lnVR(
data = data,
t0_Ctrl_sd = "pre_control_sd", t1_Ctrl_sd = "post_control_sd",
Ctrl_n = "control_n", Ctrl_cor = 0.6,
t0_Exp_sd = "pre_invaded_sd", t1_Exp_sd = "post_invaded_sd",
Exp_n = "invaded_n", Exp_cor = 0.4
)