---
title: "vaers: examples"
author: "Irucka Embry"
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
highlight: kate
theme: readable
code_download: TRUE
vignette: >
%\VignetteIndexEntry{US VAERS data examples}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
# 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.
Please see the README, DESCRIPTION, and the individual R data files for more information.
# Examples
```{r, warning = FALSE, message = FALSE, tidy = TRUE}
install.load::load_package("vaers", "vaersND", "data.table", "pivottabler", "skimr", "DT", "formatR")
# load needed packages using the load_package function from the install.load package (it is assumed that you have already installed these packages)
## load vaers_data
data(vaers_data)
# How many reports for each sex?
setkey(vaers_data, VAERS_ID)
vaers_data[, .N, by = list(SEX)] # Source 1
# How many people died, listed by ID (only using the vaers_data]?
vaers_data[DIED == "Y", list(VAERS_ID, DIED)]
# Identify the VAERS_IDs for females only
vaers_data[SEX == "F", list(VAERS_ID, SEX)]
## load vaers_symptoms
data(vaers_symptoms)
# How many reports of autism for SYMPTOM1?
setkey(vaers_symptoms, VAERS_ID)
vaers_symptoms[SYMPTOM1 == "Autism", .N] # Source 2
## load vaers_vax
data(vaers_vax)
# What are the counts for each of the VAX_TYPEs?
setkey(vaers_vax, VAERS_ID)
vaers_vax[, .N, by = list(VAX_TYPE)][order(VAX_TYPE)] # Source 1
# How many reports of MMR as the VAX_TYPE?
vaers_vax[VAX_TYPE == "MMR", .N] # Source 2
# How many reports of COVID19 as the VAX_TYPE or the VAX_NAME contains COVID19?
vaers_vax[VAX_TYPE == "COVID19" | VAX_NAME %like% "COVID19", .N] # Source 2
# join vaers_data and vaers_vax to get access to the type and name of the vaccination$
data_vax <- vaers_data[vaers_vax]
setkey(data_vax, VAERS_ID)
# get the total number of VAERS_IDs in data_vax
length(data_vax$VAERS_ID)
# get the total number of unique VAERS_IDs in data_vax
length(unique(data_vax$VAERS_ID))
# remove the duplicated rows
data_vax2 <- unique(data_vax)
setkey(data_vax2, VAERS_ID)
# How many people have died from all vaccines since 1990?
# Include the number of entries for each VAERS_ID
data_vax2[DIED == "Y", .N, list(VAERS_ID, DIED)] # Source 2
# How many people have died from all vaccines since 1990?
data_vax2[DIED == "Y", list(VAERS_ID, DIED)] # Source 2
# Explore rows 2 and 3 for VAERS_ID: 025003 using DT
datatable(data_vax2[2:3, ])
# How many people have died from the COVID19 Experimental Gene Therapy Technology {Search for discussion by Judy Mikovits, Ph.D.]?
data_vax2[VAX_TYPE == "COVID19" & DIED == "Y", list(VAERS_ID, DIED)] # Source 2
# What is the ratio, expressed as a percentage, of the COVID19 Experimental Gene Therapy Technology {Search for discussion by Judy Mikovits, Ph.D.] to all deaths associated with vaccination$ since 1990?
(nrow(data_vax2[VAX_TYPE == "COVID19" & DIED == "Y"]) / nrow(data_vax2[DIED == "Y"])) * 100 # Source 2
# What is the first date reported with COVID19 as the VAX_TYPE or the VAX_NAME contains COVID19?
data_vax2ed <- data_vax2[VAX_TYPE == "COVID19" | VAX_NAME %like% "COVID19"]
data_vax2ed[1, "VAX_DATE"]
# How many days from the vaccination date to the person's death date?
# copy the data_vax2 data.table object
data_vax2er <- copy(data_vax2)
# create a new column with the value of the time difference between the date the person died and the vaccination date
data_vax2er[, `Days_Vaccination$_Death` := data_vax2$DATEDIED - data_vax2$VAX_DATE]
# group the number of days and sort by the greatest number of days between the date the person died and the vaccination date
data_vax2err <- data_vax2er[, .(.N), by = .(`Days_Vaccination$_Death`)][order(-N)] # Source 2
data_vax2err
```
# Pivot Table
```{r, warning = FALSE, message = FALSE, tidy = TRUE}
# Create a pivot table of the data_vax2 data based on VAX_NAME and if they DIED
qpvt(data_vax2, c("VAX_NAME"), "DIED", "n()")
```
# Summarize the data sets
```{r, warning = FALSE, message = FALSE, tidy = TRUE}
# use skimr to summarize each of the 3 data sets
skim(vaers_data)
skim(vaers_symptoms)
skim(vaers_vax)
```
# Summarize the Non-Domestic data sets in comparison
```{r, warning = FALSE, message = FALSE, tidy = TRUE}
# load the data sets
data(vaersND_data)
data(vaersND_symptoms)
data(vaersND_vax)
# use skimr to summarize each of the 3 Non-Domestic data sets
skim(vaersND_data)
skim(vaersND_symptoms)
skim(vaersND_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), https://vaers.hhs.gov/.
# Sources used in the R code
Source 1
r - Is there an aggregate FUN option to count occurrences? - Stack Overflow answered by mnel on Aug 2 2013. See https://stackoverflow.com/questions/9809166/is-there-an-aggregate-fun-option-to-count-occurrences.
Source 2
https://rdatatable.gitlab.io/data.table/articles/datatable-intro.html
Introduction to data.table
# Useful links to find out more about the inherent dangers of vaccination$
Questioning the Universe Publishing (QUP) {Irucka Embry]: Resources to help us rethink the current crisis (in perception): **"Coronavirus" Vaccination$ Experimental Gene Therapy Technology {Search for discussion by Judy Mikovits, Ph.D.]**
https://www.questionuniverse.com/rethink_current_crisis.html#cov_vaccin
Questioning the Universe Publishing (QUP) {Irucka Embry]: Resources to help us rethink, reimagine, & reFeel our world: **Vaccination$**
https://www.questionuniverse.com/rethink.html#vaccine
EcoC²S [Irucka Embry): Resources for a Healthier You (Resources to help us take responsibility back to heal ourselves and each other): **Vaccination$**
https://www.ecoccs.com/healing.html#vaccines