Package 'MorbiditySpainR'

Title: Read and manipualte data from Encuesta de morbilidad hospitalaria INE
Description: Show data from Encuesta de morbilidad hospitalaria
Authors: Rafael Menéndez [aut, cre]
Maintainer: Rafael Menéndez <[email protected]>
License: GPL-2
Version: 0.1.0
Built: 2024-11-04 03:03:49 UTC
Source: https://github.com/rOpenSpain/MorbiditySpainR

Help Index


Add principal diagnosis to morbity data

Description

Add principal diagnosis following international classification of diseases

Usage

AddDiagnosis1(data)

Arguments

data

Morbidity data

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad, diag1

Examples

data <- data_ejemplo %>% AddDiagnosis1()

Add secondary diagnosis to morbity data

Description

Add secondary diagnosis following international classification of diseases

Usage

AddDiagnosis2(data)

Arguments

data

Morbidity data

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad, diag2

Examples

data <- data_ejemplo %>% AddDiagnosis2()

Add specific diagnosis to morbity data

Description

Add specific diagnosis following international classification of diseases

Usage

AddDiagnosis3(data)

Arguments

data

Morbidity data

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad, diag3

Examples

data <- data_ejemplo %>% AddDiagnosis3()

Filter morbidity by principal diagnosis

Description

Filter morbidity by principal diagnosis following international classification of diseases

Usage

FilterDiagnosis1(data, diagnosis_id)

Arguments

data

Morbidity data

diagnosis_id

id of principal diagnosis

Details

Uses dplyr filter

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- data_ejemplo %>% FilterDiagnosis1(2)

Filter morbidity by secondary diagnosis

Description

Filter morbidity by secondary diagnosis following international classification of diseases

Usage

FilterDiagnosis2(data, diagnosis_id)

Arguments

data

Morbidity data

diagnosis_id

id of secondary diagnosis

Details

Uses dplyr filter

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- data_ejemplo %>% FilterDiagnosis2(20)

Filter morbidity by ER item

Description

Filter morbidity by ER

Usage

FilterEmergency(data)

Arguments

data

Morbidity data

Details

Uses dplyr filter

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- data_ejemplo %>% FilterEmergency()

Filter morbidity by provincia

Description

Filter morbidity by provincia using official id of provincias

Usage

FilterProvincia(data, provincia)

Arguments

data

Morbidity data

provincia

ID of provincia

Details

Uses dplyr filter

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- data_ejemplo %>% FilterProvincia(28)

Download and read morbidity data for several years

Description

Download morbidity data from INE ftp and parse it

Usage

GetMorbiData(y1 = 2005, y2 = 2015)

Arguments

year1

Begining year of morbidity data

year2

Ending year of morbidity data

Details

Uses ReadZip

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- GetMorbiData(y1=2010,y2=2011)

Download and read morbidity data

Description

Download morbidity data from INE ftp and parse it

Usage

ReadZip(year)

Arguments

year

Year of morbidity data

Details

Uses read.fwf

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- ReadZip(2010)

Download and read morbidity data form year 2015

Description

Download morbidity data from INE ftp and parse it

Usage

ReadZip2015(year)

Arguments

year

Year of morbidity data

Details

Uses script provided from INE

Value

data frame with morbidity data prov_hosp, sexo, prov_res, diag_in, diag_ppal, motivo_alta, estancia, fecha_ingreso, edad

Examples

data <- ReadZip(2015)

Reduce data to temporal serie

Description

Reduce morbidity data to temporal serie, including diagnosis, province or sex

Usage

ReduceData(data, provincia = TRUE, date = "day", diag = NULL,
  sex = FALSE)

Arguments

data

Morbidity data

date

day, month or year

diag

diag1, daig2, diag3, if NULL not reduced by diagnosis

sex

Boolean, reduce by sex

province

Boolean, reduce by provicia

Details

Uses group_by

Value

data frame with data serie of morbidity

Examples

data <- data_ejemplo %>% ReduceData(provincia = TRUE,date = "day")

Calculate prevalence, relative values.

Description

Calculate prevalence, relative values by total population of preovince

Usage

SetPrevalence(data, pop = "total")

Arguments

data

Morbidity data

pop

total, male, females

Details

Uses poblacion

Value

relative values of prevalence

Examples

data <- data_ejemplo %>%  ReduceData(provincia = TRUE,date="year") %>% SetPrevalence()

Get specific diagnosis

Description

Get specific diagnosis following international classification of diseases

Usage

TraduceCodigoEspecifico(codigo)

Arguments

codigo

code from morbidity data

Value

Specific diagnosis

Examples

data <- TraduceCodigoEspecifico(3019)