Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/356.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python texreg的RPy布尔值_Python_R_Rpy2_Texreg - Fatal编程技术网

Python texreg的RPy布尔值

Python texreg的RPy布尔值,python,r,rpy2,texreg,Python,R,Rpy2,Texreg,我正在使用打印R线性模型的LaTeX表。软件包的默认设置包括打印许多与我的分析无关的内容。幸运的是,这个软件包提供了开关来关闭很多东西 我通过反复试验发现,在R中设置为single.row=TRUE的东西可以在RPy中设置为single\u row=TRUE 正如您在my中所看到的,适用于单行,在随后的latex打印中,置信区间打印在与my值相同的行上 选项include_loglik和include_develance应控制是否打印日志可能性和偏差。因为我不是在比较模型,所以我不需要这些。我曾

我正在使用打印R线性模型的LaTeX表。软件包的默认设置包括打印许多与我的分析无关的内容。幸运的是,这个软件包提供了开关来关闭很多东西

我通过反复试验发现,在R中设置为
single.row=TRUE
的东西可以在RPy中设置为
single\u row=TRUE

正如您在my中所看到的,适用于
单行
,在随后的latex打印中,置信区间打印在与my值相同的行上

选项
include_loglik
include_develance
应控制是否打印日志可能性和偏差。因为我不是在比较模型,所以我不需要这些。我曾尝试通过许多不同的方法将它们设置为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
关闭这些开关吗?

这是因为这些命名参数没有在R函数
texreg::texreg
的签名中定义(这些参数通过省略号
传递…
),并且
rpy2
无法进行安全的转换尝试

我通过反复试验发现,在R中设置为single.row=TRUE的thisgs可以在RPy中设置为single\u row=TRUE

咨询文档是一个可供选择的选择。退房:

好的,所以“落在“…”中的参数需要将它们的R名称传递给构造函数”让我相信这项任务并非不可能。我已经尝试了建议的
**{'include.loglik':False}
,它成功了!请将此添加到您的帖子中,以便我可以批准它作为我的答案。