Learn R Programming

elect (version 1.2)

check.RestrAndConst: Checking the definition of RestrAndConst in elect

Description

Function to check the definition of RestrAndConst in the elect call.

Usage

check.RestrAndConst(x, RestrAndConst, PRINT = FALSE)

Arguments

x

Fitted msm model

RestrAndConst

Vector which indexes the independent parameters in model\$opt\$par w.r.t. to the model parameters

PRINT

TRUE for printing the comparison

Value

TRUE when RestrAndConst is well-defined, FALSE otherwise.

Details

Function to help defining the parameter constraints in the elect call\ when the constraint option is used in msm.

See Also

elect

Examples

Run this code
# NOT RUN {
# Fit model with constraints:
Q     <- rbind(c(0,0.01,0.01), c(0,0,0.01), c(0,0,0))
model <- msm(state~age, subject = id, data = electData,
             center = FALSE, qmatrix = Q, deathexact = TRUE,
             fixedpars = c(7,8), covariates = ~age+x)
RestrAndConst <- c(1:6,0,0,7)
check.RestrAndConst(model, RestrAndConst, PRINT= TRUE)

# Usage: elect(x = model,..., RestrAndConst = RestrAndConst)
# }

Run the code above in your browser using DataLab