bootD_equalSS: Bootstrap equal-sample-size Cohen's d

View source: R/bootD_equalSS.R

bootD_equalSSR Documentation

Bootstrap equal-sample-size Cohen's d

Description

Unequal sample sizes can skew estimates of group differences. This function takes two numeric vectors, x and y, and repeatedly calculates Cohen's d for the difference in means. On each iteration the smaller of the two vectors is used whole, while the larger of the two vectors is randomly subsampled with the same number of elements as the smaller vector (NAs excluded). Several quantiles of the resampled distributions of Cohen's d are returned, along with the true mean difference.

Usage

bootD_equalSS(x, y, nBoot = 2000)

Arguments

x

The first vector

y

The second vector

nBoot

The number of bootstrap iterations

Examples

x <- c(NA,rnorm(3000,.5))
y <- rnorm(30)
bootD_equalSS(x,y)


akcochrane/ACmisc documentation built on Nov. 24, 2024, 11:22 a.m.