Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cohens_h = function( prop_1, prop_2, n1, n2, ci = 0.95 ){
- x1 = asin(sign(prop_1) * sqrt(abs(prop_1)))
- x2 = asin(sign(prop_2) * sqrt(abs(prop_2)))
- es = x1 - x2
- se = sqrt(0.25 * (1 / n1 + 1 / n2 ))
- ci_diff = qnorm(1 - (1-ci) / 2) * se
- return( c( h = es*2, h_low = (es-ci_diff)*2, h_upp = (es+ci_diff)*2 ) )
- }
- acc1 = .70
- acc2 = .90
- N1 = 200
- N2 = 300
- cohens_h(acc1, acc2, N1, N2)
- h h_low h_upp
- -0.5157784 -0.6946978 -0.3368590
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement