mcwr_genvars {mcwr} | R Documentation |
Generate mcwr variables
Description
Generate (additional) transition probability or rewards variables
Usage
mcwr_genvars(
data,
timing = "",
add = FALSE,
replace = FALSE,
nop = FALSE,
nor = FALSE,
order = FALSE
)
Arguments
data |
an mcwr data.frame |
timing |
a character or numeric scalar.
It specifies how rewards are distributed to from and target states. It is
required if option |
add |
a boolean TRUE/FALSE. If TRUE, existing r-variables are left unchanged. |
replace |
add a boolean TRUE/FALSE. If TRUE, existing r-variables are replaced. |
nop |
a boolean TRUE/FALSE. If TRUE, not generate any p-variables.
By default, all missing p-variables are generated. Since existing
p-variables must satisfy the sums-to-unity condition, only p-variables that are (by implication)
all-zero can be missing. |
nor |
a boolean TRUE/FALSE. If TRUE, does not generate any r-variables. |
order |
a boolean TRUE/FALSE. If TRUE, orders variables alphabetically according to the column list 'age p* r*'. |
Details
The main purpose of this function is to generate rewards variables (r-variables). It examines existing p- and r-variables, determines the implied full set of states, and generates any missing variables that are missing from the data frame. It interacts flexibly with existing r-variables: You can leave them unchanged or have them replaced.
An effective way to create r-variables may be to generate a full set of r-variables using mcwr_genvars()
and
then edit them where necessary. This is illustrated under in the examples section of mcwr.
Value
A data.frame, suitable for further processing by mcwr_*()
functions.
See Also
Other mcwr:
mcwr_check()
,
mcwr_exit()
,
mcwr_expectancies()
,
mcwr_switch()