This function displays d for two between subjects groups and gives the central and non-central confidence interval using the pooled standard deviation as the denominator.
calculate_d(
m1 = NULL,
m2 = NULL,
sd1 = NULL,
sd2 = NULL,
n1 = NULL,
n2 = NULL,
t = NULL,
model = NULL,
df = NULL,
x_col = NULL,
y_col = NULL,
d = NULL,
a = 0.05,
lower = TRUE
)Provides the effect size (Cohen's *d*) with associated central and non-central confidence intervals, the *t*-statistic, the confidence intervals associated with the means of each group, as well as the standard deviations and standard errors of the means for each group. The one-tailed confidence interval is also included for sensitivity analyses.
effect size
noncentral lower level confidence interval of d value
noncentral upper level confidence interval of d value
central lower level confidence interval of d value
central upper level confidence interval of d value
noncentral lower bound of one tailed confidence interval
central lower bound of one tailed confidence interval
mean of group one
standard deviation of group one mean
standard error of group one mean
lower level confidence interval of group one mean
upper level confidence interval of group one mean
mean of group two
standard deviation of group two mean
standard error of group two mean
lower level confidence interval of group two mean
upper level confidence interval of group two mean
pooled standard deviation
pooled standard error
sample size of group one
sample size of group two
degrees of freedom (n1 - 1 + n2 - 1)
t-statistic
p-value
the d statistic and confidence interval in APA style for markdown printing
the t-statistic in APA style for markdown printing
mean group one
mean group two
standard deviation group one
standard deviation group two
sample size group one
sample size group two
optional, calculate d from independent t, you must include n1 and n2 for degrees of freedom
optional, calculate d from t.test for independent t, you must still include n1 and n2
optional dataframe that includes the x_col and y_col
name of the column that contains the factor levels OR a numeric vector of group 1 scores
name of the column that contains the dependent score OR a numeric vector of group 2 scores
a previously calculated d value from a study
significance level
Use this to indicate if you want the lower or upper bound
of d for one sided confidence intervals. If d is positive, you generally
want lower = TRUE, while negative d values should enter
lower = FALSE for the upper bound that is closer to zero.
To calculate \(d_s\), mean two is subtracted from mean one and divided by the pooled standard deviation. $$d_s = \frac{M_1 - M_2}{S_{pooled}}$$
You should provide one combination of the following:
1: m1 through n2
2: t, n1, n2
3: model, n1, n2
4: df, "x_col", "y_col"
5: x_col, y_col as numeric vectors
6: d, n1, n2
You must provide alpha and lower to ensure the right confidence interval is provided for you.
calculate_d(m1 = 14.37, # neglect mean
sd1 = 10.716, # neglect sd
n1 = 71, # neglect n
m2 = 10.69, # none mean
sd2 = 8.219, # none sd
n2 = 3653, # none n
a = .05, # alpha/confidence interval
lower = TRUE) # lower or upper bound
Run the code above in your browser using DataLab