Title: | Replicate and Analyse 'InterVA4' |
---|---|
Description: | Provides an R version of the 'InterVA4' software (<http://www.interva.net>) for coding cause of death from verbal autopsies. It also provides simple graphical representation of individual and population level statistics. |
Authors: | Zehang Richard Li, Tyler McCormick, Sam Clark, Peter Byass |
Maintainer: | Zehang Richard Li <[email protected]> |
License: | GPL-3 |
Version: | 1.7.6 |
Built: | 2025-03-11 04:30:44 UTC |
Source: | https://github.com/verbal-autopsy-software/interva4 |
Computes individual cause of death and population cause-specific mortality fractions using the InterVA4 algorithm. Provides a simple graphical representation of the result.
To get the most up-to-date version of the package, as well as the past versions, please check the github repository at: https://github.com/richardli/InterVA4/
Package: | InterVA4 |
Type: | Package |
Version: | 1.6 |
Date: | 2015-08-29 |
License: | GPL-2 |
Zehang Li, Tyler McCormick, Sam Clark
Maintainer: Zehang Li <[email protected]>
http://www.interva.net/
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE)
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE)
This is the translation of COD abbreviation codes into their corresponding full names.
A data frame with the translation of COD codes to their names on 68 CODs (both the version of COD only and COD with group code).
data(causetext)
data(causetext)
The function takes input of a list of va object and produces a summary plot for the population distribution.
CSMF(va, top.aggregate = NULL, InterVA.rule = FALSE, noplot = FALSE, type = "bar", top.plot = 10, min.prob = 0, ...)
CSMF(va, top.aggregate = NULL, InterVA.rule = FALSE, noplot = FALSE, type = "bar", top.plot = 10, min.prob = 0, ...)
va |
The list of va object to summarize. |
top.aggregate |
Integer indicating how many causes from the top need to go into
summary. The rest of the probabilities goes into an extra category
"Undetermined". When set to NULL, default is all causes to be considered.
This is only used when |
InterVA.rule |
If it is set to "TRUE", only the top 3 causes reported by InterVA4 is calculated into CSMF as in InterVA4. The rest of probabilities goes into an extra category "Undetermined". Default set to "FALSE". |
noplot |
A logical value indicating whether the plot will be shown. If it is set to "TRUE", only the CSMF will be returned. |
type |
An indicator of the type of chart to plot. "pie" for pie chart; "bar" for bar chart. |
top.plot |
the maximum number of causes to plot in bar plot |
min.prob |
The minimum probability that is to be plotted in bar chart, or to be labeled in pie chart. |
... |
Arguments to be passed to/from graphic function
|
dist.cod |
The population probability of CODs. |
Zehang LI, Tyler McCormick, Sam Clark
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Get CSMF without plots population.summary <- CSMF(sample.output$VA, noplot = TRUE) ## Get CSMF by considering only top 3 causes for each death. population.summary <- CSMF(sample.output$VA, top.aggregate = 3, noplot = TRUE) ## Get CSMF by considering only top 3 causes reported by InterVA. ## This is equivalent to using CSMF.interVA4() command Note that ## it's different from using all top 3 causses, since they may not ## all be reported CSMF.summary <- CSMF(sample.output, InterVA.rule = TRUE, noplot = TRUE) ## Population level summary using pie chart CSMF.summary2 <- CSMF(sample.output, type = "pie", min.prob = 0.01, main = "population COD distribution using pie chart", clockwise = FALSE, radius = 0.7, cex = 0.7, cex.main = 0.8) ## Population level summary using bar chart CSMF.summary3 <- CSMF(sample.output, type = "bar", min.prob = 0.01, main = "population COD distribution using bar chart", cex.main = 1) CSMF.summary4 <- CSMF(sample.output, type = "bar", top.plot = 5, main = "Top 5 population COD distribution", cex.main = 1)
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Get CSMF without plots population.summary <- CSMF(sample.output$VA, noplot = TRUE) ## Get CSMF by considering only top 3 causes for each death. population.summary <- CSMF(sample.output$VA, top.aggregate = 3, noplot = TRUE) ## Get CSMF by considering only top 3 causes reported by InterVA. ## This is equivalent to using CSMF.interVA4() command Note that ## it's different from using all top 3 causses, since they may not ## all be reported CSMF.summary <- CSMF(sample.output, InterVA.rule = TRUE, noplot = TRUE) ## Population level summary using pie chart CSMF.summary2 <- CSMF(sample.output, type = "pie", min.prob = 0.01, main = "population COD distribution using pie chart", clockwise = FALSE, radius = 0.7, cex = 0.7, cex.main = 0.8) ## Population level summary using bar chart CSMF.summary3 <- CSMF(sample.output, type = "bar", min.prob = 0.01, main = "population COD distribution using bar chart", cex.main = 1) CSMF.summary4 <- CSMF(sample.output, type = "bar", top.plot = 5, main = "Top 5 population COD distribution", cex.main = 1)
The function takes input of a list of va object and calculates the cause-specific mortality fraction. It only calculates CSMF as aggregation of up to the third largest causes.
CSMF.interVA4(va)
CSMF.interVA4(va)
va |
The list of va object to summarize. |
dist.cod |
The cause-specific mortality fraction (including undetermined category). |
Zehang LI, Tyler McCormick, Sam Clark
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Get CSMF without plots csmf<- CSMF.interVA4(sample.output$VA) data(SampleInput)
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Get CSMF without plots csmf<- CSMF.interVA4(sample.output$VA) data(SampleInput)
This function implements the algorithm in the InterVA4 software. It produces individual cause of death and population cause-specific mortality fractions.
InterVA(Input, HIV, Malaria, directory = NULL, filename = "VA_result", output = "classic", append = FALSE, groupcode = FALSE, replicate = FALSE, replicate.bug1 = FALSE, replicate.bug2 = FALSE, write = TRUE, ...)
InterVA(Input, HIV, Malaria, directory = NULL, filename = "VA_result", output = "classic", append = FALSE, groupcode = FALSE, replicate = FALSE, replicate.bug1 = FALSE, replicate.bug2 = FALSE, write = TRUE, ...)
Input |
A matrix input, or data read from csv files in the same format as required by InterVA4. Sample input is included as data(SampleInput). |
HIV |
An indicator of the level of prevalence of HIV. The input should be one of the following: "h"(high),"l"(low), or "v"(very low). |
Malaria |
An indicator of the level of prevalence of Malaria. The input should be one of the following: "h"(high),"l"(low), or "v"(very low). |
directory |
The directory to store the output from InterVA4. It should either be an existing valid directory, or a new folder to be created. If no path is given, the current working directory will be used. |
filename |
The filename the user wish to save the output. No extension needed. The output is in .csv format by default. |
output |
"classic": The same deliminated output format as InterVA4; or "extended": deliminated output followed by full distribution of cause of death proability. |
append |
A logical value indicating whether or not the new output should be appended to the existing file. |
groupcode |
A logical value indicating whether or not the group code will be included in the output causes. |
replicate |
A logical value indicating whether or not the calculation should replicate original InterVA4 software (version 4.02) exactly. If replicate = F, causes with small probability are not dropped out of calculation in intermediate steps, and a possible bug in original InterVA4 implementation is fixed. If replicate=T, then the output values will be exactly as they would be from calling the InterVA4 program (version 4.02). If replicate=F, the output values will be the same as calling the InterVA4 program (version 4.03). Since version 1.7.3, setting replicate to be FALSE also includes changes to data checking rules and pre-set conditional probabilities to be the same as the official version 4.03 software. Since version 1.6, two control variables are added to control the two bugs respectively. Setting this to TRUE will overwrite both to TRUE. |
replicate.bug1 |
This logical indicator controls whether or not the bug in InterVA4.2 involving the symptom "skin_les" will be replicated or not. It is suggested to set to FALSE. |
replicate.bug2 |
This logical indicator controls whether the causes with small probability are dropped out of calculation in intermediate steps or not. It is suggested to set to FALSE. |
write |
A logical value indicating whether or not the output (including errors and warnings) will be saved to file. |
... |
not used |
InterVA performs the same tasks as the InterVA4. The output is saved in a .csv file specified by user. The calculation is based on the conditional and prior distribution of 68 CODs. The function also could save the full probability distibution of each individual to file. All information about each individual is saved to a va class object.
Be careful if the input file does not match InterVA input format strictly. The function will run normally as long as the number of symptoms are correct. Any inconsistent symptom names will be printed in console as warning. If there's wrong match of symptom from warning, please change in the input to correct orders.
ID |
identifier from batch (input) file |
MALPREV |
selected malaria prevalence |
HIVPREV |
selected HIV prevalence |
PREGSTAT |
most likely pregnancy status |
PREGLIK |
likelihood of PREGSTAT |
PRMAT |
likelihood of maternal death |
INDET |
indeterminate outcome |
CAUSE1 |
most likely cause |
LIK1 |
likelihood of 1st cause |
CAUSE2 |
second likely cause |
LIK2 |
likelihood of 2nd cause |
CAUSE3 |
third likely cause |
LIK3 |
likelihood of 3rd cause |
wholeprob |
full distribution of causes of death |
Zehang Li, Tyler McCormick, Sam Clark
http://www.interva.net/
data(SampleInput) ## to get easy-to-read version of causes of death make sure the column ## orders match interVA4 standard input this can be monitored by checking ## the warnings of column names sample.output1 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE) ## to get causes of death with group code for further usage sample.output2 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE, groupcode = TRUE)
data(SampleInput) ## to get easy-to-read version of causes of death make sure the column ## orders match interVA4 standard input this can be monitored by checking ## the warnings of column names sample.output1 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE) ## to get causes of death with group code for further usage sample.output2 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE, groupcode = TRUE)
The function takes input of a single va object and produces a summary plot for it.
InterVA.plot(va, type = "bar", min.prob = 0.01, ...)
InterVA.plot(va, type = "bar", min.prob = 0.01, ...)
va |
A va object |
type |
An indicator of the type of chart to plot. "pie" for pie chart; "bar" for bar chart. |
min.prob |
The minimum probability that is to be plotted in bar chart, or to be labeled in pie chart. |
... |
Arguments to be passed to/from graphic function
|
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Individual level summary using pie chart InterVA.plot(sample.output$VA[[7]], type = "pie", min.prob = 0.01, main = "1st sample VA analysis using pie chart", clockwise = FALSE, radius = 0.6, cex = 0.6, cex.main = 0.8) ## Individual level summary using bar chart InterVA.plot(sample.output$VA[[7]], type = "bar", min.prob = 0.01, main = "2nd sample VA analysis using bar chart", cex.main = 0.8)
data(SampleInput) sample.output <- InterVA(SampleInput, HIV = "h", Malaria = "v", write=FALSE) ## Individual level summary using pie chart InterVA.plot(sample.output$VA[[7]], type = "pie", min.prob = 0.01, main = "1st sample VA analysis using pie chart", clockwise = FALSE, radius = 0.6, cex = 0.6, cex.main = 0.8) ## Individual level summary using bar chart InterVA.plot(sample.output$VA[[7]], type = "bar", min.prob = 0.01, main = "2nd sample VA analysis using bar chart", cex.main = 0.8)
This function has been deprecated as of version 1.6. Use 'CSMF' instead.
Population.summary(va, top.aggregate = NULL, InterVA.rule = FALSE, noplot = FALSE, type = "bar", min.prob = 0.01, ...)
Population.summary(va, top.aggregate = NULL, InterVA.rule = FALSE, noplot = FALSE, type = "bar", min.prob = 0.01, ...)
va |
The list of va object to summarize. |
top.aggregate |
Integer indicating how many causes from the top need to go into
summary. The rest of the probabilities goes into an extra category
"Undetermined". When set to NULL, default is all causes to be considered.
This is only used when |
InterVA.rule |
If it is set to "TRUE", only the top 3 causes reported by InterVA4 is calculated into CSMF as in InterVA4. The rest of probabilities goes into an extra category "Undetermined". Default set to "FALSE". |
noplot |
A logical value indicating whether the plot will be shown. If it is set to "TRUE", only the CSMF will be returned. |
type |
An indicator of the type of chart to plot. "pie" for pie chart; "bar" for bar chart. |
min.prob |
The minimum probability that is to be plotted in bar chart, or to be labeled in pie chart. |
... |
Arguments to be passed to/from graphic function
|
dist.cod |
The population probability of CODs. |
Zehang LI, Tyler McCormick, Sam Clark
This function prints the summary message of the fitted results.
## S3 method for class 'interVA_summary' print(x, ...)
## S3 method for class 'interVA_summary' print(x, ...)
x |
summary of InterVA results |
... |
not used |
This is the table of conditional probabilities of symptoms given CODs. The values are from InterVA-4.02.
A data frame with 246 observations on 81 variables. Each observation is the conditional probability.
data(probbase)
data(probbase)
This is the table of conditional probabilities of symptoms given CODs. The values are from InterVA-4.03.
A data frame with 246 observations on 81 variables. Each observation is the conditional probability.
data(probbase)
data(probbase)
This is a dataset consisting of 10 arbitrary sample input deaths in the acceptable format of InterVA4. Any data that needs to be analyzed by this package should be in the same format. The orders of the input fields must not be changed.
10 arbitrary input records.
data(SampleInput)
data(SampleInput)
This function prints the summary message of the fitted results.
## S3 method for class 'interVA' summary(object, top = 5, id = NULL, InterVA.rule = TRUE, ...)
## S3 method for class 'interVA' summary(object, top = 5, id = NULL, InterVA.rule = TRUE, ...)
object |
fitted object from |
top |
number of top CSMF to show |
id |
the ID of a specific death to show |
InterVA.rule |
If it is set to "TRUE", only the top 3 causes reported by InterVA4 is calculated into CSMF as in InterVA4. The rest of probabilities goes into an extra category "Undetermined". Default set to "TRUE". |
... |
not used |
http://www.interva.net/
data(SampleInput) ## to get easy-to-read version of causes of death make sure the column ## orders match interVA4 standard input this can be monitored by checking ## the warnings of column names sample.output1 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE) summary(sample.output1) summary(sample.output1, top = 10) summary(sample.output1, id = "100532")
data(SampleInput) ## to get easy-to-read version of causes of death make sure the column ## orders match interVA4 standard input this can be monitored by checking ## the warnings of column names sample.output1 <- InterVA(SampleInput, HIV = "h", Malaria = "l", write=FALSE, replicate = FALSE) summary(sample.output1) summary(sample.output1, top = 10) summary(sample.output1, id = "100532")