Skip to contents

The function allows to calculate cohen's d and critical d for a one-sample t-test.

Usage

critical_t1s(
  m = NULL,
  s = NULL,
  t = NULL,
  n,
  se = NULL,
  hypothesis = c("two.sided", "greater", "less"),
  conf.level = 0.95
)

Arguments

m

a number representing the mean of the group.

s

Variance

t

the t value.

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 d which is the Cohen's d, the critical d which 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, df are the degrees of freedom and se is the standard error, then it also gives the g and gc which are respectively d and dc with Hedfer's Correction for small samples.

Examples

# critical value from summary statistics
m <- 0.5
s <- 1
n <- 30
critical_t1s(m = m, s = s, n = n)
#> $d
#> [1] 0.5
#> 
#> $dc
#> [1] 0.3734061
#> 
#> $bc
#> [1] 0.3734061
#> 
#> $se
#> [1] 0.1825742
#> 
#> $df
#> [1] 29
#> 
#> $g
#> [1] 0.4869375
#> 
#> $gc
#> [1] 0.3636509
#> 
# critical value from the t statistic
se <- s / sqrt(n)
t <- m / se
critical_t1s(t = t, n = n, se = se) # se only required for calculating bc
#> $d
#> [1] 0.5
#> 
#> $dc
#> [1] 0.3734061
#> 
#> $bc
#> [1] 0.3734061
#> 
#> $se
#> [1] 0.1825742
#> 
#> $df
#> [1] 29
#> 
#> $g
#> [1] 0.4869375
#> 
#> $gc
#> [1] 0.3636509
#>