New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apa_print for emmeans #200
Comments
Hi Andrei, absolutely! I have already started to implement support for |
- Strucutring factors are sparsed to safe ink. - Still needed: contrasts and pairwise comaprisons.
I'm currently focusing on implementing support for ANOVA models. As I'll try to track what's left to do for ANOVA here:
|
- Also, adds guessing of sensible estimate names
I think it would be sensible to use |
What's the update on this? It seems that those PRs have been merged in My specific request (let me know if you'd prefer this in a new issue) is to be able to use library(papaja)
#> Loading required package: tinylabels
library(emmeans)
fiber.lm <- lm(strength ~ diameter * machine, data = fiber)
emmeans_result <- emmeans(fiber.lm, ~machine)
#> NOTE: Results may be misleading due to involvement in interactions
apa_print(emmeans_result)
#> $estimate
#> $estimate$A
#> [1] "$M = 40.22$, 95\\% CI NA"
#>
#> $estimate$B
#> [1] "$M = 41.60$, 95\\% CI NA"
#>
#> $estimate$C
#> [1] "$M = 38.53$, 95\\% CI NA"
#>
#>
#> $statistic
#> $statistic$A
#> [1] "$t(9) = 51.76$, $p < .001$"
#>
#> $statistic$B
#> [1] "$t(9) = 48.50$, $p < .001$"
#>
#> $statistic$C
#> [1] "$t(9) = 39.88$, $p < .001$"
#>
#>
#> $full_result
#> $full_result$A
#> [1] "$M = 40.22$, 95\\% CI NA, $t(9) = 51.76$, $p < .001$"
#>
#> $full_result$B
#> [1] "$M = 41.60$, 95\\% CI NA, $t(9) = 48.50$, $p < .001$"
#>
#> $full_result$C
#> [1] "$M = 38.53$, 95\\% CI NA, $t(9) = 39.88$, $p < .001$"
#>
#>
#> $table
#> A data.frame with 5 labelled columns:
#>
#> machine estimate conf.int statistic p.value
#> A A 40.22 [38.46, 41.98] 51.76 < .001
#> B B 41.60 [39.66, 43.54] 48.50 < .001
#> C C 38.53 [36.35, 40.72] 39.88 < .001
#>
#> machine : machine
#> estimate : $M$
#> conf.int : 95\\% CI
#> statistic: $t(9)$
#> p.value : $p$
#> attr(,"class")
#> [1] "apa_results" "list"
emtrends_result <- emtrends(fiber.lm, ~machine, var = "diameter")
apa_print(emtrends_result)
#> Error in printnum.default(contrast_table$estimate, ...): The parameter 'x' is NULL. Please provide a value for 'x' Created on 2021-03-11 by the reprex package (v1.0.0) Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.0.2 (2020-06-22)
#> os macOS Mojave 10.14.6
#> system x86_64, darwin17.0
#> ui X11
#> language (EN)
#> collate en_GB.UTF-8
#> ctype en_GB.UTF-8
#> tz Australia/Sydney
#> date 2021-03-11
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date lib source
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
#> backports 1.2.1 2020-12-09 [1] CRAN (R 4.0.2)
#> cli 2.3.1 2021-02-23 [1] CRAN (R 4.0.2)
#> coda 0.19-4 2020-09-30 [1] CRAN (R 4.0.2)
#> crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.2)
#> debugme 1.1.0 2017-10-22 [1] CRAN (R 4.0.2)
#> digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.2)
#> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
#> emmeans * 1.5.4-09004 2021-03-11 [1] Github (rvlenth/emmeans@7815617)
#> estimability 1.3 2018-02-11 [1] CRAN (R 4.0.0)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
#> fansi 0.4.2 2021-01-15 [1] CRAN (R 4.0.2)
#> fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
#> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
#> highr 0.8 2019-03-20 [1] CRAN (R 4.0.0)
#> htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2)
#> knitr 1.31 2021-01-27 [1] CRAN (R 4.0.2)
#> lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.2)
#> lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.2)
#> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.2)
#> mvtnorm 1.1-1 2020-06-09 [1] CRAN (R 4.0.2)
#> papaja * 0.1.0.9997 2021-03-11 [1] Github (crsh/papaja@d3b39cb)
#> pillar 1.5.1 2021-03-05 [1] CRAN (R 4.0.2)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
#> plyr 1.8.6 2020-03-03 [1] CRAN (R 4.0.0)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.0)
#> Rcpp 1.0.6 2021-01-15 [1] CRAN (R 4.0.2)
#> reprex 1.0.0 2021-01-27 [1] CRAN (R 4.0.2)
#> rlang 0.4.10 2020-12-30 [1] CRAN (R 4.0.2)
#> rmarkdown 2.7.3 2021-03-11 [1] Github (rstudio/rmarkdown@61db7a9)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
#> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.2)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
#> styler 1.3.2 2020-02-23 [1] CRAN (R 4.0.0)
#> tibble 3.1.0 2021-02-25 [1] CRAN (R 4.0.2)
#> tinylabels * 0.2.0 2021-02-06 [1] CRAN (R 4.0.2)
#> utf8 1.1.4 2018-05-24 [1] CRAN (R 4.0.0)
#> vctrs 0.3.6 2020-12-17 [1] CRAN (R 4.0.2)
#> withr 2.4.1 2021-01-26 [1] CRAN (R 4.0.2)
#> xfun 0.21 2021-02-10 [1] CRAN (R 4.0.2)
#> xtable 1.8-4 2019-04-21 [1] CRAN (R 4.0.0)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.2)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library |
Hey! I got two bugs, which I think are independent from one another, but not sure!
a)
b)
I hope this helps and thanks a lot for your work! |
Hey @shirdekel, I found a kinda work-around to use Before passing the result of
Looking forwards for the professionals solving this one ;) |
Hi Mischa, thanks for sharing your workaround and for your patience. I think I will find time to tackle this issue soonish; it's on the very top of my priority list. |
- Name guessing for several link functions (see `est_name_from_call()`) - Support for z-Tests - Better formatting of levels of numeric predictors (see `utils.R`)
This is just a feature request, but I think there is great need for apa_print for the emmeans package.
The text was updated successfully, but these errors were encountered: