internalCheckNBCSummary: Check arguments for summary.nbc()

Description Usage Arguments Details Value See Also Examples

View source: R/nbc4va_validation.R

Description

Performs checks to ensure that the arguments passed to summary.nbc are correct. This function will perform automatic data type conversions, and display warnings when appropriate.

Usage

1
internalCheckNBCSummary(object, top = 5, id = NULL, csmfa.obs = NULL, ...)

Arguments

object

The result nbc object.

top

A number that produces top causes depending on id:

  • If (id is char): provide the top causes of the case by probability

  • If (id is NULL): provide the top causes by predicted Cause Specific Mortality Fractions (CSMF)

id

A character representing a case id in the test data.

csmfa.obs

A character vector of the true causes for calculating the CSMF accuracy.

...

Additional arguments to be passed if applicable

Details

The following checks are applied:

Value

out A list object containing the checked inputs:

See Also

Other validation functions: internalCheckNBC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(nbc4va)
data(nbc4vaData)

# Create an nbc
train <- nbc4vaData[1:50, ]
test <- nbc4vaData[51:100, ]
results <- nbc(train, test)

# Check the inputs before passing on to summary
checked <- nbc4va:::internalCheckNBCSummary(results, 5, "g85")
results <- checked$object
top <- checked$top
id <- checked$id
csmfa.obs <- checked$csmfa.obs

nbc4va documentation built on May 2, 2019, 1:42 p.m.