infer_ts_prop_test: Two Sample Test of Proportion

Description Usage Arguments Value Deprecated Functions References See Also Examples

View source: R/ifr-ts-prop-test.R

Description

Tests on the equality of proportions using large-sample statistics. It tests that a sample has the same proportion within two independent groups or two samples have the same proportion.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
infer_ts_prop_test(
  data,
  var1,
  var2,
  alternative = c("both", "less", "greater", "all"),
  ...
)

infer_ts_prop_group(
  data,
  var,
  group,
  alternative = c("both", "less", "greater", "all")
)

infer_ts_prop_calc(
  n1,
  n2,
  p1,
  p2,
  alternative = c("both", "less", "greater", "all"),
  ...
)

Arguments

data

a data.frame or tibble

var1

factor; column in data

var2

factor; column in data

alternative

a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter

...

additional arguments passed to or from other methods

n1

sample 1 size

n2

sample 2 size

p1

sample 1 proportion

p2

sample 2 proportion

var

factor; column in data

group

factor; column in data

Value

an object of class "infer_ts_prop_test". An object of class "infer_ts_prop_test" is a list containing the following components:

n1

sample 1 size

n2

sample 2 size

phat1

sample 1 proportion

phat2

sample 2 proportion

z

z statistic

sig

p-value for z statistic

alt

alternative hypothesis

Deprecated Functions

infer_ts_prop_test(), infer_ts_prop_grp() and infer_ts_prop_calc() have been deprecated. Instead use infer_ts_prop_test(), infer_ts_prop_group() and infer_ts_prop_calc().

References

Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.

See Also

prop.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# using variables
# lower tail
infer_ts_prop_test(treatment, treatment1, treatment2,
alternative = 'less')

# using groups
# lower tail
infer_ts_prop_group(treatment2, outcome, female,
alternative = 'less')

# using sample size and proportions
# lower tail
infer_ts_prop_calc(n1 = 30, n2 = 25, p1 = 0.3, p2 = 0.5, alternative = 'less')

inferr documentation built on May 29, 2021, 1:07 a.m.