# NOT RUN {
require(denvax);
data(morrison2010) # has counts by age
fit <- with(morrison2010, serofit(sero=Seropositive, N=Number, age.min=Age))
m2010pop <- synthetic.pop(fit, runs = 10, popsize = 10) # small sample size for example run time
m2010lh <- nPxA(m2010pop)
rc <- ROIcoeffs(m2010lh, As=5:10, Ls=5)
pp <- par()
par(mfrow=c(1, 2))
rcs <- subset(rc, A==10 & L < 11)
with(rcs, plot(
L, aveTests, type="l",
xlab="Max # of Tests Allowed",
ylab="Ave # of Tests Administered",
main="Starting @ Age 10",
ylim=c(1, 3)
))
rcs <- subset(rc, A==5 & L < 11)
with(rcs, plot(
L, aveTests, type="l",
xlab="Max # of Tests Allowed",
ylab="",
main="Starting @ Age 5",
ylim=c(1, 3)
))
par(pp)
# }
Run the code above in your browser using DataLab