Skip to contents

The function allows to calculate the standardized cohen's d, the critical standardized cohen's d, the cohen's d and the critical d for a paired two samples t-test.

Usage

critical_t2sp(
  m1 = NULL,
  m2 = NULL,
  t = NULL,
  sd1 = NULL,
  sd2 = NULL,
  r12 = NULL,
  n,
  se = NULL,
  hypothesis = c("two.sided", "greater", "less"),
  conf.level = 0.95
)

Arguments

m1

a number representing the mean of group 1.

m2

a number representing the mean of group 2.

t

the t value.

sd1

a number representing the standard deviation of group 1.

sd2

a number representing the standard deviation of group 2.

r12

a number corresponding to the correlation between variable 1 and variable 2.

n

a number corresponding to the sample size.

se

a number corresponding to the standard error.

hypothesis

a character string indicating the alternative hypothesis ("less", "greater" or "two.tailed").

conf.level

the confidence level to set the confidence interval, default is set to 0.95.

Value

the output returns a dz which is the critical Cohen's d standartized on the standard deviation of the differences, the dzc is the critical standardized d using the pooled standard deviation, the d is the Cohen's d, the dc is the minimum value for which to get a significant result with a given sample, the bc is the numerator of the formula from which the d is calculated, se is the standard error, df are the degrees of freedom,the g and gc are respectively d and dc with Hedger's Correction for small samples and gz and gzc are the standardized ones.

Examples

# critical value from summary statistics
m1 <- 10
m2 <- 15
sd1 <- 5
sd2 <- 4.25
n <- 30
critical_t2sp(m1 = m1, m2 = m2, sd1 = sd1, sd2 = sd2, n = n)
#> Warning: when m2 and sd2 are provided and r12 is NULL dz and dzc and cannot be computed, returning NA
#> $dz
#> [1] -0.7619393
#> 
#> $dzc
#> [1] 0.3734061
#> 
#> $d
#> [1] -1.077545
#> 
#> $dc
#> [1] 0.528076
#> 
#> $bc
#> [1] 2.450367
#> 
#> $se
#> [1] 1.198089
#> 
#> $df
#> [1] 29
#> 
#> $g
#> [1] -1.049394
#> 
#> $gc
#> [1] 0.51428
#> 
#> $gz
#> [1] -0.7420336
#> 
#> $gzc
#> [1] 0.3636509
#> 
# critical value from the t statistic
se <- sqrt((sd1^2 + sd2^2) / n)
t <- (m1 - m2) / se
critical_t2sp(t = t, n = n, se = se) # se only required for calculating bc
#> $dz
#> [1] -0.7619393
#> 
#> $dzc
#> [1] 0.3734061
#> 
#> $d
#> [1] -1.077545
#> 
#> $dc
#> [1] 0.528076
#> 
#> $bc
#> [1] 2.450367
#> 
#> $se
#> [1] 1.198089
#> 
#> $df
#> [1] 29
#> 
#> $g
#> [1] -1.049394
#> 
#> $gc
#> [1] 0.51428
#> 
#> $gz
#> [1] -0.7420336
#> 
#> $gzc
#> [1] 0.3636509
#>