Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. ggplot(over36mo, aes(x=raceeth,y=pt,fill=factor(year.2cat))) +
  2. geom_bar(stat="identity",position="dodge") +
  3. geom_errorbar(aes(ymax=pt+se, ymin=pt-se), width=0.2, position=position_dodge(0.9)) +
  4. scale_fill_discrete(guide=FALSE) +
  5. scale_y_continuous(breaks=seq(0, 0.26, 0.02), limits=c(0,0.26)) +
  6. labels=c("NHW","NHB","NHNA/PI","NHA","H")) +
  7. theme(axis.line.x=element_line(color="black"),
  8. axis.line.y=element_line(color="black"),
  9. panel.background=element_blank(),
  10. panel.border=element_blank(),
  11. panel.grid.major=element_blank(),
  12. panel.grid.minor=element_blank(),
  13. plot.background=element_blank()) +
  14. xlab("All ages") + ylab("")
  15.  
  16. ggplot(over36mo, aes(x=raceeth,y=pt,fill=factor(year.2cat))) +
  17. geom_bar(stat="identity",position="dodge") +
  18. geom_errorbar(aes(ymax=pt+se, ymin=pt-se), width=0.2, position=position_dodge(0.9)) +
  19. scale_fill_discrete(guide=FALSE) +
  20. scale_y_continuous(breaks=seq(0, 0.26, 0.02), limits=c(0,0.26)) +
  21. labels=c("NHW","NHB","NHNA/PI","NHA","H")) +
  22. theme(axis.line.x=element_line(color="black"),
  23. axis.line.y=element_line(color="black"),
  24. panel.background=element_blank(),
  25. panel.border=element_blank(),
  26. panel.grid.major=element_blank(),
  27. panel.grid.minor=element_blank(),
  28. plot.background=element_blank()) +
  29. xlab("All ages") + ylab("") +
  30. scale_x_discrete(breaks=c("1","2","3","4","5"), labels=c("NHW","NHB","NHNA/PI","NHA","H")) +
  31.  
  32. dput(over36mo)
  33.  
  34. structure(list(z.surv.mos = c(36, 36, 36, 36, 36, 36, 36, 36,
  35. 36, 36), raceeth = c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5), year.2cat = c(1,
  36. 2, 1, 2, 1, 2, 1, 2, 1, 2), pt = c(0.10896243930756, 0.12919986395988,
  37. 0.10763696166101, 0.0918969557367, 0.14186152615109, 0.12701814940611,
  38. 0.05405405405405, 0.09393141727008, 0.08880901672474, 0.11716939090588
  39. ), nevent = c(9, 3, 0, 0, 2, 1, 0, 0, 1, 1), ncensor = c(0, 9,
  40. 0, 1, 0, 2, 0, 1, 0, 0), nrisk = c(311, 96, 33, 9, 72, 21, 2,
  41. 2, 48, 20), cum.ev = c(2474, 2469, 287, 342, 440, 496, 35, 40,
  42. 505, 616), cum.cen = c(1, 958, 4, 107, 12, 198, 0, 13, 19, 239
  43. ), pointflg = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), pe = c(0.89103756069243,
  44. 0.87080013604011, 0.89236303833898, 0.90810304426329, 0.8581384738489,
  45. 0.87298185059388, 0.94594594594594, 0.90606858272991, 0.91119098327525,
  46. 0.88283060909411), se = c(0.00591553159512, 0.00860912091676,
  47. 0.01746946721576, 0.01975702415208, 0.01550071018085, 0.01904081251339,
  48. 0.03717461110299, 0.05797150600236, 0.01228353765126, 0.01608823714602
  49. ), lower.cl = c(0.09796374785164, 0.11338170396883, 0.07830897003442,
  50. 0.06029765195198, 0.11451353670001, 0.09468155080317, 0.01404207131432,
  51. 0.02802051731609, 0.06772108402588, 0.08952365586359), upper.cl = c(0.12119598770184,
  52. 0.14722485430136, 0.14794876641234, 0.1400560419898, 0.17574073058836,
  53. 0.17039866945242, 0.20807761862723, 0.31488038035974, 0.11646360310182,
  54. 0.15335238527538)), .Names = c("z.surv.mos", "raceeth", "year.2cat",
  55. "pt", "nevent", "ncensor", "nrisk", "cum.ev", "cum.cen", "pointflg",
  56. "pe", "se", "lower.cl", "upper.cl"), row.names = c("38", "134",
  57. "183", "246", "289", "366", "412", "452", "491", "563"), class = "data.frame")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement