mcwr_expectancies {mcwr}R Documentation

Calculate expectancies

Description

Calculate state and overall expectancies. This is the function that does the actual calculations.

Usage

mcwr_expectancies(data, initprop = NULL, vllmap = NULL, ...)

Arguments

data

an mcwr data.frame

initprop

a numeric vector. It supplies information about the initial state fractions at baseline age. Its elements must be in the interval [0 1] and sum to 1. It must have element names corresponding to all from-states in the model, in ascending order. For example, If your model contains from-states 1, 2, and 7, initspec must be a 3-element numeric vector, specifying the initial proportion of each state in turn. Its names attribute must consist of the sequential from-states ('1 2 7' in the above example).

vllmap

a numeric vector. Its elements must have the from-states of the model as a subset. If elements of the vector have names, they are used in labelling output.

...

options timing, add, and replace. See mcwr_genvars.

In most cases, you do not have to create a full set of r-variables using function mcwr_genvars(). r-variables that correspond to timings that can be accommodated by the timing option can be created automatically, behind the scenes. You do so by specifying the timing option in function expectancies instead in the function genvars. Any missing r-variables (and p-variables, for that matter) will then be created behind the scenes before calculations are done. They will get deleted before the function concludes.

r-variables with more complicated timings have to be created explicitly before running function mcwr_expectancies().

Value

a list of matrices that have been involved in the calculations. Matrix names are e, P, F, R#. Matrix e contains the overall results.

See Also

Other mcwr: mcwr_check(), mcwr_exit(), mcwr_genvars(), mcwr_switch()


[Package mcwr version 1.0.0 Index]