cohend | R Documentation |
Calculates effect size (cohen's d) for one or two samples.
cohend(x, y, conf = 95, mu = 0, g = FALSE)
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. |
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
https://www.rdocumentation.org/packages/effsize/versions/0.8.1/topics/cohen.d
This function makes use of cohen.d
from effsize
package.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.