This (generic) function prints the LaTeX code of the results of a fit from
coxreg, phreg, tpchreg,
or aftreg, similar
to what xtable does for fits from other functions.
ltx( x, caption = NULL, label = NULL, dr = NULL, digits = max(options()$digits - 4, 3), ... )
| x | The output from a call to |
|---|---|
| caption | A suitable caption for the table. |
| label | A label used in the LaTeX code. |
| dr | Output from a |
| digits | Number of digits to be printed. |
| ... | Not used. |
LaTeX code version of the results from a run with
coxreg, phreg, phreg,
or aftreg.
The result is a printout which is (much) nicer than the standard printed
output from glm and friends,
There is no method in xtable for coxreg and
friends.
Göran Broström.
data(oldmort) fit <- coxreg(Surv(enter, exit, event) ~ civ + sex, data = oldmort) dr <- drop1(fit, test = "Chisq") ltx(fit, dr = dr, caption = "A test example.", label = "tab:test1")#> \begin{table}[ht] #> \caption{A test example.} #> \begin{center} #> \footnotesize #> \begin{tabular}{lrrrrr} #> \hline #> Covariate & Mean & Coef & Rel.Risk & S.E. & L-R p \\ \hline #> civ & & & & & 0.000 \\ #> \multicolumn{1}{r}{\em unmarried} & 0.080 & 0 & 1 & \multicolumn{2}{c}{(reference)} \\ #> \multicolumn{1}{r}{ \em married } & 0.530 & -0.397 & 0.672 & 0.081\\ #> \multicolumn{1}{r}{ \em widow } & 0.390 & -0.261 & 0.770 & 0.079\\ #> sex & & & & & 0.000 \\ #> \multicolumn{1}{r}{\em male} & 0.406 & 0 & 1 & \multicolumn{2}{c}{(reference)} \\ #> \multicolumn{1}{r}{ \em female } & 0.594 & -0.243 & 0.784 & 0.047\\ #> \hline #> Events & 1971 & TTR & 37824 \\ #> Max. Log Likelihood & -13558 \\ \hline #> \hline #> \end{tabular} #> \label{tab:test1} #> \normalsize #> \end{center} #> \end{table} #> #> #> #>