Last chance! 50% off unlimited learning
Sale ends in
Creates a file containing a LaTeX representation of the fitted model.
# S3 method for cph
latex(object, title,
file='',
append=FALSE, surv=TRUE, maxt=FALSE, which=NULL, varnames, columns=65,
inline=FALSE, before=if(inline)"" else "& &", after="", dec=3,
pretrans=TRUE, caption, digits=.Options$digits, size="",
…) # for cph fit# S3 method for lrm
latex(object, title, file, append, which, varnames,
columns, inline, before, after, pretrans, caption,
digits=.Options$digits, size="", …) # for lrm fit
# S3 method for ols
latex(object, title, file, append, which, varnames,
columns, inline, before, after, pretrans, caption,
digits=.Options$digits, size="", …) # ols fit
# S3 method for orm
latex(object, title, file, append, which, varnames,
columns, inline, before, after, pretrans, caption,
digits=.Options$digits, size="", intercepts=nrp < 10, …) # for orm fit
# S3 method for pphsm
latex(object, title, file, append, which=NULL, varnames,
columns, inline, before, after, pretrans, caption,
digits=.Options$digits, size="", …) # pphsm fit
# S3 method for psm
latex(object, title, file, append, which=NULL, varnames,
columns, inline, before, after, pretrans, caption,
digits=.Options$digits, size="", …) # psm fit
a fit object created by a rms
fitting function.
ignored
see latex.default
. Defaults to
the console. When usinghtml/markdown, file
is ignored.
if surv=TRUE
was specified to cph
, the underlying survival
probabilities from object$surv.summary
will be placed in a table
unless surv=FALSE
.
if the maximum follow-up time in the data (object$maxtime
) exceeds the
last entry in object$surv.summary
, underlying survival estimates at
object$maxtime
will be added to the table if maxt=TRUE
.
see
latex.default
if not an empty string, added to end of markup if
inline=TRUE
a character string specifying a title for the equation to be centered and typeset in bold face. Default is no title.
see latexrms
a LaTeX size to use, without the slash. Default is the prevailing size
for orm
fits. Default is to print intercepts
if they are fewer than 10 in number. Set to TRUE
or
FALSE
to force.
ignored
the name of the created file, with class c("latex","file")
. This
object works with latex viewing and printing commands in Hmisc.
# NOT RUN {
units(ftime) <- "Day"
f <- cph(Surv(ftime, death) ~ rcs(age)+sex, surv=TRUE, time.inc=60)
w <- latex(f, file='f.tex') #Interprets fitted model and makes table of S0(t)
#for t=0,60,120,180,...
w #displays image, if viewer installed and file given above
latex(f) # send LaTeX code to the console for knitr
options(prType='html')
latex(f) # for use with knitr and R Markdown using MathJax
# }
Run the code above in your browser using DataLab