The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Propensity Score-Integrated Matching Method

2026-01-10


Introduction

In the psrwe, PS-integrated matching method (Chen, et al., 2021) is also implemented for leveraging real-world evidence in evaluation of diagnostic tests for low-prevalence diseases. This example is based on PS matching and stratification on an important baseline covariate (e.g., disease stage) that may have a major impact on the sensitivity of the diagnostic.

Note that this example is only for demonstrating PS matching on low-prevalent disease, and when the resource may be very limited. For different scenarios, other PS-integrated approaches may be more appropriate.

data(ex_dta)
dta_ps <- psrwe_est(ex_dta,
                    v_covs = paste("V", 1:7, sep = ""),
                    v_grp = "Group",
                    cur_grp_level = "current",
                    ps_method = "logistic")
dta_ps
## This is a sing-arm study. A total of 1031 RWD subjects and 
## 200 current study subjects are used to estimate propensity 
## scores by logistic model. A total of 5 RWD subjects are 
## trimmed (trim_ab=both) and excluded from the final 
## analysis. (PS values of 5 and 0 RWD are below and above 
## current study) The following covariates are adjusted in the 
## propensity score model: V1, V2, V3, V4, V5, V6, V7.
## 
## The following table summarizes the number of subjects in 
## each stratum, and the distance in PS distributions 
## calculated by overlapping area:
## 
##     Stratum N_RWD N_Current Distance
## 1 Stratum 1   729        40    0.561
## 2 Stratum 2   156        40    0.720
## 3 Stratum 3    78        40    0.804
## 4 Stratum 4    50        40    0.810
## 5 Stratum 5    13        40    0.795


PS-integrated matching method

The propensity score (PS) estimation above is based on psrwe_est() may provide stratification. This matching example psrwe_match() below will match the RWD (real-world data) to the current study with \(2:1\) ratio (ratio = 2) based on the covariate V1 (strata_covs = "V1"). The (categorical) covariate V1 will be used to create strata, then the data will be matched within each stratum based on PS values based on the nearest neighbor algorithm.

Please see Section of Demo example below for the other option using a different matching algorithm and package.

dta_ps_match <- psrwe_match(dta_ps,
                            ratio = 2,
                            strata_covs = "V1",
                            seed = 123)
dta_ps_match
## This is a sing-arm study. A total of 1031 RWD subjects and 
## 200 current study subjects are used to estimate propensity 
## scores by logistic model. A total of 631 RWD subjects are 
## trimmed (trim_ab=both) and excluded from the final 
## analysis. (PS values of 5 and 0 RWD are below and above 
## current study) The following covariates are adjusted in the 
## propensity score model: V1, V2, V3, V4, V5, V6, V7.
## 
## The matching is stratified by the following covariate(s): 
## V1. A total of 0 current study subjects are matched by less 
## than 2 RWD subjects. Please note unequal matching may cause 
## unbalance in covariate distributions of the current and 
## matched RWD subjects.
## 
## The following table summarizes the number of subjects in 
## each stratum:
## 
##   Stratum N_RWD N_Current
## 1    V1=0   108        54
## 2    V1=1   292       146

The returned object dta_ps_match will be used to calculate discounting parameters for the study design. Note that the results are based on two stages indicated by V1 rather than five strata originally set by dta_ps above.

ps_bor_match <- psrwe_borrow(dta_ps_match,
                             total_borrow = 30)
ps_bor_match
## A total of 30 subjects will be borrowed from the RWD. The 
## number 30 is split proportional to the number of current 
## control subjects in each stratum. The following table 
## summarizes the number of subjects to be borrowed and the 
## weight parameter in each stratum:
## 
##   Stratum N_RWD N_Current Proportion N_Borrow Alpha
## 1    V1=0   108        54       0.27      8.1 0.075
## 2    V1=1   292       146       0.73     21.9 0.075


PSCL and outcome analyses

The PSCL analysis (Wang, et al., 2020) can be done below with the same steps as other PSCL examples.

rst_cl <- psrwe_compl(ps_bor_match,
                      outcome_type = "binary",
                      v_outcome    = "Y_Bin")
rst_cl
## With a total of 30 subject borrowed from the RWD, the point 
## estimate is 0.303 with standard error 0.029.

The outcome analysis can be done in the same way. Note that typically the Wilson score method will be used for constructing confidence intervals.

oa_cl <- psrwe_outana(rst_cl, method_ci = "wilson", mu = 0.40)
oa_cl
## - Method: ps_cl, Outcome Type: binary, Study Type: single-arm
## - StdErr Method: jk
## - Interval Method: wilson, Level: 0.95, Stderr: original
## - Test Method: p_value, Method pval: wald
##   H0: theta >= 0.400 vs. Ha: theta < 0.400
## - Analysis Results:
##  Stratum  Mean StdErr Lower Upper  p.value
##  Overall 0.303 0.0285 0.247 0.365 0.000347


Demo example

The script in “psrwe/demo/sec_4_3_ex.r” source file has the full example for the PS matching, which can be run via the demo("sec_4_3_ex", package = "psrwe").

Note that the R package optim may provide other matching algorithms. However, it may need additional license permission. Please check the package announcement to see if the package is turned on.

References

  1. Chen, W.-C., Li, H., Wang, C., Lu, N., Song, C., Tiwari, R., Xu, Y., and Yue, L.Q. (2021). Evaluation of Diagnostic Tests for Low Prevalence Diseases: A Statistical Approach for Leveraging Real-World Data to Accelerate the Study. Journal of Biopharmaceutical Statistics, 31(3), 375-390.

  2. Wang, C., Lu, N., Chen, W. C., Li, H., Tiwari, R., Xu, Y., and Yue, L.Q. (2020). Propensity score-integrated composite likelihood approach for incorporating real-world evidence in single-arm clinical studies. Journal of Biopharmaceutical Statistics, 30(3), 495-507.



These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.