I am using sweave in R-Studio and am attempting to use the R package apsrtable
. Both the model objects I am passing apsrtable
are lm
objects, and I get the error
illegal character in array arg
when I run sweave.
\documentclass{article}
\usepackage{fullpage}
\begin{document}
<<results=tex>>=
apsrtable(mod.um,mod.km, Sweave=TRUE)
@
Here is the LaTeX code apsrtable
generates
\begin{tabular}{ l D{.}{.}{2}D{.}{.}{2} }
\hline
& \multicolumn{ 1 }{ c }{ Model 1 } & \multicolumn{ 1 }{ c }{ Model 2 } \\ \hline
% & Model 1 & Model 2\\
(Intercept) & -0.06 & -0.05 \\
& (0.12) & (0.12) \\
lag1.x & 3.28 ^* & 0.25 \\
& (0.42) & (0.67) \\
lag2.x & 2.31 ^* & \\
& (0.42) & \\
lag3.x & 0.86 ^* & \\
& (0.42) & \\
lag4.x & 0.77 & \\
& (0.42) & \\
lag5.x & 1.60 ^* & \\
& (0.42) & \\
lag.y & & 0.62 ^*\\
& & (0.10) \\
$N$ & 145 & 149 \\
$R^2$ & 0.47 & 0.42 \\
adj. $R^2$ & 0.45 & 0.41 \\
Resid. sd & 1.44 & 1.49 \\ \hline
\multicolumn{3}{l}{\footnotesize{Standard errors in parentheses}}\\
\multicolumn{3}{l}{\footnotesize{$^*$ indicates significance at $p< 0.05 $}}
\end{tabular}
\end{document}
Best Answer
insert into the preamble: