| Title: | DELTA Analytic Tools and Learning Curve Analysis |
|---|---|
| Description: | A collection of tools for researchers interested in carrying out parametric estimation of learning curves and device effects based on the publication by Ssemaganda et al. (2025) <doi:10.2147/MDER.S520191> with modified versions of propensity score matching (PSM) and inverse probability of treatment weighting (IPTW). |
| Authors: | Michael Matheny [aut, cph] (ORCID: <https://orcid.org/0000-0003-3217-4147>), Frederic Resnic [aut, cph] (ORCID: <https://orcid.org/0000-0002-4105-4529>), Henry Ssemaganda [aut, cph] (ORCID: <https://orcid.org/0009-0001-2877-3465>), Jejo Koola [aut, cph] (ORCID: <https://orcid.org/0000-0001-5171-8475>), Amy Perkins [aut, cph, cre] (ORCID: <https://orcid.org/0000-0001-9052-3558>) |
| Maintainer: | Amy Perkins <[email protected]> |
| License: | GPL-2 | GPL-3 |
| Version: | 0.1.4 |
| Built: | 2026-09-28 15:53:39 UTC |
| Source: | https://github.com/cran/DeltaTools |
A synthetic patient population generated for learning effect and device signal detection using this function.
data.plcdata.plc
data.plcA data frame with 11,808 rows and 41 columns:
Patient identifier
Operator identifier
Institution identifier
Case Order across all observations
Case Order across that institution
Case Order across that operator
Procedure date
Time period during which the case procedure occurred
Time period during which the case outcome occurred
Case Order across that institution and Device A
Case Order across that institution and Device B
Case Order across that operator and Device A
Case Order across that oeprator and Device B
Device placed during the procedure
Outcome variable
Patient factor 1
Patient factor 2
Patient factor 3
Patient factor 4
Patient factor 5
Patient factor 6
Patient factor 7
Patient factor 8
Patient factor 9
Patient factor 10
Patient factor 11
Patient factor 12
Patient factor 13
Patient factor 14
Patient factor 15
Patient factor 16
Patient factor 17
Patient factor 18
Patient factor 19
Patient factor 20
Patient factor 21
Operator factor 1
Operator factor 2
Institution factor 1
Institution factor 2
Institution factor 3
A synthetic patient population generated for use with the functions propensity score matching or inverse probability of treatment weighting.
data.psdata.ps
data.psA data frame with 29,778 rows and 24 columns:
Hypertension indicator
30-day mortality indicator
Aspirin use indicator
Warfarin use indicator
Pre-procedure serum creatinine level in mg/dL
Fluoroscopy time in minutes
Non-ST-Elevation Myocardial Infarction at presentation indicator
Procedure date
Number of blocked vessels at index percutaneous coronary intervention
Patient identifier
Hospital readmission indicator
History of percutaneous coronary intervention indicator
Emergent case indicator
Total admitted percutaneous coronary interventions
Chronic lung disease indicator
Smoker indicator
Female sex
Dialysis indicator
Diabetes indicator
Peripheral arterial disease indicator
Repeat procedure indicator
Device B indicator
Patient age in years
Patient BMI in kg/m2
DeltaTools Function: iptwDT
iptwDT( data, outcomes, exposure, covariates.factor, covariates.continuous, identifier, link = "logit", avs = TRUE, lambda = "lambda.min", postmatch.adjusted.model = FALSE, allow.trimming = TRUE, allow.stabilization = TRUE, lower.cutoff = 5, upper.cutoff = 95, smd.t1 = 0.1, smd.t2 = 0.25 )iptwDT( data, outcomes, exposure, covariates.factor, covariates.continuous, identifier, link = "logit", avs = TRUE, lambda = "lambda.min", postmatch.adjusted.model = FALSE, allow.trimming = TRUE, allow.stabilization = TRUE, lower.cutoff = 5, upper.cutoff = 95, smd.t1 = 0.1, smd.t2 = 0.25 )
data |
The data frame. |
outcomes |
A character vector of one or more outcomes. |
exposure |
A character string with the exposure. |
covariates.factor |
A character vector of factor covariates. |
covariates.continuous |
A character vector of continuous covariates. |
identifier |
A character string with the record identifier. |
link |
Specify the link function as "logit" or "probit". |
avs |
Set to TRUE to run automatic variable selection. |
lambda |
Specify lambda as "lambda.min" or "lambda.1se". |
postmatch.adjusted.model |
Set to TRUE to adjust for additional variables in a logistic regression model on the matched cohort. |
allow.trimming |
Set to TRUE to trim weights. |
allow.stabilization |
Set to TRUE to stabilize weights. |
lower.cutoff |
Quantile for lower cutoff to trim weights, only used if allow.trimming = TRUE. Otherwise, specify NULL. |
upper.cutoff |
Quantile for upper cutoff to trim weights, only used if allow.trimming = TRUE. Otherwise, specify NULL. |
smd.t1 |
Standardized mean difference threshold 1 (more conservative). |
smd.t2 |
Standardized mean difference threshold 2 (less conservative). |
A list containing relevant messages about the weighting and modeling process, descriptive statistics for the unweighted and weighted cohorts stratified by exposure variable, covariate balance assessment, and logistic regression modeling summaries.
# Inverse Probability of Treatment Weighting with automatic variable selection and # trimmed, stabilized weights wt <- iptwDT(data=data.ps, outcomes=c("Mortality30D", "Readmission", "RepeatProc"), exposure="DeviceB", covariates.factor=c("Aspirin", "ChrLungDis", "Diabetes", "Dialysis", "Emergent", "Female", "Hypertension", "NSTEMIatPresent", "PeripheralArterialDis", "PriorPCI", "Smoker", "Warfarin"), covariates.continuous=c("Age", "BMI", "CreatPreProc_mgdl", "FluoroMins", "NumVesselsIndexPCI", "TotalAdmitPCI"), identifier="Patient")# Inverse Probability of Treatment Weighting with automatic variable selection and # trimmed, stabilized weights wt <- iptwDT(data=data.ps, outcomes=c("Mortality30D", "Readmission", "RepeatProc"), exposure="DeviceB", covariates.factor=c("Aspirin", "ChrLungDis", "Diabetes", "Dialysis", "Emergent", "Female", "Hypertension", "NSTEMIatPresent", "PeripheralArterialDis", "PriorPCI", "Smoker", "Warfarin"), covariates.continuous=c("Age", "BMI", "CreatPreProc_mgdl", "FluoroMins", "NumVesselsIndexPCI", "TotalAdmitPCI"), identifier="Patient")
DeltaTools Function: PLCAnalysis
PLCAnalysis( data, datasetIdentifier = "Dataset1", caseIDFieldNM, caseDateFieldNM, outcomeFieldNM, orderFieldNM, operatorFieldNM, covariateFieldNMs, exposureFieldNM, exposureOfInterestNM, exposureOfInterestOperatorCaseSeriesFieldNM, allowIPTWWeighting = FALSE, normalizeIPTWWeights = FALSE, useGeneralCovariateFieldNMs = TRUE, iptwCovariateFieldNMs = c(), allowOperatorClustering = FALSE, allowGAMBasedAVS = FALSE, learningUnadjustedSignalRequired = TRUE, leDetectionAlpha = 0.05, lcEstimationAlpha = 0.05, bootstraps = 0, forceEstimationAsymptoteToZero = TRUE, deviceSignalEstimationAlpha = 0.05 )PLCAnalysis( data, datasetIdentifier = "Dataset1", caseIDFieldNM, caseDateFieldNM, outcomeFieldNM, orderFieldNM, operatorFieldNM, covariateFieldNMs, exposureFieldNM, exposureOfInterestNM, exposureOfInterestOperatorCaseSeriesFieldNM, allowIPTWWeighting = FALSE, normalizeIPTWWeights = FALSE, useGeneralCovariateFieldNMs = TRUE, iptwCovariateFieldNMs = c(), allowOperatorClustering = FALSE, allowGAMBasedAVS = FALSE, learningUnadjustedSignalRequired = TRUE, leDetectionAlpha = 0.05, lcEstimationAlpha = 0.05, bootstraps = 0, forceEstimationAsymptoteToZero = TRUE, deviceSignalEstimationAlpha = 0.05 )
data |
The data frame. |
datasetIdentifier |
A character string with the dataset identifier. |
caseIDFieldNM |
A character string with the case identifier. |
caseDateFieldNM |
A character string with the case date field. |
outcomeFieldNM |
A character string with the outcome. |
orderFieldNM |
A character string with the case order field. |
operatorFieldNM |
A character string with the operator field. |
covariateFieldNMs |
A character vector of covariates to adjust for in the model. |
exposureFieldNM |
A character string with the exposure. |
exposureOfInterestNM |
A character string with the exposure value of interest. |
exposureOfInterestOperatorCaseSeriesFieldNM |
A character string with the exposure of interest operator case series field. |
allowIPTWWeighting |
Set to TRUE to allow Inverse Probability of Treatment Weighting. |
normalizeIPTWWeights |
Set to TRUE to normalize IPTW weights. |
useGeneralCovariateFieldNMs |
Set to TRUE to use general covariate field names for IPTW. |
iptwCovariateFieldNMs |
A character vector of covariate field names for IPTW, used when useGeneralCovariateFieldNMs=TRUE. |
allowOperatorClustering |
Set to TRUE to allow operator clustering. |
allowGAMBasedAVS |
Set to TRUE to allow generalized additive model-based automatic variable selection. |
learningUnadjustedSignalRequired |
Set to TRUE to require a learning unadjusted signal be detected before attempting to detect the presence of a learning effect. |
leDetectionAlpha |
The alpha level for learning detection; the default value is 0.05. |
lcEstimationAlpha |
The alpha level for learning curve estimation; the default value is 0.05. |
bootstraps |
The default value for the number of bootstrapped samples is 0; may add other options in the future. |
forceEstimationAsymptoteToZero |
Defaults to TRUE to force the estimation asymptote to zero; may add other options in the future. |
deviceSignalEstimationAlpha |
The alpha level for device signal estimation; the default value is 0.05. |
A list containing relevant messages about detection of a learning effect and device signal, modeling summaries of the learning unadjusted signal, modeling summaries of the learning adjusted signal, learning detection summaries, and the GAM plot (if applicable).
# Retrospective Parametric Learning Curve Analysis # Learning effect not detected, unadjusted device signal detected plc <- PLCAnalysis(data=data.plc, datasetIdentifier="Dataset1", caseIDFieldNM="Patient", caseDateFieldNM="ProcDate", outcomeFieldNM="Outcome_Final", orderFieldNM="CaseOrder_All", operatorFieldNM="Operator", covariateFieldNMs=c("Pt_F1", "Pt_F2", "Pt_F3", "Pt_F4", "Pt_F5", "Pt_F6", "Pt_F7", "Pt_F8", "Pt_F9", "Pt_F10", "Pt_F11", "Pt_F12", "Pt_F13", "Pt_F14", "Pt_F15", "Pt_F16", "Pt_F17", "Pt_F18", "Pt_F19", "Pt_F20", "Pt_F21", "Op_F1", "Op_F2", "Inst_F1", "Inst_F2", "Inst_F3"), exposureFieldNM="Device", exposureOfInterestNM="B", exposureOfInterestOperatorCaseSeriesFieldNM="CaseOrder_Op_DevB")# Retrospective Parametric Learning Curve Analysis # Learning effect not detected, unadjusted device signal detected plc <- PLCAnalysis(data=data.plc, datasetIdentifier="Dataset1", caseIDFieldNM="Patient", caseDateFieldNM="ProcDate", outcomeFieldNM="Outcome_Final", orderFieldNM="CaseOrder_All", operatorFieldNM="Operator", covariateFieldNMs=c("Pt_F1", "Pt_F2", "Pt_F3", "Pt_F4", "Pt_F5", "Pt_F6", "Pt_F7", "Pt_F8", "Pt_F9", "Pt_F10", "Pt_F11", "Pt_F12", "Pt_F13", "Pt_F14", "Pt_F15", "Pt_F16", "Pt_F17", "Pt_F18", "Pt_F19", "Pt_F20", "Pt_F21", "Op_F1", "Op_F2", "Inst_F1", "Inst_F2", "Inst_F3"), exposureFieldNM="Device", exposureOfInterestNM="B", exposureOfInterestOperatorCaseSeriesFieldNM="CaseOrder_Op_DevB")
DeltaTools Function: propensityScoreAnalysis
propensityScoreAnalysis( data, outcomes, exposure, covariates.factor, covariates.continuous, identifier, datefield, link = "logit", avs = TRUE, period.type = "quarter", alpha = 0.05, m.days = 90, m.type = "closest", lambda = "lambda.min", match.date.range = FALSE, m.method = "nearest", m.dist = "glm", m.dist.opt = list(), m.est = "ATT", m.exact = NULL, m.mahvars = NULL, m.antiexact = NULL, m.discard = "none", m.reestimate = FALSE, m.s.weights = NULL, m.replace = FALSE, m.order = "largest", m.caliper = 0.01, m.ratio = 1, m.verbose = FALSE, m.include.obj = FALSE, postmatch.adjusted.model = FALSE )propensityScoreAnalysis( data, outcomes, exposure, covariates.factor, covariates.continuous, identifier, datefield, link = "logit", avs = TRUE, period.type = "quarter", alpha = 0.05, m.days = 90, m.type = "closest", lambda = "lambda.min", match.date.range = FALSE, m.method = "nearest", m.dist = "glm", m.dist.opt = list(), m.est = "ATT", m.exact = NULL, m.mahvars = NULL, m.antiexact = NULL, m.discard = "none", m.reestimate = FALSE, m.s.weights = NULL, m.replace = FALSE, m.order = "largest", m.caliper = 0.01, m.ratio = 1, m.verbose = FALSE, m.include.obj = FALSE, postmatch.adjusted.model = FALSE )
data |
The data frame. |
outcomes |
A character vector of one or more outcomes. |
exposure |
A character string with the exposure. |
covariates.factor |
A character vector of factor covariates. |
covariates.continuous |
A character vector of continuous covariates. |
identifier |
A character string with the record identifier. |
datefield |
The observation date if matching within a date range. |
link |
Specify the link function as "logit" or "probit". |
avs |
Set to TRUE to run automatic variable selection. |
period.type |
Specifies time period as "week", "month", "quarter", "half-year", or "year"; specify "none" if not matching within a date range. |
alpha |
The probability of a Type I error. |
m.days |
Radius for time period, in days, if matching within a date range. |
m.type |
Specify matching type as "closest" or "random". |
lambda |
Specify lambda as "lambda.min" or "lambda.1se". |
match.date.range |
Set to TRUE to match within a date range. |
m.method |
Specify matching method as "nearest", "optimal", "full", "quick", "genetic", "cem", "exact", "cardinality", or "subclass". |
m.dist |
Specify the distance measure as "glm", "mahalanobis", a vector of distance measures, or a matrix of pairwise distances. |
m.dist.opt |
Specify a list of additional arguments for the function that estimates the distance measure. Otherwise, specify an empty list. |
m.est |
Specify the target estimand as "ATT" (Average Treatment Effect on the Treated), "ATC" (Average Treatment Effect on the Controls), or "ATE" (Average Treatment Effect). |
m.exact |
Specify a string with the variables for which exact matching should be used or specify a one-sided formula with the variables on the right-hand side. Otherwise, specify NULL. |
m.mahvars |
Specify a string with the variables on which Mahalanobis distance matching should be used or specify a one-sided formula with the variables on the right-hand side. Otherwise, specify NULL. |
m.antiexact |
Specify a string with the names of variables for which anti-exact matching should be used or specify a one-sided formula with the variables on the right-hand side. Otherwise, specify NULL. |
m.discard |
Specify whether "none", "treated", "control", or "both" units should be discarded when the propensity scores fall outside the common support region. |
m.reestimate |
Set to TRUE to re-estimate propensity scores in the sample that remains, only used if m.discard is not "none". |
m.s.weights |
Specify a numeric vector of sampling weights for the propensity score models and balance statistics, a string containing the variable to be used, or a one-sided formula with the variable on the right-hand side. Otherwise, specify NULL. |
m.replace |
Set to TRUE to match with replacement. |
m.order |
Specify matching order as "largest" or "data". |
m.caliper |
A numeric vector of caliper widths for each variable. Otherwise, NULL for no caliper. |
m.ratio |
Specify an integer for the number of control cases to match with each treated case in k:1 matching. |
m.verbose |
Set to TRUE to print information on the matching process to the console. |
m.include.obj |
Set to TRUE to include objects generated during the matching process in the output. |
postmatch.adjusted.model |
Set to TRUE to adjust for additional variables in a logistic regression model on the matched cohort. |
A list containing relevant messages about the matching process, summaries of unmatched and matched cohort variable balance assessment, descriptive statistics, logistic regression modeling summaries, proportional difference summaries, and observed vs expected summaries.
# Match within date range and without replacement using a standard caliper ps <- propensityScoreAnalysis(data=data.ps, outcomes=c("Mortality30D", "Readmission", "RepeatProc"), exposure="DeviceB", covariates.factor=c("Aspirin", "ChrLungDis", "Diabetes", "Dialysis", "Emergent", "Female", "Hypertension", "NSTEMIatPresent", "PeripheralArterialDis", "PriorPCI", "Smoker", "Warfarin"), covariates.continuous=c("Age", "BMI", "CreatPreProc_mgdl", "FluoroMins", "NumVesselsIndexPCI", "TotalAdmitPCI"), identifier="Patient", datefield="ProcDate", match.date.range=TRUE, m.replace=FALSE, m.caliper=0.2)# Match within date range and without replacement using a standard caliper ps <- propensityScoreAnalysis(data=data.ps, outcomes=c("Mortality30D", "Readmission", "RepeatProc"), exposure="DeviceB", covariates.factor=c("Aspirin", "ChrLungDis", "Diabetes", "Dialysis", "Emergent", "Female", "Hypertension", "NSTEMIatPresent", "PeripheralArterialDis", "PriorPCI", "Smoker", "Warfarin"), covariates.continuous=c("Age", "BMI", "CreatPreProc_mgdl", "FluoroMins", "NumVesselsIndexPCI", "TotalAdmitPCI"), identifier="Patient", datefield="ProcDate", match.date.range=TRUE, m.replace=FALSE, m.caliper=0.2)