require(pscl)
summary(m1 <- zeroinfl(count ~ child + camper | persons, data = zinb))
Call:
zeroinfl(formula = count ~ child + camper | persons, data = zinb)
Pearson residuals:
Min 1Q Median 3Q Max
-1.2369 -0.7540 -0.6080 -0.1921 24.0847
Count model coefficients (poisson with log link):
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.59789 0.08554 18.680 <2e-16 ***
child -1.04284 0.09999 -10.430 <2e-16 ***
camper1 0.83402 0.09363 8.908 <2e-16 ***
Zero-inflation model coefficients (binomial with logit link):
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.2974 0.3739 3.470 0.000520 ***
persons -0.5643 0.1630 -3.463 0.000534 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Number of iterations in BFGS optimization: 12
Log-likelihood: -1032 on 5 Df
應用到模型對象的斯塔蓋澤的`結果可以被傳遞到一個乳膠 「容器」:
> stargazer(m1) # Latex is default but type="html" is also possible
# returns ------
% Table created by stargazer v.5.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Wed, Mar 02, 2016 - 12:37:08
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{1}{c}{\textit{Dependent variable:}} \\
\cline{2-2}
\\[-1.8ex] & count \\
\hline \\[-1.8ex]
child & $-$1.043$^{***}$ \\
& (0.100) \\
& \\
camper1 & 0.834$^{***}$ \\
& (0.094) \\
& \\
Constant & 1.598$^{***}$ \\
& (0.086) \\
& \\
\hline \\[-1.8ex]
Observations & 250 \\
Log Likelihood & $-$1,031.608 \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{1}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
\end{tabular}
\end{table}
在MacTEX都成功膠乳代碼:
\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
\begin{document}
\pagestyle{empty}
% Table created by stargazer v.5.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Wed, Mar 02, 2016 - 12:39:08
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{1}{c}{\textit{Dependent variable:}} \\
\cline{2-2}
\\[-1.8ex] & count \\
\hline \\[-1.8ex]
child & $-$1.043$^{***}$ \\
& (0.100) \\
& \\
camper1 & 0.834$^{***}$ \\
& (0.094) \\
& \\
Constant & 1.598$^{***}$ \\
& (0.086) \\
& \\
\hline \\[-1.8ex]
Observations & 250 \\
Log Likelihood & $-$1,031.608 \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{1}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
\end{tabular}
\end{table}
\end{document}
看看明星包。 –
也可能是'pkg:ReporteRs',看看https://cran.r-project.org/web/views/ReproducibleResearch.html –