Commit d30ec82c authored by Irucka Embry's avatar Irucka Embry
Browse files

First commit

parents
Pipeline #2023980 skipped
^README\.Rmd$
^README-*\.png$
^\.travis\.yml$
^travischanges\.txt$
^cran-comments\.md$
^\.gitignore
^\.git
\ No newline at end of file
Package: vaers
Title: US Vaccine Adverse Event Reporting System (VAERS) data for 1990 -
Present
Version: 1.0.0
Depends: R (>= 2.14.0)
Suggests: vaersND, data.table, dplyr, rpivotTable, knitr, rmarkdown
Author: Irucka Embry [aut, cre]
Maintainer: Irucka Embry <iembry@ecoccs.com>
Description: US VAERS data for 1990 - 03/14/2016. "VAERS is a national vaccine
safety surveillance program co-sponsored by the US Centers for Disease
Control and Prevention (CDC) and the US Food and Drug Administration (FDA).
VAERS is a post-marketing safety surveillance program, collecting
information about adverse events (possible side effects) that occur after
the administration of vaccines licensed for use in the United States." For
more information about the data, visit https://vaers.hhs.gov/index. For
information about vaccination/immunization hazards, visit
http://www.questionuniverse.com/rethink.html/#vaccine.
URL: https://gitlab.com/iembry/vaers
BugReports: https://gitlab.com/iembry/vaers/issues
License: CC0
LazyData: true
\ No newline at end of file
exportPattern("^[^\\.]")
# vaers 1.0.0
* Initial release
\ No newline at end of file
#' US Vaccine Adverse Event Reporting System (VAERS) data for 1990 - Present
#'
#' A table containing the data from the VAERS-1 form.
#'
#' @format A data.table data frame with 490,250 rows and 29 variables:
#' \describe{
#' \item{VAERS_ID}{VAERS Identification Number}
#' \item{RECVDATE}{Date report was received}
#' \item{STATE}{Box 1: State}
#' \item{AGE_YRS}{Box 4: Age in Years}
#' \item{CAGE_YR}{Age of patient in years calculated by (vax_date- birthdate)*}
#' \item{CAGE_MO}{Age of patient in months calculated by (vax_date- birthdate).
#' * The values for this variable range from 0 to <1.}
#' \item{SEX}{Box 5: Sex}
#' \item{RPT_DATE}{Box 6: Date Form Completed}
#' \item{SYMPTOM_TEXT}{Box 7: Reported symptom text}
#' \item{DIED}{Box 8a1: Died ('Y' - Yes)}
#' \item{DATEDIED}{Box 8a2: Date of Death}
#' \item{L_THREAT}{Box 8b: Life-Threatening Illness ('Y' - Yes)}
#' \item{ER_VISIT}{Box 8c: Emergency Room or Doctor Visit ('Y' - Yes)}
#' \item{HOSPITAL}{Box 8d1: Hospitalized ('Y' - Yes)}
#' \item{HOSPDAYS}{Box 8d2: Number of days Hospitalized}
#' \item{X_STAY}{Box 8e: Prolonged Hospitalization ('Y' - Yes)}
#' \item{DISABLE}{Box 8f: Disability ('Y' - Yes)}
#' \item{RECOVD}{Box 9: Recovered ('Y' - Yes, 'N' - No, 'U' - Unknown)}
#' \item{VAX_DATE}{Box 10: Vaccination Date}
#' \item{ONSET_DATE}{Box 11: Adverse Event Onset Date}
#' \item{NUMDAYS}{Number of days (Onset date - Vax. Date)}
#' \item{LAB_DATA}{Box 12: Diagnostic laboratory data}
#' \item{V_ADMINBY}{Box 15: Vaccines Administered at (PUB=Public, PVT=Private,
#' OTH=Other, MIL=Military)}
#' \item{V_FUNDBY}{Box 16: Vaccines purchased with (PUB=Public, PVT=Private,
#' OTH=Other, MIL=Military) funds}
#' \item{OTHER_MEDS}{Box 17: Other Medications}
#' \item{CUR_ILL}{Box 18: Current Illnesses}
#' \item{HISTORY}{Box 19: Pre-existing physician diagnosed allergies, birth
#' defects, medical conditions}
#' \item{PRIOR_VAX}{Box 21: Prior Vaccination Event information}
#' \item{SPLTTYPE}{Box 24: Manufacturer Number}
#' }
#'
#'
#' @references
#' US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA) Vaccine Adverse Event Reporting System (VAERS) \url{https://vaers.hhs.gov/index} and \url{https://vaers.hhs.gov/data/READMEJanuary2015.pdf}.
#' }
#'
#'
#' @docType data
#' @name vaers_data
#' @usage vaers_data
#' @examples
#' library(data.table)
#' vaers_data
NULL
#' US Vaccine Adverse Event Reporting System (VAERS) symptom data for 1990 -
#' Present
#'
#' A table containing the "adverse event coded terms utilizing the MedDRA
#' dictionary. Coders will search for specific terms in boxes 7 and 12 and code
#' them to a searchable and consistent MedDRA term; note that terms are
#' included in the .csv file in alphabetical order. There can be an unlimited
#' amount of coded terms for a given event. Each row in the .csv will contain
#' up to 5 MedDRA terms per VAERS ID; thus, there could be multiple rows per
#' VAERS ID. For each of the VAERS_ID’s listed in the VAERSDATA.CSV table,
#' there is a matching record in this file, identified by VAERS_ID."
#'
#'
#'
#' @format A data.table data frame with 598,721 rows and 11 variables:
#' \describe{
#' \item{VAERS_ID}{VAERS Identification Number}
#' \item{SYMPTOM1}{Adverse Event MedDRA Term 1}
#' \item{SYMPTOMVERSION1}{MedDRA dictionary version number 1}
#' \item{SYMPTOM2}{Adverse Event MedDRA Term 1}
#' \item{SYMPTOMVERSION2}{MedDRA dictionary version number 2}
#' \item{SYMPTOM3}{Adverse Event MedDRA Term 3}
#' \item{SYMPTOMVERSION3}{MedDRA dictionary version number 3}
#' \item{SYMPTOM4}{Adverse Event MedDRA Term 4}
#' \item{SYMPTOMVERSION4}{MedDRA dictionary version number 4}
#' \item{SYMPTOM5}{Adverse Event MedDRA Term 5}
#' \item{SYMPTOMVERSION5}{MedDRA dictionary version number 5}
#' }
#'
#'
#' @references
#' US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA) Vaccine Adverse Event Reporting System (VAERS) \url{https://vaers.hhs.gov/index} and \url{https://vaers.hhs.gov/data/READMEJanuary2015.pdf}.
#' }
#'
#'
#' @docType data
#' @name vaers_symptoms
#' @usage vaers_symptoms
#' @examples
#' library(data.table)
#' vaers_symptoms
NULL
#' US Vaccine Adverse Event Reporting System (VAERS) vaccine data for 1990 -
#' Present
#'
#' A table containing the "remaining vaccine information (e.g., vaccine name,
#' manufacturer, lot number, route, site, and number of previous doses
#' administered), for each of the vaccines listed in Box 13 of the VAERS form.
#' There is a matching record in this file with the VAERSDATA file identified
#' by VAERS_ID."
#'
#'
#'
#' @format A data.table data frame with 793,195 rows and 8 variables:
#' \describe{
#' \item{VAERS_ID}{VAERS Identification Number}
#' \item{VAX_TYPE}{Administered Vaccine Type}
#' \item{VAX_MANU}{Vaccine Manufacturer}
#' \item{VAX_LOT}{Manufacturer's Vaccine Lot}
#' \item{VAX_DOSE}{Number of previous doses administered}
#' \item{VAX_ROUTE}{Vaccination Route}
#' \item{VAX_SITE}{Vaccination Site}
#' \item{VAX_NAME}{Vaccination Name}
#' }
#'
#'
#' @references
#' US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA) Vaccine Adverse Event Reporting System (VAERS) \url{https://vaers.hhs.gov/index} and \url{https://vaers.hhs.gov/data/READMEJanuary2015.pdf}.
#' }
#'
#'
#' @docType data
#' @name vaers_vax
#' @usage vaers_vax
#' @examples
#' library(data.table)
#' vaers_vax
NULL
#' vaers: US Vaccine Adverse Event Reporting System (VAERS)
#'
#' vaers provides the US Vaccine Adverse Event Reporting System
#' (VAERS) data for 1990 - Present. "VAERS is a national vaccine safety
#' surveillance program co-sponsored by the US Centers for Disease Control
#' and Prevention (CDC) and the US Food and Drug Administration (FDA). VAERS
#' is a post-marketing safety surveillance program, collecting information
#' about adverse events (possible side effects) that occur after the
#' administration of vaccines licensed for use in the United States."
#'
#' @source VAERS \url{https://vaers.hhs.gov/index}
#'
#'
#' @docType package
#' @name vaers
NULL
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# vaers
US Vaccine Adverse Event Reporting System (VAERS) data for 1990 - Present. "VAERS is a national vaccine safety surveillance program co-sponsored by the US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA). VAERS is a post-marketing safety surveillance program, collecting information about adverse events (possible side effects) that occur after the administration of vaccines licensed for use in the United States." Source: [VAERS](https://vaers.hhs.gov/index).
For information about vaccination/immunization hazards, visit [http://www.questionuniverse.com/rethink.html/#vaccine](http://www.questionuniverse.com/rethink.html/#vaccine).
Due to the large size of the raw data sets, they have not been included in this package.
# Examples
```R
library(vaers)
library(data.table)
library(dplyr)
library(rpivotTable)
## load vaers_data
data(vaers_data)
# How many reports for each sex?
count(vaers_data, SEX)
# Identify the VAERS_IDs for males only.
setkey(vaers_data, VAERS_ID)
vaers_data[SEX == "M"][, 1, with = FALSE]
# Create a pivot table of this data.
rpivotTable(vaers_data)
## load vaers_symptoms
data(vaers_symptoms)
# How many reports of autism for SYMPTOM1?
setkey(vaers_symptoms, VAERS_ID)
nrow(vaers_symptoms[SYMPTOM1 == "Autism"])
# Create a pivot table of this data.
rpivotTable(vaers_symptoms)
## load vaers_vax
data(vaers_vax)
# What are the counts for each of the VAX_TYPEs?
count(vaers_vax, VAX_TYPE)
# How many reports of MMR as the VAX_TYPE?
nrow(vaers_vax[VAX_TYPE == "MMR"])
# Create a pivot table of this data.
rpivotTable(vaers_vax)
```
# VAERS Data Disclaimer
[https://vaers.hhs.gov/data/data](https://vaers.hhs.gov/data/data) which redirects to [https://vaers.hhs.gov/data/index](https://vaers.hhs.gov/data/index) (The content below is from this second URL and is current as of 2 February 2016):
"VAERS Data
Guide to Interpreting VAERS Case Report Information
When evaluating data from VAERS, it is important to note that for any reported event, no cause-and-effect relationship has been established. Reports of all possible associations between vaccines and adverse events (possible side effects) are filed in VAERS. Therefore, VAERS collects data on any adverse event following vaccination, be it coincidental or truly caused by a vaccine. The report of an adverse event to VAERS is not documentation that a vaccine caused the event.
VAERS data contains coincidental events and those truly caused by vaccines.
More than 10 million vaccines per year are given to children less than 1 year old, usually between 2 and 6 months of age. At this age, infants are at greatest risk for certain medical adverse events, including high fevers, seizures, and sudden infant death syndrome (SIDS). Some infants will experience these medical events shortly after a vaccination by coincidence.
These coincidences make it difficult to know whether a particular adverse event resulted from a medical condition or from a vaccination. Therefore, vaccine providers are encouraged to report all adverse events following vaccination, whether or not they believe the vaccination was the cause.
Please read the following statement on the limits of VAERS data. You MUST click on the box below to access the VAERS database.
When reviewing data from VAERS, please keep in mind the following limitations:
VAERS is a passive reporting system, meaning that reports about adverse events are not automatically collected, but require a report to be filed to VAERS. VAERS reports can be submitted voluntarily by anyone, including healthcare providers, patients, or family members. Reports vary in quality and completeness. They often lack details and sometimes can have information that contains errors.
"Underreporting" is one of the main limitations of passive surveillance systems, including VAERS. The term, underreporting refers to the fact that VAERS receives reports for only a small fraction of actual adverse events. The degree of underreporting varies widely. As an example, a great many of the millions of vaccinations administered each year by injection cause soreness, but relatively few of these episodes lead to a VAERS report. Physicians and patients understand that minor side effects of vaccinations often include this kind of discomfort, as well as low fevers. On the other hand, more serious and unexpected medical events are probably more likely to be reported than minor ones, especially when they occur soon after vaccination, even if they may be coincidental and related to other causes.
A report to VAERS generally does not prove that the identified vaccine(s) caused the adverse event described. It only confirms that the reported event occurred sometime after vaccine was given. No proof that the event was caused by the vaccine is required in order for VAERS to accept the report. VAERS accepts all reports without judging whether the event was caused by the vaccine.
DISCLAIMER: Please note that VAERS staff follow-up on all serious and other selected adverse event reports to obtain additional medical, laboratory, and/or autopsy records to help understand the concern raised. However, in general coding terms in VAERS do not change based on the information received during the follow-up process. VAERS data should be used with caution as numbers and conditions do not reflect data collected during follow-up. Note that the inclusion of events in VAERS data does not imply causality.
For more information, please call the VAERS Information Line toll-free at (800) 822-7967 or e-mail to [info@vaers.org](info@vaers.org).
I have read and understand the preceding statement."
# Test environments
* local Trisquel 7.0/Ubuntu Trusty, R 3.2.5
* win-builder (devel)
# R CMD check results
There were no ERRORs or WARNINGs.
There was 1 NOTE:
checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Irucka Embry <iembry@ecoccs.com>
New submission
Possibly mis-spelled words in DESCRIPTION:
Embry's (2:15, 12:37)
Irucka (2:8, 12:30
# source 1
# r - Convert column classes in data.table - Stack Overflow answered by Matt Dowle on Dec 27 2013. See \url{http://stackoverflow.com/questions/7813578/convert-column-classes-in-data-table}.
# Data source \url{https://vaers.hhs.gov/data/index}
# There was an "Error in fread("/vaers_data/raw/2003VAERSDATA.csv") :
# embedded nul in string: '\0'
# so the file was corrected using sed: sed -i 's/\x0//g' 2003VAERSDATA.csv
# Source for sed code: https://stackoverflow.com/questions/34407976/embedded-nul-in-string-with-fread-tried-all-other-method-still-couldnt-solve
# r - 'embedded nul in string' with fread (tried all other method still couldn't solve)
library(data.table)
# Vax
vax <- list.files(path = "/vaers_data/raw/", pattern = "vax", full.names = TRUE, ignore.case = TRUE)
vaers_vax <- lapply(vax, fread, colClasses = "character")
vaers_vax <- rbindlist(vaers_vax)
# changing column to numeric class
change_class1 <- "VAX_DOSE"
for (col in change_class1) set(vaers_vax, j = col, value = as.numeric(vaers_vax[[col]])) # Source 1
save(vaers_vax, file = "/data/vaers_vax.RData", compress = "xz")
# SymptomsS
symptoms <- list.files(path = "/vaers_data/raw/", pattern = "symptoms", full.names = TRUE, ignore.case = TRUE)
vaers_symptoms <- lapply(symptoms, fread, colClasses = "character")
vaers_symptoms <- rbindlist(vaers_symptoms)
change_class2 <- c("SYMPTOMVERSION1", "SYMPTOMVERSION2", "SYMPTOMVERSION3", "SYMPTOMVERSION4", "SYMPTOMVERSION5")
for (col in change_class2) set(vaers_symptoms, j = col, value = as.numeric(vaers_symptoms[[col]])) # Source 1
save(vaers_symptoms, file = "/data/vaers_symptoms.RData", compress = "xz")
# Data
data <- list.files(path = "/vaers_data/raw/", pattern = "data", full.names = TRUE, ignore.case = TRUE)
vaers_data <- lapply(data, fread, colClasses = "character")
vaers_data <- rbindlist(vaers_data)
change_class3 <- c("AGE_YRS", "CAGE_YR", "CAGE_MO", "HOSPDAYS", "NUMDAYS")
for (col in change_class3) set(vaers_data, j = col, value = as.numeric(vaers_data[[col]])) # Source 1
change_class4 <- c("RECVDATE", "RPT_DATE", "DATEDIED", "VAX_DATE", "ONSET_DATE")
for (col in change_class4) set(vaers_data, j = col, value = as.POSIXct(vaers_data[[col]], format = "%m/%d/%Y")) # Source 1
save(vaers_data, file = "/data/vaers_data.RData", compress = "xz")
VAERS Data Disclaimer
https://vaers.hhs.gov/data/data which redirects to https://vaers.hhs.gov/data/index (The content below is from this second URL and is current as of 2 February 2016):
"VAERS Data
Guide to Interpreting VAERS Case Report Information
When evaluating data from VAERS, it is important to note that for any reported event, no cause-and-effect relationship has been established. Reports of all possible associations between vaccines and adverse events (possible side effects) are filed in VAERS. Therefore, VAERS collects data on any adverse event following vaccination, be it coincidental or truly caused by a vaccine. The report of an adverse event to VAERS is not documentation that a vaccine caused the event.
VAERS data contains coincidental events and those truly caused by vaccines.
More than 10 million vaccines per year are given to children less than 1 year old, usually between 2 and 6 months of age. At this age, infants are at greatest risk for certain medical adverse events, including high fevers, seizures, and sudden infant death syndrome (SIDS). Some infants will experience these medical events shortly after a vaccination by coincidence.
These coincidences make it difficult to know whether a particular adverse event resulted from a medical condition or from a vaccination. Therefore, vaccine providers are encouraged to report all adverse events following vaccination, whether or not they believe the vaccination was the cause.
Please read the following statement on the limits of VAERS data. You MUST click on the box below to access the VAERS database.
When reviewing data from VAERS, please keep in mind the following limitations:
VAERS is a passive reporting system, meaning that reports about adverse events are not automatically collected, but require a report to be filed to VAERS. VAERS reports can be submitted voluntarily by anyone, including healthcare providers, patients, or family members. Reports vary in quality and completeness. They often lack details and sometimes can have information that contains errors.
"Underreporting" is one of the main limitations of passive surveillance systems, including VAERS. The term, underreporting refers to the fact that VAERS receives reports for only a small fraction of actual adverse events. The degree of underreporting varies widely. As an example, a great many of the millions of vaccinations administered each year by injection cause soreness, but relatively few of these episodes lead to a VAERS report. Physicians and patients understand that minor side effects of vaccinations often include this kind of discomfort, as well as low fevers. On the other hand, more serious and unexpected medical events are probably more likely to be reported than minor ones, especially when they occur soon after vaccination, even if they may be coincidental and related to other causes.
A report to VAERS generally does not prove that the identified vaccine(s) caused the adverse event described. It only confirms that the reported event occurred sometime after vaccine was given. No proof that the event was caused by the vaccine is required in order for VAERS to accept the report. VAERS accepts all reports without judging whether the event was caused by the vaccine.
DISCLAIMER: Please note that VAERS staff follow-up on all serious and other selected adverse event reports to obtain additional medical, laboratory, and/or autopsy records to help understand the concern raised. However, in general coding terms in VAERS do not change based on the information received during the follow-up process. VAERS data should be used with caution as numbers and conditions do not reflect data collected during follow-up. Note that the inclusion of events in VAERS data does not imply causality.
For more information, please call the VAERS Information Line toll-free at (800) 822-7967 or e-mail to info@vaers.org.
I have read and understand the preceding statement."
---
title: "vaers: examples"
author: "Irucka Embry"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{US VAERS data examples}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
```{r, echo = FALSE, message = FALSE, warning = FALSE}
# devtools::load_all()
```
# About the data
There are 3 sets of data included in this package from the US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA) United States Vaccine Adverse Event Reporting System (VAERS) program. There is the `vax` table which includes information about the vaccines. There is the `data` table which has data from the VAERS-1 form. There is the `symptoms` table which has the adverse events. Prior to viewing the data, it is recommended that the user read the VAERS DISCLAIMER. You can use the following code to view the DISCLAIMER.
file.show(system.file("DISCLAIMER", package = "vaers"), title = paste("DISCLAIMER"))
# opens the .txt file using the default text editor or within RStudio
# Examples
```R
library(vaers)
library(data.table)
library(dplyr)
library(rpivotTable)
## load vaers_data
data(vaers_data)
# How many reports for each sex?
count(vaers_data, SEX)
# Identify the FAERS_IDs for males only.
setkey(vaers_data, FAERS_ID)
vaers_data[SEX == "M"][, 1, with = FALSE]
# Create a pivot table of this data.
rpivotTable(vaers_data)
## load vaers_symptoms
data(vaers_symptoms)
# How many reports of autism for SYMPTOM1?
setkey(vaers_symptoms, FAERS_ID)
nrow(vaers_symptoms[SYMPTOM1 == "Autism"])
# Create a pivot table of this data.
rpivotTable(vaers_symptoms)
## load vaers_vax
data(vaers_vax)
# What are the counts for each of the VAX_TYPEs?
count(vaers_vax, VAX_TYPE)
# How many reports of MMR as the VAX_TYPE?
nrow(vaers_vax[VAX_TYPE == "MMR"])
# Create a pivot table of this data.
rpivotTable(vaers_vax)
```
# Data Source
* US Centers for Disease Control and Prevention (CDC) and the US Food and Drug Administration (FDA) Vaccine Adverse Event Reporting System (VAERS) \url{https://vaers.hhs.gov/index}.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment