| Title: | DELTA Analytic Tools and Learning Curve Analysis |
| Version: | 0.1.4 |
| 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). |
| License: | GPL-2 | GPL-3 |
| Encoding: | UTF-8 |
| RoxygenNote: | 8.0.0 |
| Imports: | broom (≥ 1.0.12), caret (≥ 7.0-1), data.table (≥ 1.18.4), DescTools (≥ 0.99.60), dplyr (≥ 1.2.1), gbm (≥ 2.2.3), ggplot2 (≥ 4.0.3), glmnet (≥ 5.0), ldbounds (≥ 2.0.2), lmtest (≥ 0.9-40), MatchIt (≥ 4.7.2), methods, mgcv (≥ 1.9-4), minpack.lm (≥ 1.2-4), parameters (≥ 0.28.3), plotly (≥ 4.12.0), pROC (≥ 1.19.0.1), ResourceSelection (≥ 0.3-6), rms (≥ 8.1-1), ROCR (≥ 1.0-12), sjPlot (≥ 2.9.0), stats, stringr (≥ 1.6.0), tableone (≥ 0.13.2), twang (≥ 2.6.2) |
| Suggests: | kableExtra (≥ 1.4.0), knitr (≥ 1.51), rmarkdown (≥ 2.31), testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Depends: | R (≥ 3.5.0) |
| LazyData: | true |
| NeedsCompilation: | no |
| Packaged: | 2026-09-17 19:59:04 UTC; amyperkins |
| Author: | Michael Matheny |
| Maintainer: | Amy Perkins <amy.perkins@vumc.org> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-28 08:40:19 UTC |
DeltaTools Function: PLCAnalysis
Description
DeltaTools Function: PLCAnalysis
Usage
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
)
Arguments
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. |
Value
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).
Examples
# 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")
Parametric Learning Curve Analysis example data
Description
A synthetic patient population generated for learning effect and device signal detection using this function.
Usage
data.plc
Format
data.plc
A data frame with 11,808 rows and 41 columns:
- Patient
Patient identifier
- Operator
Operator identifier
- Institution
Institution identifier
- CaseOrder_All
Case Order across all observations
- CaseOrder_Inst
Case Order across that institution
- CaseOrder_Op
Case Order across that operator
- ProcDate
Procedure date
- CasePeriod
Time period during which the case procedure occurred
- OutcomePeriod
Time period during which the case outcome occurred
- CaseOrder_Inst_DevA
Case Order across that institution and Device A
- CaseOrder_Inst_DevB
Case Order across that institution and Device B
- CaseOrder_Op_DevA
Case Order across that operator and Device A
- CaseOrder_Op_DevB
Case Order across that oeprator and Device B
- Device
Device placed during the procedure
- Outcome_Final
Outcome variable
- Pt_F1
Patient factor 1
- Pt_F2
Patient factor 2
- Pt_F3
Patient factor 3
- Pt_F4
Patient factor 4
- Pt_F5
Patient factor 5
- Pt_F6
Patient factor 6
- Pt_F7
Patient factor 7
- Pt_F8
Patient factor 8
- Pt_F9
Patient factor 9
- Pt_F10
Patient factor 10
- Pt_F11
Patient factor 11
- Pt_F12
Patient factor 12
- Pt_F13
Patient factor 13
- Pt_F14
Patient factor 14
- Pt_F15
Patient factor 15
- Pt_F16
Patient factor 16
- Pt_F17
Patient factor 17
- Pt_F18
Patient factor 18
- Pt_F19
Patient factor 19
- Pt_F20
Patient factor 20
- Pt_F21
Patient factor 21
- Op_F1
Operator factor 1
- Op_F2
Operator factor 2
- Inst_F1
Institution factor 1
- Inst_F2
Institution factor 2
- Inst_F3
Institution factor 3
Propensity Score Analysis and Inverse Probability of Treatment Weighting example data
Description
A synthetic patient population generated for use with the functions propensity score matching or inverse probability of treatment weighting.
Usage
data.ps
Format
data.ps
A data frame with 29,778 rows and 24 columns:
- Hypertension
Hypertension indicator
- Mortality30D
30-day mortality indicator
- Aspirin
Aspirin use indicator
- Warfarin
Warfarin use indicator
- CreatPreProc_mgdl
Pre-procedure serum creatinine level in mg/dL
- FluoroMins
Fluoroscopy time in minutes
- NSTEMIatPresent
Non-ST-Elevation Myocardial Infarction at presentation indicator
- ProcDate
Procedure date
- NumVesselsIndexPCI
Number of blocked vessels at index percutaneous coronary intervention
- Patient
Patient identifier
- Readmission
Hospital readmission indicator
- PriorPCI
History of percutaneous coronary intervention indicator
- Emergent
Emergent case indicator
- TotalAdmitPCI
Total admitted percutaneous coronary interventions
- ChrLungDis
Chronic lung disease indicator
- Smoker
Smoker indicator
- Female
Female sex
- Dialysis
Dialysis indicator
- Diabetes
Diabetes indicator
- PeripheralArterialDis
Peripheral arterial disease indicator
- RepeatProc
Repeat procedure indicator
- DeviceB
Device B indicator
- Age
Patient age in years
- BMI
Patient BMI in kg/m2
DeltaTools Function: iptwDT
Description
DeltaTools Function: iptwDT
Usage
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
)
Arguments
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). |
Value
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.
Examples
# 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: propensityScoreAnalysis
Description
DeltaTools Function: propensityScoreAnalysis
Usage
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
)
Arguments
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. |
Value
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.
Examples
# 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)