effectSize: Effect Size

Description Usage Arguments Details Value Examples

View source: R/effectSize.R

Description

Calculates the effect size / Cohen's D given a vector of data and a vector for grouping

Usage

1
effectSize(x, g)

Arguments

x

a vector of doubles with the observations

g

a vector of 1 or 0 indicating grouping.

Details

Computes the effect size by dividing the sample difference by the standard deviation of the pooled sample. The function takes a vector of observations and a vector of groups in the form of group1 == 1, group2 ==2. Group 1 and 2 must of same size

Value

Effect Size / Cohen's D

Examples

1
2
3
groups <- c(rep(1,times=50),rep(0,times=50))  
modeled_tumor_size <- 4 -2*groups + rnorm(100)  
effectSize(modeled_tumor_size, groups) 

frankchien/bmi585flc documentation built on Dec. 20, 2021, 8:51 a.m.