Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.8%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: mufflyt
- License: other
- Language: R
- Default Branch: main
- Size: 97.8 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
title: "The tyler package for mystery caller study support"
output: html_document
Warning: This project is under active development. Contributions are welcome!
Please help improve this package by submitting issues (https://github.com/mufflyt/tyler/issues)
and pull requests (https://github.com/mufflyt/tyler/pulls).
<!-- badges: end -->
The tyler package provides a suite of tools for conducting mystery caller studies and facilitating workforce distribution research for obstetrics and gynecology (OBGYN) professionals. It streamlines the process of retrieving and analyzing National Provider Identifier (NPI) data, demographic information, and healthcare access data, while also offering resources for examining OBGYN residency programs.
Key Features - Mystery Caller Studies: Tools to analyze patient access to healthcare by searching for and processing NPI numbers based on names and other criteria. - OBGYN Workforce Distribution: Functions and datasets designed to support workforce research, including detailed information on OBGYN residency programs in the United States.
Installation
You can install the development version of tyler from GitHub with: ``` r
install.packages("devtools")
devtools::install_github("mufflyt/tyler") ```
See the package vignette for a fuller introduction and suggestions on how to use the tyler() function efficiently.
Tyler Package Data Overview
This document describes key datasets included in the tyler package, focusing on the ACOG districts, physicians, and taxonomy codes used in healthcare provider identification.
DATA
DATA: tyler::acgme
The dataset tyler::acgme provides detailed information about OBGYN residency programs accredited by the Accreditation Council for Graduate Medical Education (ACGME). This dataset includes fields such as program name, location, accreditation date, program director, and affiliated hospitals. It is a valuable resource for mapping and analyzing OBGYN residencies across the U.S. Dataframe of the OBGYN residency programs scraped from https://apps.acgme.org/ads/Public/Programs/Search. Name, city, state, accreditation date, program director name, website, rotations, and affiliated hospitals are included.
'tyler::acgme' - This is a dataframe of every OBGYN residency from the ACGME web site. This data can be used to map the obgyn residencies, etc.
```r
obgyn_residencies <- tyler::acgme
View the first few rows
head(obgyn_residencies) ```
```r
A tibble: 318 142
programname address zip city state sponsoringinstituti sponsoringinstituti phone originalaccreditati
1 University of Ala "Unive 35249 Birm Alab 010498 University of Alabama (205 September 01, 1949
2 USA Health Program "Unive 36604 Mobi Alab 010406 USA Health (251 August 01, 1960
3 University of Ari "Banne 85006 Phoe Ariz 038179 University of Arizona (602 May 07, 1951
Example: Filter for residency programs in California
caresidencies <- dplyr::filter(obgynresidencies, state == "CA") print(ca_residencies) ```
DATA: 'tyler::ACOG_Districts'
The American College of Obstetricians and Gynecologists (ACOG) is a professional organization representing obstetricians and gynecologists in the United States. ACOG divides its membership into various geographical regions known as "ACOG Districts." Because there are single-state ACOG Districts (e.g., California, Texas, Florida) we also need to use US Census Bureau subdivisions. Subdivisions are important for census and statistical purposes because they help organize and categorize population data at the local level.
This dataset includes: - State names: Full name of each U.S. state. - ACOG Districts: The corresponding ACOG district for each state. - Subregions: U.S. Census Bureau subregions that help organize population data. - State abbreviations: The official two-letter postal abbreviations for each state.
r
acog_districts <- tyler::ACOG_Districts
head(tyler::ACOG_Districts)
```r
A tibble: 52 4
State ACOGDistrict Subregion StateAbbreviations
1 Alabama District VII District VII AL
2 Alaska District VIII District VIII AK
3 Arizona District VIII District VIII AZ
4 Arkansas District VII District VII AR
5 California District IX District IX CA
6 Colorado District VIII District VIII CO
7 Connecticut District I District I CT
8 Delaware District IV District IV DE
9 District of Columbia District IV District IV DC
10 Florida District XII District XII FL
```
This dataset is useful for research on the geographic distribution of OBGYN professionals and their affiliations with ACOG districts.
DATA: tyler::physicians
This dataset contains details of OBGYN subspecialists, including their names, specialties, and geographic coordinates. The Physicians.rds file, located at tyler/inst/extdata, stores the internal dataset.
This dataset includes:
- NPI: National Provider Identifier, a unique identifier for healthcare providers in the U.S.
- Name: Physician's full name.
- Subspecialty: Physician's specific area of expertise within OBGYN.
- Latitude/Longitude: Geographic coordinates of the physician's practice.
r
tyler::physicians
```r
A tibble: 4,659 5
NPI name subspecialty lat long
<dbl> <chr> <chr> <dbl> <dbl>
1 1922051358 Katherine Boyd Female Pelvic Medicine and Reconstructive Surgery 42.6 -82.9 2 1750344388 Thomas Byrne Maternal-Fetal Medicine 35.2 -102. 3 1548520133 Bobby Garcia Female Pelvic Medicine and Reconstructive Surgery 40.8 -73.9 ```
DATA: tyler::taxonomy
Physician Taxonomy Codes and the NPPES (National Plan and Provider Enumeration System) database are essential components of the healthcare system in the United States. These codes play a crucial role in identifying and categorizing healthcare providers for various purposes, including billing, insurance, and regulatory compliance.
The tyler::taxonomy dataset is a dataframe containing NUCC taxonomy codes used in NPPES data files. Each taxonomy code consists of a unique ten-character identifier that helps classify healthcare providers by their type and area of expertise. The dataset includes OBGYN taxonomy codes, as of Version 23.1 from 7/1/2023. You can find more details on the NUCC website.
Example:
```r obgyntaxonomy <- tyler::taxonomy %>% filter(strdetect(Classification, fixed("GYN", ignore_case = TRUE))) %>% select(Code, Specialization)
obgyn_taxonomy ```
```r
A tibble of OBGYN-related taxonomy codes
Code Specialization
1 207V00000X Obstetrics & Gynecology
2 207VC0300X Complex Family Planning
3 207VC0200X Critical Care Medicine
4 207VF0040X Female Pelvic Medicine and Reconstructive Surgery
5 207VX0201X Gynecologic Oncology
6 207VG0400X Gynecology
7 207VH0002X Hospice and Palliative Medicine
8 207VM0101X Maternal & Fetal Medicine
9 207VB0002X Obesity Medicine
10 207VX0000X Obstetrics
11 207VE0102X Reproductive Endocrinology
```
SEARCHING FOR DATA: tyler::search_by_taxonomy
This function searches the NPI Database for healthcare providers based on a taxonomy description. The search_by_taxonomy function is a wrapper on the npi::npi_search accessing the registry's Version 2.1 API. Many thanks to the author and maintainers of the npi package for their amazing work.This helps confirm outside data about subspecialist provider counts and fill in the gaps for providers who are not board-certified but are practicing (board-eligible). This data can be matched to other databases. Please see Exploratory/workforce/subspecialists_only for more code on how to do this. The nice thing is that all these search results will come with an NPI.
```
This will allow us to get subspecialty names and NPI numbers
godata <- searchbytaxonomy("Gynecologic Oncology") fpmrsdata <- searchbytaxonomy("Female Pelvic Medicine and Reconstructive Surgery") reidata <- searchbytaxonomy("Reproductive Endocrinology") mfmdata <- searchbytaxonomy("Maternal & Fetal Medicine")
Merge all data frames into one
all_taxonomy_search_data <- bind_rows(
go_data,
fpmrs_data,
rei_data,
mfm_data) %>%
dplyr::distinct(npi, .keep_all = TRUE)
dim(alltaxonomysearchdata) glimpse(alltaxonomysearchdata) ```
```r
1200 records requested
Requesting records 0-200...
Requesting records 200-400...
```
SEARCHING FOR DATA: tyler::search_and_process_npi
National Provider Identifier Search: Search first names, last names, only individuals enumeration_type = "ind", and only physicians ("MD", "DO") in the United States from the NPPES. NPI numbers provide a standardized way to identify and track healthcare providers, including physicians, across the United States. Government agencies, such as the Centers for Medicare & Medicaid Services (CMS), use NPI-based data to plan and allocate healthcare resources, including provider reimbursements, medical services, and workforce distribution.
```r searchandprocessnpi <- function(inputfile, enumerationtype = "ind", limit = 5L, countrycode = "US", filter_credentials = c("MD", "DO"))
inputfile <- "/Users/tylermuffly/Dropbox (Personal)/Nomogram/nomogram/data/nppessearch/LoRAuthor.csv" outputresult <- searchandprocessnpi(input_file) ```
SEARCHING FOR DATA: tyler::validate_and_remove_invalid_npi
This cleans the NPI numbers before it goes into tyler::retrieve_clinician_data because if one incorrect NPI number is inserted then it screws up the entire search. Saves each find as csv file.
r
input_csv_path <- "~/Dropbox (Personal)/workforce/subspecialists_only.csv" # Replace with the path to your CSV file
valid_df <- validate_and_remove_invalid_npi(input_csv_path)
r
Search result saved as: data/search_results_1053601807_20231119192903.csv
Search result saved as: data/search_results_1528351640_20231119192911.csv
No results for npi = 1063703494
No results for NPI: 1063703494
SEARCHING FOR DATA: tyler::retrieve_clinician_data
This function retrieves clinician data based on validated NPI numbers, using validateandremoveinvalidnpi to filter the NPIs. It logs successful searches, saves results as CSV files, and flags NPIs for which no data is found. The results are timestamped in filenames, ensuring search history is maintained. This function is vital for efficiently gathering clinician data from external sources and storing it for future use. The retrieve_clinician_data function retrieves clinician information from the Medicare Care Compare system. Previously, this data was accessed via Physician Compare, which sunsetted in December 2020. The dataset can be found at CMS Provider Data. Physician Compare has sunset as of December 1, 2020 and has been replaced by: https://www.medicare.gov/care-compare/?redirect=true&providerType=Physician. The entire data set is at https://data.cms.gov/provider-data/dataset/mj5m-pzi6. The very very cool library called provider was super helpful with accessing this.
```r
Call the retrievecliniciandata function with an NPI value
inputcsvpath <- ("~/Dropbox (Personal)/workforce/subspecialistsonly.csv") cliniciandata <- tyler::retrievecliniciandata(inputcsvpath) ```
```r No results for npi = 1093151441 NULL
A tibble: 3 17
npi pac enid first last gender school gradyear specialty facilityname pacorg membersorg addressorg cityorg
1 119406 3476 I202 JACL DENE Female NEW Y 2013 OBSTETRI SPECTRUM HEA 458756 1551 25 MICHIGA GRAND R
2 119406 3476 I202 JACL DENE Female NEW Y 2013 OBSTETRI SPECTRUM HEA 458756 1551 4444 KALAM KENTWOOD
3 119406 3476 I202 JACL DENE Female NEW Y 2013 OBSTETRI SPECTRUM HEA 458756 1551 4069 LAKE GRAND R
3 more variables: stateorg , zip org , phone_org
```
SEARCHING FOR DATA: tyler::genderize_physicians
This is a wrapper around the gender package to help fill in the gender of physician names. It requires a csv with a column called first_name. A lot of gender data was found via Physician Compare in the past.
r
tyler::genderize_physicians <- function(input_csv)
SEARCHING FOR DATA: tyler::geocode_unique_addresses
Takes a csv file of addresses and prints out the lat and long as separate columns. You will need a googlemapsapikey. Geocoding is the process of converting human-readable addresses or place names into geographic coordinates (latitude and longitude) that can be used to locate places on a map. The Google Geocoding API is a service provided by Google that allows developers to perform geocoding and reverse geocoding, which is the process of converting coordinates back into human-readable addresses. ```r outputdata <- tyler::geocodeuniqueaddresses(filepath = "/Users/tylermuffly/Dropbox (Personal)/Tannous/data/addressforgeocoding.csv", googlemapsapikey = "????", outputfilepath = "/Users/tylermuffly/Dropbox (Personal)/Tannous/data/geocodeduniqueaddresses.csv") ```
CREATING MYSTERY CALLER DATA/PHASE 1
Creating Mystery Caller Data/Phase 1: tyler::city_state_sample_specialists
This script samples specialists based on city and state data and performs analyses based on their geographic location. ```r
Example: Sampling specialists based on city and state
data <- data.frame(city = c("Denver", "Chicago"), state = c("CO", "IL"), specialists = c(5, 3)) citystatesample_specialists(data)
Example with stratified sampling
citystatesample_specialists(data, stratified = TRUE) ```
Creating Mystery Caller Data/Phase 1: tyler::city_state_assign_scenarios
This script assigns city and state data to different scenarios, mapping geographic information to scenario datasets. ```r
Example: Assigning city and state to scenarios
data <- data.frame(city = c("Denver", "Chicago"), state = c("CO", "IL")) citystateassign_scenarios(data)
Example with multiple scenarios
scenarios <- list(scenario1 = data, scenario2 = data) citystateassign_scenarios(scenarios) ```
METHODS SECTION
tyler::poisson_formula_maker
The poisson_formula_maker function constructs a formula for a Poisson regression model based on specified predictor variables. It is typically used before running Poisson models, such as in fit_poisson_models, to streamline model fitting for count-based data like waiting times.
```r
Example: Create a Poisson regression formula
poissonformula <- poissonformulamaker(predictorvars = c("age", "gender", "insurance"))
View the formula
print(poisson_formula) ```
METHODS SECTION
tyler::generate_latex_equation
This function generates a LaTeX-formatted equation from an input model or formula. It is commonly used after fitting statistical models like regression to present the final equation in a document or report. This function complements functions like tyler::linear_regression_summary_sentence and tyler::logistic_regression, which generate human-readable summaries, allowing for both text and formula outputs.
```r
Example: Generate LaTeX equation from a linear model
model <- lm(mpg ~ cyl + disp, data = mtcars) latexequation <- generatelatex_equation(model)
View the LaTeX equation
print(latex_equation) ```
RESULTS SECTION
tyler::generate_overall_table
This function generates a summary table of demographics based on Table 1 data. It supports multiple file formats, including RDS, CSV, and XLS, and logs each key step, such as inputs, data transformations, and file paths. You can select specific columns and apply custom label translations. It ensures the output directory exists and saves the generated table as a PDF. Error handling ensures the function validates data and logs any issues that occur during execution. ```r
Example: Generating an overall table
generateoveralltable(inputfilepath = "data/Table1.rds", outputdirectory = "outputtables")
Example with selected columns
generateoveralltable(inputfilepath = "data/Table1.csv", outputdirectory = "outputtables", selected_columns = c("age", "gender"))
Example with label translations
labeltranslations <- list(age = "Age (years)", gender = "Gender") generateoveralltable(inputfilepath = "data/Table1.xlsx", outputdirectory = "outputtables", labeltranslations = label_translations) ```
RESULTS SECTION
tyler::count_unique_physicians
This script counts the number of unique physicians in a dataset based on a unique identifier such as NPI. ```r
Example: Counting unique physicians
data <- data.frame(NPI = c("12345", "67890", "12345", "54321")) countuniquephysicians(data)
Example with a custom identifier column
countuniquephysicians(data, id_column = "NPI") ```
RESULTS SECTION
tyler::calculate_descriptive_stats
This function computes descriptive statistics, such as means, medians, and standard deviations for datasets, covering both categorical and numerical variables. You can customize it to calculate statistics for selected columns. It logs its progress and saves results in a structured format, making it highly flexible for analyzing datasets. This function is key for quickly summarizing large datasets systematically.
```r
Example: Calculating descriptive statistics
data <- data.frame(age = c(23, 35, 40, 29, 50), gender = c("M", "F", "M", "F", "M")) calculatedescriptivestats(data)
Example with selected columns
calculatedescriptivestats(data, selected_columns = c("age")) ```
RESULTS SECTION
tyler::calc_percentages
This script calculates percentages for a given dataset. It can calculate the percentage of each category for categorical variables and optionally handle missing data. ```r
Example: Calculating percentages
data <- data.frame(category = c("A", "B", "A", "C", "B", "A")) calc_percentages(data)
Example with missing data handling
calcpercentages(data, handlemissing = TRUE) ```
RESULTS SECTION
tyler::calculate_distribution
This script calculates the distribution of values for numerical and categorical variables in a dataset. ```r
Example: Calculating distribution
data <- data.frame(value = c(1, 2, 2, 3, 3, 3, 4)) calculate_distribution(data)
Example with categorical variables
data <- data.frame(category = c("A", "B", "A", "C", "B")) calculatedistribution(data, variabletype = "categorical") ```
RESULTS SECTION
tyler::calculate_proportion
This script calculates the proportion of a specific event or category in a dataset. ```r
Example: Calculating proportion
data <- data.frame(category = c("A", "B", "A", "C", "B")) calculate_proportion(data, event = "A")
Example with a custom threshold
calculate_proportion(data, event = "B", threshold = 0.2) ```
RESULTS SECTION
tyler::check_normality
This script checks the normality of a numeric dataset using statistical tests and graphical methods such as QQ plots. ```r
Example: Checking normality of a dataset
data <- data.frame(value = c(10, 12, 15, 13, 14, 15, 18)) check_normality(data)
Example with a specific significance level
checknormality(data, significancelevel = 0.05) ```
RESULTS SECTION
tyler::poisson_wait_time_stats
This function analyzes wait time statistics using a Poisson model. It is designed to model count-based data, like the number of appointments or waiting times. It complements poisson_formula_maker and fit_poisson_models, as it helps in understanding the distribution and determinants of wait times.
```r
Example: Calculate Poisson wait time statistics
waittimestats <- poissonwaittimestats(df = appointmentsdata, targetvariable = "waittime")
View the wait time statistics
print(waittimestats) ```
RESULTS SECTION
tyler::create_and_plot_interaction
This script creates interaction models between variables and plots the results. ```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
RESULTS FIGURES
tyler::create_forest_plot
The create_forest_plot function creates a forest plot for significant predictors, displaying coefficients and confidence intervals. It is used after fitting statistical models, such as Poisson or logistic regression, to visualize the key predictors and their effects. This function is often paired with model-fitting functions like fit_poisson_models or fit_mixed_model_with_logging.
```r
Example: Creating a forest plot for significant predictors
df <- data.frame(predictor = c("age", "gender", "income"), estimate = c(0.2, -0.5, 0.3), lower = c(0.1, -0.7, 0.2), upper = c(0.3, -0.3, 0.5)) createforestplot(df, "targetvariable", significantvars = df) ```
RESULTS FIGURES
tyler::create_insurance_by_insurance_scatter_plot
The create_insurance_by_insurance_scatter_plot function creates a scatter plot comparing waiting times between two insurance types. It complements data cleaning or processing functions that prepare appointment data for visualization, such as determine_direction. This plot is useful for visually comparing the performance of insurance providers in terms of wait times.
```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
RESULTS FIGURES
tyler::create_line_plot
The createlineplot function generates line plots for visualizing trends over time or other continuous variables. It is commonly used after calculating descriptive statistics or when analyzing trends across time-based data. It works well with summarized or grouped data from functions like calculatedescriptivestats. ```r
Example: Creating a line plot
createlineplot(df, x = "year", y = "appointments", group = "insurance") ```
RESULTS FIGURES
tyler::create_scatter_plot
This function creates scatter plots, allowing the comparison of two continuous variables, optionally with a linear regression line. It is useful for exploratory data analysis or visualizing relationships between variables. This function complements descriptive statistics or correlation analysis functions. ```r
Example: Creating a scatter plot
createscatterplot(df, x = "income", y = "appointmentdays", addregression = TRUE) ```
RESULTS SECTION
tyler::create_and_plot_interaction
This script creates interaction models between variables and plots the results. ```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
RESULTS SECTION
tyler::linear_regression_summary_sentence
This function generates a summary sentence for linear regression results, making it easier to present findings in a clear and concise manner. It is typically used after fitting a linear regression model and complements functions like generatelatexequation by providing both a textual and formulaic summary of the results. ```r
Example: Generate summary sentence for linear regression
model <- lm(mpg ~ wt + hp, data = mtcars) summarysentence <- linearregressionsummarysentence(model)
View the summary sentence
print(summary_sentence) ```
RESULTS SECTION
tyler::logistic_regression
This function generates a summary sentence for linear regression results, making it easier to present findings in a clear and concise manner. It is typically used after fitting a linear regression model and complements functions like generatelatexequation by providing both a textual and formulaic summary of the results. ```r
Example: Generate summary sentence for linear regression
model <- lm(mpg ~ wt + hp, data = mtcars) summarysentence <- linearregressionsummarysentence(model)
View the summary sentence
print(summary_sentence) ```
RESULTS SECTION
tyler::MaxTable
The tyler::MaxTable function creates a summary table that highlights the maximum values of key metrics across categories. It is often used in conjunction with other descriptive analysis functions, such as generateoveralltable, to provide deeper insights into maximum performance metrics.
```r
Example: Generate a MaxTable for the dataset
maxtable <- MaxTable(df = mtcars, groupvariable = "cyl", value_variable = "mpg")
View the MaxTable
print(max_table) ```
RESULTS SECTION
tyler::MinTable
The MinTable function creates a summary table highlighting the minimum values of key metrics across different categories. It is often used alongside MaxTable to provide a complete range of insights by showing the minimum performance or outcomes within each group. This is especially useful in comparative studies. ```r
Example: Generate a MinTable for the dataset
mintable <- MinTable(df = mtcars, groupvariable = "cyl", value_variable = "mpg")
View the MinTable
print(min_table) ```
RESULTS SECTION
tyler::most_common_gender_training_academic
This function identifies the most common gender and training type among academic physicians. It complements demographic analysis functions like physician_age and is useful in studies focused on the characteristics of healthcare providers, particularly in academic settings. ```r
Example: Identify the most common gender and training type among academic physicians
commongendertraining <- mostcommongendertrainingacademic(df = physicians_data)
View the results
print(commongendertraining) ```
RESULTS SECTION
tyler::physician_age
The physician_age function calculates the age of physicians based on their birth year or similar data. It is a core function used in demographic analyses and is often paired with functions like most_common_gender_training_academic to provide a more complete understanding of the physician workforce.
```r#
Example: Calculate physician age
physicianages <- physicianage(df = physiciansdata, birthyearcol = "birthyear")
View the ages
print(physician_ages) ```
RESULTS SECTION
tyler::plot_and_save_emmeans
This function creates and saves plots for estimated marginal means (EMMeans) from a fitted model. It is often used after running statistical models, such as Poisson or mixed-effects models, to visualize group differences. This function complements fit_poisson_models and fit_mixed_model_with_logging.
```r
Example: Plot and save EMMeans from a fitted model
emmeansplot <- plotandsaveemmeans(model = fittedmodel, variables = c("age", "gender"), outputdir = "plots/")
View the plot
print(emmeans_plot) ```
RESULTS SECTION
tyler::create_and_plot_interaction
This script creates interaction models between variables and plots the results. ```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
RESULTS SECTION
tyler::create_and_plot_interaction
This script creates interaction models between variables and plots the results. ```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
RESULTS SECTION
tyler::create_and_plot_interaction
This script creates interaction models between variables and plots the results. ```r
Example: Creating an interaction plot
data <- data.frame(var1 = c(1, 2, 3, 4), var2 = c(5, 6, 7, 8)) createandplot_interaction(data, var1 = "var1", var2 = "var2")
Example with customized plot settings
createandplotinteraction(data, var1 = "var1", var2 = "var2", plottitle = "Interaction Plot") ```
HELPER FUNCTIONS
tyler::install_missing_packages
This utility function checks for missing R packages and installs them if necessary. It is often used at the start of an analysis script to ensure all required packages are installed. This function complements any function that relies on external packages, ensuring a smooth workflow without interruptions.
```r
Example: Install missing packages
requiredpackages <- c("ggplot2", "dplyr", "readr") installmissingpackages(requiredpackages) ```
HELPER FUNCTIONS
tyler::load_data
This function loads data from various file formats (e.g., CSV, RDS, Excel) and prepares it for analysis. It is one of the first steps in any analysis workflow, providing clean data for subsequent steps like model fitting or visualization. It complements all other functions that rely on having a dataset loaded into memory.
```r
Example: Load data from a CSV file
data <- loaddata("data/mydata.csv")
Example: Load data from an RDS file
data <- loaddata("data/mydata.rds") ```
HELPER FUNCTIONS
tyler::tm_write2pdf
This function saves an arsenal-generated table object to a PDF file. It logs where the PDF is saved and ensures the PDF is written without unnecessary output. This function streamlines the process of converting arsenal tables into PDF files, retaining markdown elements and ensuring efficient saving of multiple summaries.
Contributing
We welcome contributions! If you'd like to help improve the tyler package, feel free to submit issues or pull requests.
Citation
If you use this package, I would appreciate a citation.
citation("tyler")
Code of conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Owner
- Name: Tyler Muffly
- Login: mufflyt
- Kind: user
- Location: Denver, Colorado
- Company: Denver Health and Hospital Authority
- Website: www.tylermuffly.com
- Repositories: 1
- Profile: https://github.com/mufflyt
I am a urogynecologist and Associate Professor at Denver Health Hospital.
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "tyler",
"description": "The 'tyler' package provides a collection of functions designed to facilitate mystery caller studies, often used in evaluating patient access to healthcare. It includes tools for searching and processing National Provider Identifier (NPI) numbers based on names and analyzing demographic data associated with these NPIs. The package simplifies the handling of NPI data and the creation of informative tables for analysis and reporting.",
"name": "tyler: Common Functions for Mystery Caller or Audit Studies Evaluating Patient Access to Care",
"codeRepository": "https://github.com/mufflyt/mystery",
"issueTracker": "https://github.com/mufflyt/tyler/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.2.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.2 (2024-10-31)",
"maintainer": [
{
"@type": "Person",
"givenName": "Tyler",
"familyName": "Muffly",
"email": "tyler.muffly@dhha.org"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
"name": "rmarkdown",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rmarkdown"
},
{
"@type": "SoftwareApplication",
"identifier": "data.table",
"name": "data.table",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=data.table"
}
],
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 3.5.0"
},
"2": {
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
"3": {
"@type": "SoftwareApplication",
"identifier": "glue",
"name": "glue",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=glue"
},
"4": {
"@type": "SoftwareApplication",
"identifier": "lifecycle",
"name": "lifecycle",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=lifecycle"
},
"5": {
"@type": "SoftwareApplication",
"identifier": "npi",
"name": "npi",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=npi"
},
"6": {
"@type": "SoftwareApplication",
"identifier": "progress",
"name": "progress",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=progress"
},
"7": {
"@type": "SoftwareApplication",
"identifier": "purrr",
"name": "purrr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=purrr"
},
"8": {
"@type": "SoftwareApplication",
"identifier": "stringr",
"name": "stringr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=stringr"
},
"9": {
"@type": "SoftwareApplication",
"identifier": "tibble",
"name": "tibble",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tibble"
},
"10": {
"@type": "SoftwareApplication",
"identifier": "tidyr",
"name": "tidyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tidyr"
},
"11": {
"@type": "SoftwareApplication",
"identifier": "logger",
"name": "logger",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=logger"
},
"12": {
"@type": "SoftwareApplication",
"identifier": "arsenal",
"name": "arsenal",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=arsenal"
},
"13": {
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggplot2"
},
"14": {
"@type": "SoftwareApplication",
"identifier": "sf",
"name": "sf",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=sf"
},
"15": {
"@type": "SoftwareApplication",
"identifier": "httr",
"name": "httr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=httr"
},
"16": {
"@type": "SoftwareApplication",
"identifier": "readr",
"name": "readr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=readr"
},
"17": {
"@type": "SoftwareApplication",
"identifier": "rlang",
"name": "rlang",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rlang"
},
"18": {
"@type": "SoftwareApplication",
"identifier": "viridis",
"name": "viridis",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=viridis"
},
"19": {
"@type": "SoftwareApplication",
"identifier": "hereR",
"name": "hereR",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=hereR"
},
"20": {
"@type": "SoftwareApplication",
"identifier": "effects",
"name": "effects",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=effects"
},
"21": {
"@type": "SoftwareApplication",
"identifier": "ggmap",
"name": "ggmap",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggmap"
},
"22": {
"@type": "SoftwareApplication",
"identifier": "tigris",
"name": "tigris",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tigris"
},
"23": {
"@type": "SoftwareApplication",
"identifier": "fs",
"name": "fs",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=fs"
},
"24": {
"@type": "SoftwareApplication",
"identifier": "jsonlite",
"name": "jsonlite",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=jsonlite"
},
"25": {
"@type": "SoftwareApplication",
"identifier": "lme4",
"name": "lme4",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=lme4"
},
"26": {
"@type": "SoftwareApplication",
"identifier": "magrittr",
"name": "magrittr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=magrittr"
},
"27": {
"@type": "SoftwareApplication",
"identifier": "methods",
"name": "methods"
},
"28": {
"@type": "SoftwareApplication",
"identifier": "provider",
"name": "provider",
"sameAs": "https://github.com/andrewallenbruce/provider"
},
"29": {
"@type": "SoftwareApplication",
"identifier": "scales",
"name": "scales",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=scales"
},
"30": {
"@type": "SoftwareApplication",
"identifier": "tidycensus",
"name": "tidycensus",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tidycensus"
},
"31": {
"@type": "SoftwareApplication",
"identifier": "tigris",
"name": "tigris",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tigris"
},
"32": {
"@type": "SoftwareApplication",
"identifier": "gender",
"name": "gender",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=gender"
},
"33": {
"@type": "SoftwareApplication",
"identifier": "genderdata",
"name": "genderdata",
"sameAs": "https://github.com/lmullen/genderdata"
},
"34": {
"@type": "SoftwareApplication",
"identifier": "emmeans",
"name": "emmeans",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=emmeans"
},
"35": {
"@type": "SoftwareApplication",
"identifier": "zipcodeR",
"name": "zipcodeR",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=zipcodeR"
},
"SystemRequirements": null
},
"fileSize": "0KB",
"relatedLink": "https://mufflyt.github.io/tyler/mysteryshopper",
"releaseNotes": "https://github.com/mufflyt/mystery/blob/master/NEWS.md",
"readme": "https://github.com/mufflyt/mystery/blob/main/README.md"
}
GitHub Events
Total
- Push event: 55
- Create event: 1
Last Year
- Push event: 55
- Create event: 1
Dependencies
- r-hub/actions/checkout v1 composite
- r-hub/actions/platform-info v1 composite
- r-hub/actions/run-check v1 composite
- r-hub/actions/setup v1 composite
- r-hub/actions/setup-deps v1 composite
- r-hub/actions/setup-r v1 composite
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action v4.5.0 composite
- actions/checkout v4 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v4 composite
- r-lib/actions/pr-fetch v2 composite
- r-lib/actions/pr-push v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- codecov/codecov-action v4 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- R >= 3.5.0 depends
- DBI * imports
- arsenal * imports
- beepr * imports
- broom * imports
- caret * imports
- censusapi * imports
- conflicted * imports
- data.table * imports
- devtools * imports
- dplyr * imports
- duckdb * imports
- easyr * imports
- effects * imports
- emmeans * imports
- exploratory * imports
- fs * imports
- gender * imports
- genderdata * imports
- ggmap * imports
- ggplot2 * imports
- ggspatial * imports
- glue * imports
- gridExtra * imports
- here * imports
- hereR * imports
- htmlwidgets * imports
- httr * imports
- humaniformat * imports
- imager * imports
- janitor * imports
- jsonlite * imports
- knitr * imports
- leaflet * imports
- leaflet.extras * imports
- lifecycle * imports
- lme4 * imports
- lmerTest * imports
- logger * imports
- lubridate * imports
- magrittr * imports
- maps * imports
- memoise * imports
- methods * imports
- mockery * imports
- npi * imports
- openxlsx * imports
- progress * imports
- provider * imports
- purrr * imports
- rainbow * imports
- readr * imports
- readxl * imports
- remotes * imports
- rlang * imports
- rmarkdown * imports
- rnaturalearth * imports
- robustlmm * imports
- scales * imports
- sf * imports
- stats * imports
- stringr * imports
- testthat * imports
- tibble * imports
- tidyr * imports
- tigris * imports
- viridis * imports
- webshot * imports
- zipcodeR * imports