【发布时间】:2013-11-16 13:09:37
【问题描述】:
我正在使用texreg package 为我的 R 线性模型打印 LaTeX 表格。软件包的默认设置包括打印许多与我的分析无关的内容。幸运的是,该软件包提供了关闭许多功能的开关。
我通过反复试验发现,在 R 中设置为 single.row=TRUE 的东西可以在 RPy 中设置为 single_row=True。
正如您在我的 notebook example here 中看到的那样,它适用于 single_row,并且在随后的乳胶打印中,置信区间与我的值打印在同一行。
选项include_loglik 和include_deviance 应该控制是否打印对数似然和偏差。因为我不比较模型,所以我不需要这些。我尝试通过多种不同的方法将它们设置为 false,但它不起作用。
显然,一切都在纯 R 中完美运行:
> texreg(lm, include.deviance=FALSE, include.loglik=FALSE)
Computing profile confidence intervals ...
Computing confidence intervals at a confidence level of 0.95. Use argument "method = 'boot'" for bootstrapped CIs.
\begin{table}
\begin{center}
\begin{tabular}{l c }
\hline
& Model 1 \\
\hline
(Intercept) & $1.85^{*}$ \\
& $[1.60;\ 2.10]$ \\
COIem-hard & $0.54^{*}$ \\
& $[0.38;\ 0.69]$ \\
COIsc-10 & $0.19^{*}$ \\
& $[0.03;\ 0.34]$ \\
COIsc-14 & $-0.04$ \\
& $[-0.20;\ 0.11]$ \\
COIsc-18 & $-0.04$ \\
& $[-0.20;\ 0.12]$ \\
COIsc-22 & $-0.01$ \\
& $[-0.16;\ 0.15]$ \\
COIsc-26 & $-0.13$ \\
& $[-0.29;\ 0.02]$ \\
COIsc-6 & $0.64^{*}$ \\
& $[0.48;\ 0.79]$ \\
\hline
AIC & 2342.49 \\
BIC & 2392.70 \\
Num. obs. & 1120 \\
Num. groups: ID & 7 \\
Variance: ID.(Intercept) & 0.08 \\
Variance: Residual & 0.45 \\
\hline
\multicolumn{2}{l}{\scriptsize{$^*$ 0 outside the confidence interval}}
\end{tabular}
\caption{Statistical models}
\label{table:coefficients}
\end{center}
\end{table}
您能帮我通过RPy 关闭这些开关吗?
【问题讨论】: