proptests: proptests

View source: R/proptests.R

proptestsR Documentation

proptests

Description

proptests runs a bunch of modifications of the input parameters of proptest to generate all possible proportion tests. See under Details the detailed parameter values which are used. Note that not giving the parameter hyperloop will results in several hundered tests generated. Returned will be only the different tests with the first element is proptest. If only a specific element of a proptest is of interest then just give the name of the element in elem and then all proptests will be returned where elem is different.

Usage

proptests(proptest, elem = NULL, hyperloop = NULL)

Arguments

proptest

proptest: the base result from a valid t-test generated by proptest_num()

elem

character: element to extract (default: NULL)

hyperloop

named list: parameter values to run over (default: see above)

Details

The default hyperloop is

list(x           = c(proptest$x, proptest$n-proptest$x)
     pi0         = c(proptest$pi0, 1-proptest$pi0, proptest$x/proptest$n, 1-proptest$x/proptest$n)
     alpha       = unique(c(proptest$alpha, 0.01, 0.05, 0.1)),
     alternative = c("two.sided", "greater", "less")
   )

Value

list of proptest objects is returned

Examples

basetest  <- proptest_num(x=3, n=8, alternative="greater")
# vary the number of observations
hyperloop <- list(pi0 = c(basetest$pi0, 1-basetest$pi0, 
                          basetest$x/basetest$n, 1-basetest$x/basetest$n))
# return all different tests
tts       <- proptests(basetest, hyperloop=hyperloop)
# return all different random sampling functions
proptests(basetest, "X", hyperloop)

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