Posted By

inductivestep on 01/05/14


Tagged


Versions (?)

Pretest-Posttest-Control Group effect size calculator


 / Published in: Python
 

Effect size calculator using method described by Morris, S. B. (2007). Estimating Effect Sizes From Pretest-Posttest-Control Group Designs. Organizational Research Methods, 11(2), 364–386. doi:10.1177/1094428106291059

  1. import math
  2.  
  3. print("n1?")
  4. n1 = float(input())
  5. print("n2?")
  6. n2 = float(input())
  7. print("pre sd1?")
  8. sd1 = float(input())
  9. print("pre sd2?")
  10. sd2 = float(input())
  11. print("pre mean1?")
  12. pre1 = float(input())
  13. print("post mean1?")
  14. post1 = float(input())
  15. print("pre mean2?")
  16. pre2 = float(input())
  17. print("post mean2?")
  18. post2 = float(input())
  19.  
  20. def pooledSD(n1,n2,sd1,sd2):
  21. return math.sqrt(((n1-1)*sd1**2 + (n2-1)*sd2**2)/(n1+n2-2))
  22.  
  23. def ppc(preMean1, preMean2, postMean1, postMean2, prePoolSD):
  24. return ((postMean1 - preMean1) - (postMean2 - preMean2)) / prePoolSD
  25.  
  26. print("Pooled pre SD")
  27. sd = pooledSD(n1,n2,sd1,sd2)
  28. print(sd)
  29.  
  30. print("PPC ES")
  31. print(ppc(pre1, pre2, post1, post2, sd))

Report this snippet  

You need to login to post a comment.