I'm impressed with the reported functionality of stargazer because it boasts flexibility with multiple model types. However, I can't seem to use stargazer to get latex table output with generalized additive models, even though the documentation states that it handle gam object types. Here's a MWE.
require(stargazer)
require(mgcv)
dat <- gamSim(1,n=400,dist="normal",scale=2)
b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
stargazer(b)
Here's the output specifying the error.
% Table created by StarGazer v.2.0.1 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Fri, Feb 08, 2013 - 10:29:39 AM
\begin{table}[htb] \centering
\caption{}
\footnotesize
\begin{tabular}{@{\extracolsep{5pt}}lc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{1}{c}{\textit{Dependent variable:}} \\
\cline{2-2}
\\[-1.8ex] & y \\
\cline{2-2}
\\[-1.8ex] & \textit{GAM} \\
& \textit{(continuous)} \\
\hline \\[-1.8ex]
s(x0).1Error: subscript out of bounds
I've tried this using different gam models and I get the same error. Has anyone had any luck creating latex tables using stargazer and gam? Am I missing something here or is this a bug?
Specs: R 2.14.2, just updated relevant packages.