Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. cohens_h = function( prop_1, prop_2, n1, n2, ci = 0.95 ){
  2. x1 = asin(sign(prop_1) * sqrt(abs(prop_1)))
  3. x2 = asin(sign(prop_2) * sqrt(abs(prop_2)))
  4. es = x1 - x2
  5. se = sqrt(0.25 * (1 / n1 + 1 / n2 ))
  6. ci_diff = qnorm(1 - (1-ci) / 2) * se
  7. return( c( h = es*2, h_low = (es-ci_diff)*2, h_upp = (es+ci_diff)*2 ) )
  8. }
  9.  
  10. acc1 = .70
  11. acc2 = .90
  12. N1 = 200
  13. N2 = 300
  14. cohens_h(acc1, acc2, N1, N2)
  15.  
  16. h h_low h_upp
  17. -0.5157784 -0.6946978 -0.3368590
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement