You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/build.R
  3. \name{desc_tests}
  4. \alias{desc_tests}
  5. \title{Add tests to a desc_table}
  6. \usage{
  7. desc_tests(desctable, .auto = tests_auto, .default = NULL, ...)
  8. }
  9. \arguments{
  10. \item{desctable}{A desc_table}
  11. \item{.auto}{A function to automatically determine the appropriate tests}
  12. \item{.default}{A default fallback test}
  13. \item{...}{A list of statistical tests associated to variable names}
  14. }
  15. \value{
  16. A desc_table with tests
  17. }
  18. \description{
  19. Add test statistics to a grouped desc_table, with the tests specified as \code{variable = test}.
  20. }
  21. \section{Tests}{
  22. The statistical test functions to use in the table are passed as additional named arguments. Tests must be preceded
  23. by a formula tilde (\code{~}).
  24. \code{name = ~test} will apply test \code{test} to variable \code{name}.
  25. Any R test function can be used, as long as it returns an object containing a \code{p.value} element, which is the
  26. case for most tests returning an object of class \code{htest}.
  27. Users can also use \code{purrr::map}-like formulas as quick anonymous functions (eg. \code{~ t.test(., var.equal = T)} to
  28. compute a t test without the Welch correction.
  29. }
  30. \examples{
  31. iris \%>\%
  32. group_by(Species) \%>\%
  33. desc_table() \%>\%
  34. desc_tests(Sepal.Length = ~kruskal.test,
  35. Sepal.Width = ~oneway.test,
  36. Petal.Length = ~oneway.test(., var.equal = T),
  37. Petal.Length = ~oneway.test(., var.equal = F))
  38. }
  39. \seealso{
  40. \code{\link{tests_auto}}
  41. \code{\link{no.test}}
  42. \code{\link{ANOVA}}
  43. Other desc_table core functions:
  44. \code{\link{desc_output}()},
  45. \code{\link{desc_table}()}
  46. }
  47. \concept{desc_table core functions}