Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. # Simulate data for both groups
  2. group_1 <- rgeom(10000, 1/(1 + 3.7))
  3. group_1_alternate <- rgeom(10000, 1/(1 + 3.7))
  4. group_2 <- rgeom(10000, 1/(1 + 4.35))
  5.  
  6. # Compare Group 1 to itself to get a baseline chance that a random person
  7. # drawn from this distribution outperforms itself
  8. group_1_greater_self <- sum(group_1 > group_1_alternate)
  9.  
  10. # Compare Group 2 to Group 1 to get the new percentage chance that a random
  11. # person drawn from Group 2 outperforms a random person from Group 1
  12. group_2_greater_group_1 <- sum(group_2 > group_1)
  13.  
  14. # Calculate the risk ratio
  15. training_rr <- group_2_greater_group_1/group_1_greater_self
  16.  
  17. # The risk ratio falls around 1.09. Can I interpret this that there's a 9%
  18. # chance someone going through training will see greater sales than if they
  19. # didn't attend training?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement