Description Usage Arguments Details Value Examples
Compute the nPx(A), C(A) proportions from a population of life histories
1 | nPxA(lifehistory)
|
lifehistory, |
a matrix with rows (sample individuals) and columns (outcome in year of life); see synthetic.pop return value |
computes the relevant nPx(A) and C(A): the probabilities of the various life trajectories, by age. See <doi:10.1098/rsif.2019.0234>, SI section II.A (Cost Benefit Equations: Definitions)
a data.frame
(data.table
, if available) with columns
integer; the reference year of life, from 1 to dim(lifehistory)[2]
numeric; probability of 0 lifetime infections
numeric; probability of 1 or more lifetime infections
numeric; probability of 2 or more lifetime infections
numeric; probability of 0 infections at age A, and 1 lifetime infection
numeric; probability of 0 infections at age A, and 1 or more lifetime infections
numeric; probability of 0 infections at age A, and 2 or more lifetime infections
numeric; probability of 1 infection at age A, and 1 or more lifetime infections
numeric; probability of 1 infection at age A, and 2 or more lifetime infections
numeric; probability of 1 or more infections at age A, and 1 or more lifetime infections
numeric; probability of 2 or more infections at age A, and 2 or more lifetime infections
numeric; probability of converting from seronegative to seropositive between age A and A+1
1 2 3 4 5 6 7 8 9 10 11 12 | 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)
m2010lh
with(m2010lh,
plot(A, p0_2p*100, type="l",
xlab="Age", ylab="%", ylim = c(0, 100),
main="Individuals w/ No Infections,\nbut that will have 2"
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.