Learn R Programming

riskRegression (version 1.4.3)

model.matrix.phreg: Extract design matrix for phreg objects

Description

Extract design matrix for phreg objects

Usage

# S3 method for phreg
model.matrix(object, data)

Arguments

object

a phreg object.

data

a dataset.

Details

mainly a copy paste of the begining of the phreg function.

Examples

Run this code
# NOT RUN {
library(mets)

n <- 10;
d <- mets:::simCox(n); d$id <- seq(nrow(d)); d$group <- factor(rbinom(nrow(d),1,0.5))
m1 <- phreg(Surv(entry, time,status)~X1+X2+cluster(id)+strata(group),data=d)
riskRegression:::model.matrix(m1, d) 
# }

Run the code above in your browser using DataLab