Learn R Programming

GUIgems (version 0.1)

makeM: makeM

Description

Builds hazard function matrix based on the hazard function names matrix. If some function is not defined, the name itself is copied to M matrix.

Usage

makeM(hfNames)

Arguments

hfNames
- a matrix with names of hazard functions. One can use predefined function names: "Impossible", "Exponential", "Weibull", "MultWeibull"

Value

matrix M generated by generateHazardMatrix with hazard functions, which names are in hfNames matrix.

Examples

Run this code
hfNames <- array(rep("Exponential", 36), dim = c(6,6))
hfNames[3,4:5] <-  rep("impossible",2)
hfNames[1:4,6] <- rep("sr.fun", 4)
hfNames[2, 4:5] <- rep("treat.fun", 2)
hfNames[col(hfNames)<=row(hfNames)]<-"NULL"
M <- makeM(hfNames)

Run the code above in your browser using DataLab