proptest_data: proptest_data

View source: R/proptest_data.R

proptest_dataR Documentation

proptest_data

Description

Creates data for a Binomial test based on the properties for the test.

Usage

proptest_data(
  size = 10:100,
  prob = seq(0.05, 0.45, by = 0.05),
  reject = TRUE,
  alternative = c("two.sided", "less", "greater"),
  alpha = c(0.01, 0.05, 0.1),
  norm.approx = NA,
  maxit = 1000
)

Arguments

size

numeric: vector of sample sizes (default 10:100)

prob

numeric: vector of probabilities for the hypothetical proportion \pi_0 (default =seq(0.05, 0.45, by=0.05))

reject

logical: should x generated lead to a rejection of the null hypothesis (default TRUE), if equals NA then this will be igenored

alternative

character: a character string specifying the alternative hypothesis, must be one of two.sided (default), greater or less

alpha

numeric: vector of significance levels (default c(0.01, 0.05, 0.1))

norm.approx

logical: should a normal approximation possible (size*prob*(1-prob)>9)

maxit

integer: maximal numbers of trials to find a solution (default 1000)

Value

a list with the components:

  • pi0 hypothetical proportion,

  • x counts of successes in the sample,

  • n sample size,

  • alpha significance level, and

  • alternative specifying the alternative hypothesis (either two.sided, greater or less).

Examples

proptest_data()

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.