| ova2nbc | R Documentation | 
A wrapper function for creating an nbc object with the parameters specified by the openVA package.
ova2nbc(symps.train, symps.test, causes.train, causes.table = NULL, ...)
symps.train | 
 Dataframe of verbal autopsy train data. 
 Example: 
  | ||||||||||||||||||||
symps.test | 
 Dataframe of verbal autopsy test data in the same format as symps.train. 
  | ||||||||||||||||||||
causes.train | 
 The train vector or column for the causes of death to use. 
  | ||||||||||||||||||||
causes.table | 
 Character list of unique causes to learn. 
  | ||||||||||||||||||||
... | 
 Additional arguments to be passed to avoid errors if necessary.  | 
nbc An nbc object with the following modifications:
$id (vectorof char): set to test data ids
$prob (matrixof numeric): set to a matrix of likelihood for each cause of death for the test cases
$CSMF (vectorof char): set to the predicted CSMFs with names for the corresponding causes
Li Z, McCormick T, Clark S. openVA: Automated Method for Verbal Autopsy [Internet]. 2016. [cited 2016 Apr 29]. Available from: https://cran.r-project.org/package=openVA
## Not run: 
library(openVA)  # install.packages("openVA")
library(nbc4va)
# Obtain some openVA formatted data
data(RandomVA3) # cols: deathId, cause, symptoms..
train <- RandomVA3[1:100, ]
test <- RandomVA3[101:200, ]
# Run naive bayes classifier on openVA data
results <- ova2nbc(train, test, "cause")
# Obtain the probabilities and predictions
prob <- results$prob.causes
pred <- results$pred.causes
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.