var_d_calc | R Documentation |
This function computes the variance of Cohen's D or Glass's Delta based on the provided effect size and sample sizes, following the equation from Cooper, Hedges, and Valentine (2009). You can calculate variance on an individual basis by manually putting in a d value from d_calc(), or you can do so in a batch way based on an entire dataset.
var_d_calc(d, n_t, n_c)
d |
Standardized effect size calculated using |
n_t |
Treatment sample size. |
n_c |
Control group sample size. |
Variance of Cohen's D or Glass's Delta
# example 1: calculating d, var_d, and se_d for a single study
ditullio_results <- d_calc(stat_type = "d_i_m", stat = 5.708 - 3.0798, sample_sd = 1.0381)
ditullio_variance <- var_d_calc(d = ditullio_results, n_t = 38, n_c = 38)
ditullio_se <- sqrt(ditullio_variance)
# example 2: calculating d, var_d, and se_d for an entire dataset
## Not run:
PaluckMetaSOP::contact_data |>
select(-var_d)
mutate(var_d = mapply(
FUN = var_d_calc,
d = d,
n_t = n_t,
n_c = n_c)) |>
mutate(se_d = sqrt(var_d))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.