tadaa_z.test: Tadaa, z-test! No seriously.

Description Usage Arguments Value Examples

View source: R/tadaa_two_sample.R

Description

This is a wrapper around z.test, which in itself is a weird thing to use, but why not.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tadaa_z.test(
  data,
  x,
  y,
  sigma_x,
  sigma_y,
  direction = "two.sided",
  paired = FALSE,
  conf.level = 0.95,
  print = c("df", "console", "html", "markdown")
)

Arguments

data

A data.frame containing variables.

x, y

A bare name of a numeric variable in data.

sigma_x, sigma_y

Numeric. Known variances of x and y.

direction

Test direction, like alternative in t.test.

paired

If TRUE, a paired test is performed, defaults to 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 pixiedust::dust object or data.frame.

Examples

1
2
3
4
5
6
set.seed(192)
df <- data.frame(
  lefties = rnorm(10, mean = 5, sd = 2),
  righties = rnorm(10, mean = 5.5, sd = 2.5)
)
tadaa_z.test(data = df, x = lefties, y = righties, sigma_x = 2, sigma_y = 2.5, print = "console")

Example output

Table 1: **Two Sample z-test** with alternative hypothesis: $\mu_1 \neq \mu_2$

   Diff $\\mu_1$ lefties $\\mu_2$ righties     z   SE df   $CI_{95\\%}$     p
1 -1.51             4.88               6.4 -2.26 0.67 18 (-2.83 - -0.2) < .05
  Cohen\\'s d
1       -1.01

tadaatoolbox documentation built on July 2, 2020, 2:30 a.m.