d_calc | R Documentation |
This function converts raw effect sizes into Cohen's D or Glass's Delta based on the measure of sample variance for standardization.
d_calc(stat_type, stat, sample_sd, n_t, n_c)
stat_type |
Category of statistical result reported or derived from the paper. Possible values are "d", "d_i_d", "d_i_m", "d_i_p", "f_test", "log_odds_ratio", "odds_ratio", "reg_coef", "s_m_d", "t_test", "unspecified null". |
stat |
Unstandardized effect size. |
sample_sd |
Standard deviation of the relevant sample (preferably of the control group). |
n_t |
Treatment group sample size. |
n_c |
Control group sample size. |
All calculations derived from Cooper, Hedges, and Valentine (2009), except for difference in proportions, which, to the best of our knowledge, Don Green came up with while we were working on Prejudice Reduction: Progress and Challenges. We elaborate more on this estimator in the paper's appendix.
Cohen's D or Glass's Delta value.
# Example: Calculate d for a study that provides difference in means results
difference_in_means_result <- d_calc(stat_type = "d_i_m", stat = 1, sample_sd = 0.3)
# Example: Calculate d for a study that provides an F-test
f_test_result <- d_calc(stat_type = "f_test", stat = 1, n_t = 50, n_c = 40)
# Example: Use mapply to calculate d from rows in dataset
## Not run:
library(dplyr)
PaluckMetaSOP::contact_data |>
select(-d) |>.# remove d in order to recalculate it
mutate(d = mapply(
FUN = d_calc,
stat_type = statistic,
stat = unstand,
sample_sd = sd_c,
n_t = n_t,
n_c = n_c)) |> select(name_short, d)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.