如何更改papaja :: apa_print中的十进制标记?

发布于 2025-01-23 06:56:41 字数 951 浏览 2 评论 0原文

我想使用papaja :: apa_print()使我的报告更容易,但是我需要调整语言的APA样式适应的输出。这意味着显示领先的零并将逗号设置为十进制标记。大多数papaja函数的大多数不是问题,而是apa_print()并不是那么简单。

library(papaja)
model <- lm(Sepal.Length ~ Species, data = iris)
anova(model) |> apa_print(decimal.mark = ",", gt1 = TRUE)

这些选项应用于大多数输出​​,但不适用于p值和F-Ratios(至少在ANOVA中)。我认为它可能适用于输出的所有乳胶部分,但ETA方似乎还可以。我相信这可能是一个错误。那么我该如何处理呢?我应该将其报告为错误吗?输出的一部分供参考:

$estimate
$estimate$Species
[1] "$\\hat{\\eta}^2_G = 0,401$, 90\\% CI $[0,300, 0,485]$"


$statistic
$statistic$Species
[1] "$F(2, 147) = 49.16$, $p < .001$"


$full_result
$full_result$Species
[1] "$F(2, 147) = 49.16$, $p < .001$, $\\hat{\\eta}^2_G = 0,401$, 90\\% CI $[0,300, 0,485]$"


$table
A data.frame with 7 labelled columns:

     term estimate       conf.int statistic df df.residual p.value
1 Species    0,401 [0,300, 0,485]     49.16  2         147  < .001

I wanted to use papaja::apa_print() to make things easier in my report but I need to adjust the output for my language's APA style adaptation. It means displaying leading zeros and setting comma as the decimal mark. It's not a problem with most of papaja functions but with apa_print() is not that straightforward.

library(papaja)
model <- lm(Sepal.Length ~ Species, data = iris)
anova(model) |> apa_print(decimal.mark = ",", gt1 = TRUE)

The options are applied to most of the output but not to p-values and F-ratios (at least in ANOVA). I thought it might apply to all LaTeX parts of the output but eta-squared seems to be OK. I believe it might be a bug. So how do I deal with it? Should I report it as a bug? Part of the output for reference:

$estimate
$estimate$Species
[1] "$\\hat{\\eta}^2_G = 0,401$, 90\\% CI $[0,300, 0,485]
quot;


$statistic
$statistic$Species
[1] "$F(2, 147) = 49.16$, $p < .001
quot;


$full_result
$full_result$Species
[1] "$F(2, 147) = 49.16$, $p < .001$, $\\hat{\\eta}^2_G = 0,401$, 90\\% CI $[0,300, 0,485]
quot;


$table
A data.frame with 7 labelled columns:

     term estimate       conf.int statistic df df.residual p.value
1 Species    0,401 [0,300, 0,485]     49.16  2         147  < .001

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文