Learn R Programming

reproducer (version 0.5.2)

testfunctionParameterChecks: testfunctionParameterChecks

Description

This is a helper function that ensures parameter values used for performing special statistical tests are valid.

Usage

testfunctionParameterChecks(alternative, alpha, stderr)

Value

'Success' or an error message.

Arguments

alternative

The type of statistical test. Valid values are one of c('two.sided', 'greater', 'less')

alpha

The test level. Valid values are between 0.0001 and 0.2

stderr

The standard error of a parameter whose confidence intervals is to be calculated

Author

Barbara Kitchenham and Lech Madeyski

Examples

Run this code
#reproducer:::testfunctionParameterChecks(alternative='larger',alpha=0.1,stderr=0.002)
#Error in testfunctionParameterChecks(alternative = 'larger', alpha = 0.1) :
#  Invalid alternative parameter, choose one of two.sided, greater or less
reproducer:::testfunctionParameterChecks(alternative='greater',alpha=0.1,stderr=0.002)
#[1] 'Success'
#reproducer:::testfunctionParameterChecks(alternative='greater',alpha=0.1,stderr=0.000)
#Error in testfunctionParameterChecks(alternative = 'greater', alpha = 0.1,  :
#  Improbably small variance, data are essentially constant

Run the code above in your browser using DataLab