运行命令:
mat <- round(matrix(c(0.9, 0.89, 200, 0.045, 2.0), c(1, 5)), 4)
rownames(mat) <- "$y_{t-1}$"
colnames(mat) <- c("$R^2$", "$\\bar{R}^2$", "F-stat", "S.E.E", "DW")
print(xtable(mat), type="latex", sanitize.text.function = function(x){x})
出现这样的结果:
% latex table generated in R 2.14.0 by xtable 1.5-6 package
% Fri Jun 28 11:21:00 2013
\begin{table}[ht]
\begin{center}
\begin{tabular}{rrrrrr}
\hline
& $R^2$ & $\bar{R}^2$ & F-stat & S.E.E & DW \\
\hline
$y_{t-1}$ & 0.90 & 0.89 & 200.00 & 0.04 & 2.00 \\
\hline
\end{tabular}
\end{center}
\end{table}