Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using DataFrames, StatsPlots, StatsBase
- df = DataFrame(
- age1 = [45, 65, 75, 85],
- age2 = [64, 74, 84, 94],
- urate = [0.51, 2.13, 6.34, 18.76],
- prate = [0.13, 0.62, 1.89, 6.85],
- ltlowm = [0.003340, 0.016001, 0.034618, 0.095062],
- lthighm = [0.015006, 0.031401, 0.085452, 0.238080],
- ltlowf = [0.001989, 0.009617, 0.024080, 0.072731],
- lthighf = [0.009031, 0.021714, 0.064863, 0.194973]
- )
- avg_age = mean([df.age1, df.age2])
- avg_low = 100*mean([df.ltlowm, df.ltlowf])
- avg_high = 100*mean([df.lthighm, df.lthighf])
- avg = mean([avg_low, avg_high])
- plot(avg_age, df.urate, label = "Unvaccinated", lw = 2, grid = "true",
- gridalpha = 0.25, background_color = "black")
- plot!(avg_age, df.prate, label = "Vaccinated", lw = 2)
- plot!(avg_age, avg_low, label = "Life Table Low", lw = 2, ls = :dash)
- plot!(avg_age, avg_high, label = "Life Table High", lw = 2, ls = :dash)
- plot!(avg_age, avg, label = "Life Table Avg", lw = 2, ls = :dot)
Advertisement
Add Comment
Please, Sign In to add comment