Title: | FDA Adverse Event Reporting System Quarterly Data Extracting Tool |
---|---|
Description: | An easy framework to read FDA Adverse Event Reporting System XML/ASCII files <https://www.fda.gov/drugs/questions-and-answers-fdas-adverse-event-reporting-system-faers/fda-adverse-event-reporting-system-faers-latest-quarterly-data-files>. |
Authors: | Luis Garcez [aut, cre, cph] |
Maintainer: | Luis Garcez <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.2.0 |
Built: | 2025-01-26 04:10:52 UTC |
Source: | https://github.com/luisgarcez11/faersquarterlydata |
A list containing data from FDA website. The list only contains safety reports which the ADR primary suspect drug was indicated for ALS. List originated from retrieve_faersascii
als_faers_data
als_faers_data
A data frame with 200 rows and 38 columns:
<https://www.fda.gov/drugs/questions-and-answers-fdas-adverse-event-reporting-system-faers/fda-adverse-event-reporting-system-faers-latest-quarterly-data-files>
A subset of data from FAERS data. One row corresponds to one adverse drug reaction. All the ADR in this subset have a primary suspect drug indicated for ALS. Data frame originated from unify_tabular_ascii
als_faers_data_unified
als_faers_data_unified
A data frame with 1635 rows and 40 columns.
Convert a date string into a date format
arrange_date(date_string)
arrange_date(date_string)
date_string |
A string vector with multiple formats (8, 6 or 4 digits) |
A converted Date
arrange_date("2020") arrange_date("202006") arrange_date("20200601")
arrange_date("2020") arrange_date("202006") arrange_date("20200601")
Estimate Chi-Squared test with yates correction
estimate_chisq(n11, n10, n01, n00)
estimate_chisq(n11, n10, n01, n00)
n11 |
Number of events of interest within the group of interest |
n10 |
Number of events of interest from all groups |
n01 |
Number of all events within the group of interest |
n00 |
Number of all events from all groups |
list with Chi-squared statistic and p-value
estimate_chisq(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
estimate_chisq(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
Estimate Information Component
estimate_infoc(n11, n10, n01, n00)
estimate_infoc(n11, n10, n01, n00)
n11 |
Number of events of interest within the group of interest |
n10 |
Number of events of interest from all groups |
n01 |
Number of all events within the group of interest |
n00 |
Number of all events from all groups |
List with Information Component estimate and its 0.95 IC
estimate_infoc(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
estimate_infoc(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
Estimate Proportional Reporting Odds Ratio
estimate_prr(n11, n10, n01, n00, ic_range = 0.95)
estimate_prr(n11, n10, n01, n00, ic_range = 0.95)
n11 |
Number of events of interest within the group of interest |
n10 |
Number of events of interest from all groups |
n01 |
Number of all events within the group of interest |
n00 |
Number of all events from all groups |
ic_range |
Confidence Interval range |
Proportional Reporting Odds Ratio
estimate_prr(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
estimate_prr(n11 = 20, n10 = 10, n01 = 200, n00 = 200)
Estimate Reporting Odds Ratio
estimate_ror(n11, n10, n01, n00, ic_range = 0.95)
estimate_ror(n11, n10, n01, n00, ic_range = 0.95)
n11 |
Number of events of interest within the group of interest |
n10 |
Number of events of interest from all groups |
n01 |
Number of all events within the group of interest |
n00 |
Number of all events from all groups |
ic_range |
Confidence Interval range |
list with ROR estimate and a vector with the IC boundaries
estimate_ror(n11 = 20, n10 = 10, n01 = 200, n00 = 200, ic_range = 0.90)
estimate_ror(n11 = 20, n10 = 10, n01 = 200, n00 = 200, ic_range = 0.90)
Estimate Measures of Association
estimate_ror_bygroup( tabular_faers_data, group_of_interest_col = NULL, group_of_interest_ref = NULL, rename_vector = NULL, event_of_interest_col = NULL, ... )
estimate_ror_bygroup( tabular_faers_data, group_of_interest_col = NULL, group_of_interest_ref = NULL, rename_vector = NULL, event_of_interest_col = NULL, ... )
tabular_faers_data |
FAERS tabular format. Output of function retrieve_faersxml or retrieve_faersxml_all |
group_of_interest_col |
a string, specifying the group of interest. Must me a column name of 'tabular_faers_data', and this columns should only contain two unique values. |
group_of_interest_ref |
a string, specifying the group of interest reference. Must me a value from the group of interest column. |
rename_vector |
optional. named vector to rename the group of interest, in order to show up in a |
event_of_interest_col |
a string, specifying the event of interest. Must me a column name of 'tabular_faers_data'. |
... |
arguments passed to 'estimate_ror' like 'ic_range'. |
tibble with the event of interest counts, group of interest counts and the respective estimated measures of association (ROR and its IC, PRR and its IC, Information Component and Chi-squared statisti with Yates correction.
estimate_ror_bygroup(tabular_faers_data = dplyr::filter(als_faers_data_unified, sex %in% c("M", "F") ), group_of_interest_col = "sex", group_of_interest_ref = "M", event_of_interest_col = "pt")
estimate_ror_bygroup(tabular_faers_data = dplyr::filter(als_faers_data_unified, sex %in% c("M", "F") ), group_of_interest_col = "sex", group_of_interest_ref = "M", event_of_interest_col = "pt")
Convert FAERS xml to an R list
faersxml_to_r(xml_address)
faersxml_to_r(xml_address)
xml_address |
XML address file |
a list containing all the elements from 'xml_address'
Retrieve the duplicated caseIDs to remove from the analysis.
get_duplicate_caseids(duplicates_dir = NULL)
get_duplicate_caseids(duplicates_dir = NULL)
duplicates_dir |
directory path where the text files with the duplicates information are. |
an integer vector with all the caseids to be removed
List of approved products by FDA
products_fda
products_fda
A data frame.
<https://www.fda.gov/drugs/drug-approvals-and-databases/drugsfda-data-files>
Read ASCII files from a directory, removing the duplicates.
retrieve_faersascii( ascii_dir, cache_path = NULL, drug_indication_pattern = NULL, drug_pattern = NULL, primary_suspect = TRUE, ... )
retrieve_faersascii( ascii_dir, cache_path = NULL, drug_indication_pattern = NULL, drug_pattern = NULL, primary_suspect = TRUE, ... )
ascii_dir |
directory path where ascii files are |
cache_path |
(optional) a string. Must have a ".Rdata" extension to save the read tabular formats in each loop. |
drug_indication_pattern |
(optional) a string.filter ADRs with a specific drug indication pattern (**stringr** sintax) |
drug_pattern |
(optional) a string. filter ADRs with a specific drug name pattern (**stringr** sintax) |
primary_suspect |
(optional) a string. |
... |
directory with duplicate information to be passed to get_duplicate_caseids |
A list with binded tibbles retrieved from files.
Convert FAERS xml to tabular format
retrieve_faersxml( xml_address, reaction_wise = TRUE, drug_wise = FALSE, drug_indication_pattern = NULL )
retrieve_faersxml( xml_address, reaction_wise = TRUE, drug_wise = FALSE, drug_indication_pattern = NULL )
xml_address |
XML address to be read |
reaction_wise |
each row corresponds to a reaction (if TRUE, drug_wise cannot be TRUE) |
drug_wise |
each row corresponds to a drug (if TRUE, reaction_wise cannot be TRUE) |
drug_indication_pattern |
filter by ADR with a specific drug indication pattern (**stringr** sintax) |
A tibble corresponding to the XML file
Convert FAERS a number of xml files to tabular format
retrieve_faersxml_all(xml_address_vector, ..., cache_path = NULL)
retrieve_faersxml_all(xml_address_vector, ..., cache_path = NULL)
xml_address_vector |
Vector with XML addresses to be read |
... |
arguments to be passed to retrieve_faersxml |
cache_path |
a string. Must have a ".Rdata" extension to save the read tabular formats in each loop. |
A binded tibble with all the tibbles returned from 'retrieve_faersxml'
Retrieve unique drug and ADR information values from XML files
retrieve_unique_info(xml_address_vector, ...)
retrieve_unique_info(xml_address_vector, ...)
xml_address_vector |
Vector with XML addresses to be read |
... |
arguments to be passed to retrieve_faersxml |
A list with all the unique information on FAERS variables
FAERS description
summary_faersdata(tabular_faers_data)
summary_faersdata(tabular_faers_data)
tabular_faers_data |
a tibble corresponding to the unified FAERS tabular format. Output of function unify_tabular_ascii |
A list with a findings summary
summary_faersdata(als_faers_data_unified)
summary_faersdata(als_faers_data_unified)
Turn the list elements returned from retrieve_faersascii into a tabular format
unify_tabular_ascii(ascii_list)
unify_tabular_ascii(ascii_list)
ascii_list |
list from retrieve_faersascii |
A data frame representing FAERS data, with all components from the list joined.
unify_tabular_ascii(ascii_list = als_faers_data)
unify_tabular_ascii(ascii_list = als_faers_data)
Unzip FAERS zip folders
unzip_faerszip(zip_folders_dir, ex_dir)
unzip_faerszip(zip_folders_dir, ex_dir)
zip_folders_dir |
directory containing FAERS zip folders |
ex_dir |
directory to be exported the unzipped files |
None. Just unzips the folders to a specified location.