Advertisement
Guest User

colmar_brunton

a guest
Apr 2nd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. > results <- c(47, 31, 11, 7, 2.3, 0.7, 0.3, 0.1, 0, 0.4)
  2. > results / 100 * 767
  3. [1] 360.490 237.770 84.370 53.690 17.641 5.369 2.301 0.767 0.000 3.068
  4. >
  5. > num_people <- round(results / 100 * 767) # approximate, as these are only weighted results
  6. >
  7. > s <- sapply(num_people, function(x) { round(binom.test(x, 767)$conf.int*100,1) })
  8. > colnames(s) <- c("Nat", "Lab", "Green", "NZF", "Cons", "Maori", "Act", "United", "Mana", "Other")
  9. > rownames(s) <- c("Lower", "Upper")
  10. >
  11. > s
  12. Nat Lab Green NZF Cons Maori Act United Mana Other
  13. Lower 43.4 27.8 8.8 5.3 1.4 0.2 0.0 0.0 0.0 0.1
  14. Upper 50.5 34.4 13.4 9.1 3.7 1.5 0.9 0.7 0.5 1.1
  15. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement