Title: | Statistical and Viz Tools for Vector-Borne Diseases in Colombia |
---|---|
Description: | Provides statistical and visualization tools for the analysis of demographic indicators, and spatio-temporal behavior and characterization of outbreaks of vector-borne diseases (VBDs) in Colombia. It implements travel times estimated in Bravo-Vega C., Santos-Vega M., & Cordovez J.M. (2022), and the endemic channel method (Bortman, M. (1999) <https://iris.paho.org/handle/10665.2/8562>). |
Authors: | Juan D. Umaña [aut, cre, cph] , Juan Montenegro-Torres [aut] , Julian Otero [aut] , Hugo Gruson [ctb] |
Maintainer: | Juan D. Umaña <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-14 12:30:14 UTC |
Source: | https://github.com/epiverse-trace/epiCo |
Function that returns the specific rates of being infected given age and sex
age_risk(age, population_pyramid, sex = NULL, plot = FALSE)
age_risk(age, population_pyramid, sex = NULL, plot = FALSE)
age |
A vector with the ages of cases in years from 0 to 100 years |
population_pyramid |
A dataframe with the count of individuals with the columns age, population and sex |
sex |
A vector with the sex of cases 'F' and 'M'. The default value is NULL |
plot |
A boolean for displaying a plot. The default value is FALSE |
A dataframe with the proportion or total count of individuals
pop_pyramid <- population_pyramid("15001", 2015, sex = TRUE, total = TRUE, plot = FALSE ) ages <- round(runif(150, 0, 100)) sex <- c(rep("M", 70), rep("F", 80)) age_risk( age = ages, sex = sex, population_pyramid = pop_pyramid, plot = TRUE )
pop_pyramid <- population_pyramid("15001", 2015, sex = TRUE, total = TRUE, plot = FALSE ) ages <- round(runif(150, 0, 100)) sex <- c(rep("M", 70), rep("F", 80)) age_risk( age = ages, sex = sex, population_pyramid = pop_pyramid, plot = TRUE )
Function that returns the description of the consulted ethnicities
describe_ethnicity(ethnic_codes)
describe_ethnicity(ethnic_codes)
ethnic_codes |
A numeric vector with the codes of ethnicities to consult |
A printed message with ethnicities descriptions
describe_ethnicity(round(runif(n = 150, min = 1, max = 4)))
describe_ethnicity(round(runif(n = 150, min = 1, max = 4)))
Function that translates a vector of ISCO-88 occupation codes into a vector of labels
describe_occupation(isco_codes, sex = NULL, plot = NULL)
describe_occupation(isco_codes, sex = NULL, plot = NULL)
isco_codes |
A numeric vector of ISCO-88 occupation codes (major, submajor, minor, or unit) |
sex |
A vector with the respective sex for isco_codes vector. The default value is NULL |
plot |
A type of plot between treemap and circular packing. The default value is NULL |
A string vector of ISCO-88 labels
demog_data <- data.frame( occupation_label = c(6111, 3221, 5113, 5133, 6111, 23, 25), sex = c("F", "M", "F", "F", "M", "M", "F") ) describe_occupation( isco_codes = demog_data$occupation_label, sex = demog_data$sex, plot = "treemap" )
demog_data <- data.frame( occupation_label = c(6111, 3221, 5113, 5133, 6111, 23, 25), sex = c("F", "M", "F", "F", "M", "M", "F") ) describe_occupation( isco_codes = demog_data$occupation_label, sex = demog_data$sex, plot = "treemap" )
Political and administrative distribution of Colombia's municipalities
data(divipola_table)
data(divipola_table)
An object of class data.frame
with 1121 rows and 8 columns.
DIVIPOLA table
Function that builds the endemic channel of a disease time series based on the selected method and windows of observation
endemic_channel( incidence_historic, observations = NULL, method = c("geometric", "median", "mean", "unusual_behavior"), geometric_method = "shifted", outlier_years = NULL, outliers_handling = c("ignored", "included", "replaced_by_median", "replaced_by_mean", "replaced_by_geometric_mean"), ci = 0.95, plot = FALSE )
endemic_channel( incidence_historic, observations = NULL, method = c("geometric", "median", "mean", "unusual_behavior"), geometric_method = "shifted", outlier_years = NULL, outliers_handling = c("ignored", "included", "replaced_by_median", "replaced_by_mean", "replaced_by_geometric_mean"), ci = 0.95, plot = FALSE )
incidence_historic |
An incidence object with the historic weekly observations |
observations |
A numeric vector with the current observations |
method |
A string with the mean calculation method of preference (median, mean, or geometric) or to use the unusual behavior method (Poisson Distribution Test for Hypoendemic settings) |
geometric_method |
A string with the selected method for geometric mean calculation; see: geometric_mean |
outlier_years |
A numeric vector with the outlier years |
outliers_handling |
A string with the handling decision regarding outlier years, see: outliers_handling function |
ci |
= 0.95 A numeric value to specify the confidence interval to use with the geometric method |
plot |
A boolean for displaying a plot |
A dataframe with the observation, historical mean, and confidence intervals (or risk areas)
data_event <- epiCo::epi_data data_ibague <- data_event[data_event$cod_mun_o == 73001, ] incidence_historic <- incidence::incidence(data_ibague$fec_not, interval = "1 epiweek" ) endemic_channel(incidence_historic, method = "geometric", plot = TRUE )
data_event <- epiCo::epi_data data_ibague <- data_event[data_event$cod_mun_o == 73001, ] incidence_historic <- incidence::incidence(data_ibague$fec_not, interval = "1 epiweek" ) endemic_channel(incidence_historic, method = "geometric", plot = TRUE )
Function that returns the starting date of the epidemiological weeks in a year of interest.
epi_calendar(year, jan_days = 4)
epi_calendar(year, jan_days = 4)
year |
A numeric value for the year of interest. |
jan_days |
Number of January days that the first epidemiological week must contains. |
A character array with the starting dates of the epidemiological weeks of the given year.
epi_calendar(2016)
epi_calendar(2016)
Epidemiological data for the Tolima department for the years 2012 to 2022
data(epi_data)
data(epi_data)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 66747 rows and 16 columns.
Epidemiological data
Function that returns the geometric mean of a vector of real numbers according to the selected method.
geometric_mean( x, method = c("positive", "shifted", "optimized", "weighted"), shift = 1, epsilon = 0.001 )
geometric_mean( x, method = c("positive", "shifted", "optimized", "weighted"), shift = 1, epsilon = 0.001 )
x |
A numeric vector of real values |
method |
Description of methods:
|
shift |
= 1 (default) a positive value to use in the shifted method |
epsilon |
= 1e-5 (default) the minimum positive value to consider in the optimized method. |
The geometric mean of the x vector, and the epsilon value if optimized method is used.
x <- c(4, 5, 3, 7, 8) geometric_mean(x, method = "optimized")
x <- c(4, 5, 3, 7, 8) geometric_mean(x, method = "optimized")
Function that returns the geometric standard deviation of a vector of real numbers according to the selected method.
geometric_sd( x, method = c("positive", "shifted", "optimized", "weighted"), shift = 1, delta = 0.001 )
geometric_sd( x, method = c("positive", "shifted", "optimized", "weighted"), shift = 1, delta = 0.001 )
x |
A numeric vector of real values |
method |
Description of methods:
|
shift |
a positive value to use in the shifted method |
delta |
an positive value (shift) used in the optimized method. |
The geometric mean of the x vector, and the epsilon value if optimized method is used.
x <- c(4, 5, 3, 7, 8) geometric_sd(x, method = "optimized")
x <- c(4, 5, 3, 7, 8) geometric_sd(x, method = "optimized")
Function that estimates incidence rates from a incidence class object and population projections.
incidence_rate(incidence_object, level, scale = 1e+05)
incidence_rate(incidence_object, level, scale = 1e+05)
incidence_object |
An incidence object. |
level |
Administration level at which incidence counts are grouped (0 = national, 1 = state/department, 2 = city/municipality). |
scale |
Scale to consider when calculating the incidence_rate. |
A modified incidence object where counts are normalized with the population.
data_event <- epiCo::epi_data incidence_historic <- incidence::incidence(data_event$fec_not, groups = data_event$cod_mun_o, interval = "1 year" ) incidence_object <- subset(incidence_historic, from = "2015-01-04", to = "2018-12-27" ) inc_rate <- incidence_rate(incidence_object, level = 2, scale = 100000) inc_rate$rates
data_event <- epiCo::epi_data incidence_historic <- incidence::incidence(data_event$fec_not, groups = data_event$cod_mun_o, interval = "1 year" ) incidence_object <- subset(incidence_historic, from = "2015-01-04", to = "2018-12-27" ) inc_rate <- incidence_rate(incidence_object, level = 2, scale = 100000) inc_rate$rates
ISCO88 description of occupations
data(isco88_table)
data(isco88_table)
An object of class data.frame
with 390 rows and 8 columns.
ISCO88 occupation table
Function to calculate spatial autocorrelation via Moran's Index from a given incidence_rate object grouped by municipality.
morans_index(incidence_object, scale = 1e+05, threshold = 2, plot = TRUE)
morans_index(incidence_object, scale = 1e+05, threshold = 2, plot = TRUE)
incidence_object |
An incidence object with one observation for the different locations (groups). |
scale |
Scale to consider when calculating the incidence_rate. |
threshold |
Maximum traveling time around each municipality. |
plot |
if TRUE, returns a plot of influential observations in the Moran's plot. |
List of Moran's I clustering analysis, giving the quadrant of each observation, influential values.
data_event <- epiCo::epi_data incidence_historic <- incidence::incidence(data_event$fec_not, groups = data_event$cod_mun_o, interval = "4 year" ) incidence_object <- subset(incidence_historic, from = "2015-01-04", to = "2018-12-27" ) morans_index(incidence_object, scale = 100000, threshold = 2, plot = TRUE)
data_event <- epiCo::epi_data incidence_historic <- incidence::incidence(data_event$fec_not, groups = data_event$cod_mun_o, interval = "4 year" ) incidence_object <- subset(incidence_historic, from = "2015-01-04", to = "2018-12-27" ) morans_index(incidence_object, scale = 100000, threshold = 2, plot = TRUE)
Function to build neighborhoods from real travel distances inside Colombia by land or river transportation.
neighborhoods(query_vector, threshold = 2)
neighborhoods(query_vector, threshold = 2)
query_vector |
Codes of the municipalities to consider for the neighborhoods. |
threshold |
Maximum traveling time around each municipality. |
neighborhood object according to the introduced threshold.
query_vector <- c("05001", "05002", "05004", "05021", "05030", "05615") neighborhoods(query_vector, 2)
query_vector <- c("05001", "05002", "05004", "05021", "05030", "05615") neighborhoods(query_vector, 2)
Function that returns the population pyramid of the municipality or department of a specific year
population_pyramid( divipola_code, year, sex = TRUE, range = 5, total = TRUE, plot = FALSE )
population_pyramid( divipola_code, year, sex = TRUE, range = 5, total = TRUE, plot = FALSE )
divipola_code |
A code from the divipola table representing a department or municipality. To obtain values at the national level, code '0' is used |
year |
A numeric input for the year of interest |
sex |
A boolean to consult data disaggregated by sex. The default value is TRUE |
range |
A numeric value from 1 to 100 for the age range to use. The default value is 5 |
total |
A boolean for returning the total number rather than the proportion of the country's population. The default value is TRUE |
plot |
A boolean for displaying a plot. The default value is TRUE |
A dataframe with the proportion or total count of individuals
population_pyramid("15001", 2015, sex = TRUE, total = TRUE, plot = TRUE)
population_pyramid("15001", 2015, sex = TRUE, total = TRUE, plot = TRUE)