| Title: | Effect Sizes for Meta-Analysis of Interactions from Factorial Experiments |
|---|---|
| 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>. |
| Authors: | Facundo Decunta [aut, cre] (ORCID: <https://orcid.org/0009-0004-5774-1085>), Shinichi Nakagawa [ctb], Daniel Noble [ctb] |
| Maintainer: | Facundo Decunta <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-04 17:12:53 UTC |
| Source: | https://github.com/fdecunta/minter |
Computes the Log of the Coefficient of Variation Ratio between Factor A and the Control treatment.
lnCVR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_mean, Ctrl_sd, Ctrl_n, A_mean, A_sd, A_n )lnCVR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_mean, Ctrl_sd, Ctrl_n, A_mean, A_sd, A_n )
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 |
This assumes no correlation between mean and variance (Nakagawa et al. 2015) and is computed as the sum of lnRR and lnVR variances.
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.
Facundo Decunta - [email protected]
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.
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" )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" )
Computes the interaction effect between Factors A and B in factorial experiments on the coefficient of variation ratio.
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 )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 )
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 |
This follows the assumption of no correlation between mean and variance.
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.
Facundo Decunta - [email protected]
# 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" )# 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" )
Computes the main effect of Factor A across levels of Factor B in factorial experiments on the coefficient of variation.
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 )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 )
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 |
This follows the assumption of no correlation between mean and variance.
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.
Facundo Decunta - [email protected]
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" )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" )
Computes the individual or simple effect of Factor A over the Control.
lnRR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_mean, Ctrl_sd, Ctrl_n, A_mean, A_sd, A_n )lnRR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_mean, Ctrl_sd, Ctrl_n, A_mean, A_sd, A_n )
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 |
It is the classic Log Response Ratio (lnRR), which can also be computed
with metafor's escalc() function using measure = "ROM".
The log response ratio of Factor A over Control is computed as:
Formulas:
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.
Facundo Decunta - [email protected]
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
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" )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" )
Computes the interaction effect between factors A and B in factorial data.
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
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
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" )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" )
Computes the main effect of Factor A across levels of Factor B, analogous to the main effect in a factorial ANOVA.
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 )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 )
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 |
There are two ways of computing the lnRR. One is the original method used by Morris et al. 2007, and the other is the one proposed by Shinichi Nakagawa (in prep). Default method is 'nakagawa':
Nakagawa formula
Morris formula
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.
Facundo Decunta - [email protected]
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
# 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" )# 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" )
Computes the Log of the Variability Ratio between a Factor A and the Control treatment in factorial experiments.
lnVR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_sd, Ctrl_n, A_sd, A_n )lnVR_ind( data, col_names = c("yi", "vi"), append = TRUE, Ctrl_sd, Ctrl_n, A_sd, A_n )
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 |
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.
Facundo Decunta - [email protected]
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.
# 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" )# 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" )
Computes the interaction of Factors A and B measured as the log of the variability ratio.
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
# 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" )# 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" )
Computes the overral log of the variability ratio for Factor A across levels of Factor B.
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
# 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" )# 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" )
Computes the effect of Factor A over the Control.
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 )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 )
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 |
It is the classic Standardized Mean Difference (SMD), which can also be computed
with metafor's escalc() function using measure = "SMD".
The SMD of Factor A over the Control is computed as:
where the pooled standard deviation is:
And the Hedges correction:
with :
The sampling variance is:
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.
Facundo Decunta - [email protected]
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
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 )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 )
Computes the interaction effect between factors A and B in factorial data.
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 )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 )
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 |
The interaction is computed as:
With the pooled standard deviation:
And the Hedges correction as:
with:
The sampling variance is computed as:
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.
Facundo Decunta - [email protected]
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
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" )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" )
Computes the main effect of Factor A across levels of Factor B, analogous to the main effect in a factorial ANOVA.
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 )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 )
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 |
The main SMD of Factor A is computed as:
With the pooled standard deviation:
And the Hedges correction as:
with:
The sampling variance is computed as:
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.
Facundo Decunta - [email protected]
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
# 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" )# 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" )
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
Shinichi Nakagawa and Daniel Noble, personal communication.
# 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 )# 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 )
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
Shinichi Nakagawa and Daniel Noble, personal communication.
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) )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) )
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 )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 )
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 |
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.
Facundo Decunta - [email protected]
Shinichi Nakagawa and Daniel Noble, personal communication.
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 )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 )
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 )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 )
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 |
Pooled standard deviation:
Sampling variance:
where and are the correlations between time points within each group.
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.
Facundo Decunta - [email protected]
Shinichi Nakagawa and Daniel Noble, personal communication.
# 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 )# 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 )