gpt4 book ai didi

R:LaTex 的 t.test 输出

转载 作者:行者123 更新时间:2023-12-02 13:12:23 25 4
gpt4 key购买 nike

我想知道是否有任何函数可以将t.test的输出重定向到LaTeX。像这样的事情

library(xtable)
xtable(t.test(extra ~ group, data = sleep))

最佳答案

这样就可以了。

library(schoRsch)
library(xtable)

T.Test <- t.test(extra ~ group, data = sleep)
xtable(
t_out(toutput=T.Test, n.equal = TRUE, welch.df.exact = TRUE, welch.n = NA,
d.corr = TRUE, print = TRUE)
)



Test Results
1 Welch Two Sample t-test: t(17.78) = -1.86, p = .079, d = NA
% latex table generated in R 3.1.1 by xtable 1.7-3 package
% Mon Aug 25 21:01:13 2014
\begin{table}[ht]
\centering
\begin{tabular}{rll}
\hline
& Test & Results \\
\hline
1 & Welch Two Sample t-test: & t(17.78) = -1.86, p = .079, d = NA \\
\hline
\end{tabular}
\end{table}

关于R:LaTex 的 t.test 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21510933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com