cohend: Cohen's d effect size for one or two groups.

View source: R/cohend.R

cohendR Documentation

Cohen's d effect size for one or two groups.

Description

Calculates effect size (cohen's d) for one or two samples.

Usage

cohend(x, y, conf = 95, mu = 0, g = FALSE)

Arguments

x

First vector.

y

Second vector.

conf

Desired confidence level. default is set to 95.

mu

State your prior belief (H0) for the true difference between the groups. defaults is set to 0.

g

calls for the 'Hedge's g' correction. default is set to FALSE.

Details

Full details via the effsize documantation. You can use either two vectors x and y, Or set x as a vector and y as a factor variable

Source

https://www.rdocumentation.org/packages/effsize/versions/0.8.1/topics/cohen.d

See Also

This function makes use of cohen.d from effsize package.

Examples

x <- big5$Agreeableness[big5$gender=="Females"]
y <- big5$Agreeableness[big5$gender=="Males"]
cohend(x,y)
# We comapre Agreeableness level between both gender, using two seperate vectors.
cohend(x=big5[,1],y=big5$gender)
# We comapre the same variables, now y is a factoring varaible. Also used '[]' for shorter script.
cohend(big5$Agreeableness,y=NA,mu=1,conf=99)
# Only one vector compparison against Null hypothesis that mu equals 1, in 99% confidence level.
## Note that you need to set y=NA if you dont want to use it, otherwise you'll get an Error.

bgupsych/bgupsych documentation built on Nov. 1, 2023, 9:41 a.m.