d_calc: Calculate Cohen's D or Glass's ∆

View source: R/d_calc.R

d_calcR Documentation

Calculate Cohen's D or Glass's ∆

Description

This function converts raw effect sizes into Cohen's D or Glass's ∆ based on the measure of sample variance for standardization.

Usage

d_calc(stat_type, stat, sample_sd, n_t, n_c)

Arguments

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.

Details

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.

Value

Cohen's D or Glass's ∆ (Delta) value.

Examples

## Not run: 
# 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
# dat <- PaluckMetaSOP::contact_data
# first remove d column to prevent duplicates
# dat |> select(-d) |> mutate(d = mapply(
# FUN = d_calc,
# stat_type = statistic,
# stat =  unstand,
# sample_sd = sd_c,
# n_t = n_t,
# n_c = n_c))
# NOTE TO REVISIT THIS LAST EXAMPLE BC of standardized reg coef

## End(Not run)

setgree/PrejMetaFunctions documentation built on April 28, 2024, 9:29 a.m.