Guest User

Untitled

a guest
Nov 16th, 2023
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. using DataFrames, StatsPlots, StatsBase
  2.  
  3. df = DataFrame(
  4. age1 = [45, 65, 75, 85],
  5. age2 = [64, 74, 84, 94],
  6. urate = [0.51, 2.13, 6.34, 18.76],
  7. prate = [0.13, 0.62, 1.89, 6.85],
  8. ltlowm = [0.003340, 0.016001, 0.034618, 0.095062],
  9. lthighm = [0.015006, 0.031401, 0.085452, 0.238080],
  10. ltlowf = [0.001989, 0.009617, 0.024080, 0.072731],
  11. lthighf = [0.009031, 0.021714, 0.064863, 0.194973]
  12. )
  13.  
  14. avg_age = mean([df.age1, df.age2])
  15. avg_low = 100*mean([df.ltlowm, df.ltlowf])
  16. avg_high = 100*mean([df.lthighm, df.lthighf])
  17. avg = mean([avg_low, avg_high])
  18.  
  19. plot(avg_age, df.urate, label = "Unvaccinated", lw = 2, grid = "true",
  20. gridalpha = 0.25, background_color = "black")
  21. plot!(avg_age, df.prate, label = "Vaccinated", lw = 2)
  22. plot!(avg_age, avg_low, label = "Life Table Low", lw = 2, ls = :dash)
  23. plot!(avg_age, avg_high, label = "Life Table High", lw = 2, ls = :dash)
  24. plot!(avg_age, avg, label = "Life Table Avg", lw = 2, ls = :dot)
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment