readFormula(y~x+f(z),specials=c("f"),unspecified="g")
## suitable construction to serve cmprsk
qFun <- function(x){x^2}
## multiply X1 by time^2 and X2 by time:
readFormula(Hist(time,event)~cov2(X1,tf=qFun)+cov2(X2),
specials=c("cov2","cov1"),
specialArgumentNames=list("cov2"="tf"),
unspecified="cov1")
Run the code above in your browser using DataLab