tadaa_one_sample: Tadaa, one-sample tests!

Description Usage Arguments Value See Also Examples

View source: R/tadaa_one_sample.R

Description

If sigma is omitted, the function will just perform a one-sample stats::t.test, but if sigma is provided, a z-test is performed. It basically works the same way, except that we pretend we know the population sigma and use the normal distribution for comparison.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tadaa_one_sample(
  data = NULL,
  x,
  mu,
  sigma = NULL,
  direction = "two.sided",
  na.rm = FALSE,
  conf.level = 0.95,
  print = c("df", "console", "html", "markdown")
)

Arguments

data

A data.frame (optional).

x

A numeric vector or bare column name of data.

mu

The true mean (μ) to test for.

sigma

Population sigma. If supplied, a z-test is performed, otherwise a one-sample stats::t.test is performed.

direction

Test direction, like alternative in t.test.

na.rm

Whether to drop NA values. Default is FALSE.

conf.level

Confidence level used for power and CI, default is 0.95.

print

Print method, default df: A regular data.frame. Otherwise passed to pixiedust::sprinkle_print_method for fancyness.

Value

A data.frame by default, otherwise dust object, depending on print.

See Also

Other Tadaa-functions: tadaa_aov(), tadaa_chisq(), tadaa_kruskal(), tadaa_levene(), tadaa_nom(), tadaa_ord(), tadaa_pairwise_tukey(), tadaa_pairwise_t(), tadaa_t.test(), tadaa_wilcoxon()

Examples

1
2
3
4
5
6
7
set.seed(42)
df <- data.frame(x = rnorm(n = 20, mean = 100, sd = 1))

tadaa_one_sample(df, x, mu = 101, sigma = 1)

# No data.frame, just a vector
tadaa_one_sample(x = rnorm(20), mu = 0)

tadaadata/tadaatoolbox documentation built on June 3, 2020, 10:34 a.m.