Learn R Programming

vacem (version 0.1-1)

sim.n.vacc.sample.pop: Calculates the number of vaccinations each member of a sample population...

Description

Calculates the number of vaccinations each member of a sample population would receive based upon probabilities generated from the campaigns descriptions and provided the @p rho and @p alpha values.

Usage

sim.n.vacc.sample.pop(obs, camps, rho, alpha, cond.on.accessible=FALSE, z, w, cdf.fun, ...)

Arguments

obs
the synthetic population, i.e. a data frame with one row per observation and columns for @c date of observation and @c age of individual on that date; Note: all ages should be in months
camps
a data frame with one row per activity and columns providing the activity's @c date, targeted age range (@c age.low and @c age.high), size of targeted population (@c N) and the number of vaccine doses nominally distributed (@c v)
rho
the proportion of the population (scalar) that can be vaccinated, i.e @code1 - rho is the @e inaccessible portion of the general population.
alpha
the vaccination efficiency parameter (scalar) for the campaign; @codealpha = -inf implies perfect efficiency, @codealpha = 0 implies random efficiency; see note above
cond.on.accessible
a flag indicating whether the probabilities should be conditioned on the individual's inclusion in the accessible population, i.e. @p rho; the default is @c FALSE
z
the eligibility matrix for each individual/campaign pairing, i.e. @codez[i,j] = 1 if this individual @c i is eligible for campaign @c j, otherwise @codez[i,j] = 0; Note: if @c z is @c NULL, then the eligibilty matrix is calculated from @p obs and @p camps parameters using @code z.matrix function.
w
the weight matrix for each individual/campaign pairing, i.e. @code w[i,k] gives the probability of individual @c i receiving a routine vaccination in year @c k Note: if @c w is @c NULL, then the weight matrix is calculated from @p obs, @p camps, @p cdf.fun and @p ... parameters using @code w.matrix function.
cdf.fun
a cumulative distribution function (CDF) used to calculate the probability of routine vaccination based upon age, e.g. @code constant.post.9mo . Note: this parameter is only required if the weight matrix, @p w, is not provided.
...
any additional arguments to the @p cdf.fun, e.g. @c lambda Note: this parameter is only required if the weight matrix, @p w, is not provided.

Value

in observation set, @p obs, would have received@see z.matrix @see w.matrix @see nine.month.pointmass @see constant.post.9mo @see get.win.smooth.expected.mcmcres @see get.win.smooth.thresh.mcmcres

Details

TBD: Add details

Examples

Run this code
dates <- as.Date( c( "2005-05-01", "2007-07-02", "2009-09-03" ) )
sample.obs   <- make.sample.pop( N=N, age.low=0, age.high=25,
date=array(dates,dim=N) )
sample.camps <- data.frame( date=(dates - 3*DAYS.PER.MONTH),
N=(0.5*N), v=(0.5*N),
age.low=8, age.high=20, is.SIA=1 )

sim.n.vacc.sample.pop( sample.obs, sample.camps, rho=0.9, alpha=0,
cdf.fun=nine.month.pointmass )

Run the code above in your browser using DataLab