[R] multinom and stargazer
jjgrover
jjgrover at bsu.edu
Sun Jan 20 23:12:17 CET 2013
I am trying to create a LaTex table based on a multinom (nnet) object using
the stargazer command.
I have created a small data frame to demonstration the problem:
data <- data.frame(age=1:21, hight=20:40,
ed=c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3))
data$ed <- as.factor(data$ed)
I then make a multinomial model using the command multinom from the nnet
package:
model <- multinom(ed ~ age + hight, data=data)
summary(model, Wald=TRUE)
However, when I attempt to use the stargazer command (from the stargazer
package) I get the following result:
stargazer(model)
% Table created by StarGazer v.2.0.1 by Marek Hlavac, Harvard University.
E-mail: hlavac at fas.harvard.edu
% Date and time: Sun, Jan 20, 2013 - 17:08:45
\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] & ed \\
\cline{2-2}
\\[-1.8ex] & \textit{multinomial log-linear} \\
& \textit{(neural networks)} \\
\hline \\[-1.8ex]
age
Error: subscript out of bounds
In other threads the "Error: subscript out of bounds" is related to a
subsetting problem. Something about the program trying to fit 100 elements
into 50 slots.
Since I am unsure of the process stargazer is using to create the table (or
even what the table is supposed to look like in the end) I don't know where
to start looking for errors. I am also still new to LaTex and R.
Any help would be greatly appreciated.
Thanks,
Joe
--
View this message in context: http://r.789695.n4.nabble.com/multinom-and-stargazer-tp4656117.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list