*! version 1.3 1May2024

mapsm Multiple arms propensity score matching

Syntax

mapsm, group(varname) [seed(numlist) name(string) size(numlist) smd(varlist) iterate(numlist) replace notable log append]

Description

The mapsm command; stands for “Multiple Arms Propensity Score Matching”, matches the propensity scores
predicted from binary logistic regression (or multinomial logistic regression), which indicates the
likeliness of choosing or being assigned to one among other treatment arms for each subject. In case
of two-treatment arms study, the propensity score (probability of 0-1.0) derived from binary logistic
regression will be divided into 10 strata, 0-0.1, 0.1-0.2 until 0.9-1.0. Study subjects from either
of the two arms will be sampled to match with the opposite arm within the same propensity score
strata, with 1:1 ratio.

In case of three or more arms, the propensity scores will be derived from multinomial logistic
regression, yielding sets of propensity scores equal to number of arms, indicating the likeliness of
choosing or being assigned to one among other treatment arms for each subject. Each set of the
propensity scores will be divided into 10 strata similar to the two-treatment arms. Subjects from
each arm within the same strata of the propensity score will be sampled to obtain a matched set of
1:1:1 ratio in case of three arms, and 1:1:1:1 in case of four arms, and so on.

In order to obtain the most similar post-matched contrast groups, the command also rerun the matching
process and reported the best post-matched contrast groups which has the best balance diagnostic
property, such as standardized mean difference. The best seed-setting number (among those selected)
will be reported in order to re-obtain the best post-matched cohort.

Options

group(varlist) Specify the treatment arms. Must be specify.

seed(numlist) Specify the seeding number. Default is 1234. Commonly use to re-specify
from imaginary matched cohort.

name(string) Specify the strata name. Default is strata.

size(numlist) Specify the strata size. Default is ten.

smd(varlist) Specify the pre-treatment confounder from propensity score model. Optional.

iterate(numlist) In case of smd option is specified, the iteration round should be
determined. Default is 100.

replace Replace the existing strata variable. Commonly use to overwrite the strata
variable from imaginary cohort.

notable Suppress the strata tabulation across the treament arms.

log Report the iteration seeding number and the imaginary cohort mean or maximum
standardized difference.

append Append the postmatched cohort to the original dataset. Create an append variable to specify the original cohort for balance diagnostic reporting and illustration.

Examples

Two arms

Import chocolate cyst example dataset. The surgeon was choosing between the laparoscopic approach
(MIS) and laparotomy approach (Open) to diagnose, stage, and eradicate the endometrioma.

Download chocolate_cyst.dta

Estimate propensity score with binary logistic regression

logit optype age wt bmi i.bilat size

Predict the probability. (propensity score)

predict pscore

Create an imaginary matched cohort and record the seeding number. Report the smallest balance
diagnostic value and its seeding number. Input the probability variable. Binary treatment groups.
Specify initiation seeding number to 1234. Strata variable name, "Block".
Strata size of 10. The iteration round of 200. The covariates accountable for the
balance diagnostic are age, body weight, body mass index, bilaterality, and
preoperative endometriotic diameter. Strata tabulation across the treatment groups is suppressed.

mapsm pscore, group(optype) seed(1234) name(block) size(10) smd(age wt bmi i.bilat size) iterate(200) notab

After the 200 iterations, the mean standardized difference is .011, and the seeding number is 1301.
Now, we are matching. Without "notable" option, Pre-match and post-match cohort tabulations will be shown.

mapsm pscore, group(optype) seed(1301) name(block) replace

Three arms

Import coronary artery bypass grafting example dataset. The surgeon was choosing among the
conventional coronary artery bypass grafting (CABG),the off-pump CABG (OPCAB), and the on-pump beating heart CABG (ONBHCAB). The study focuses on comparing the short- and long-term outcomes of different CABG techniques.

Download cabg.dta

Estimate propensity score with multinomial logistic regression

mlogit sxtype sex age i.nyfc i.ccs aceiarb asa clopidogrel ckd5esrd i.cadtype lm

Predict the probability. (propensity score)

predict cabg opcab onbhcab

Create an imaginary matched cohort and record the seeding number. Report the smallest balance
diagnostic value and its seeding number. Input the probability variable. Multiple treatment groups.
Specify the initiation seeding number to 1234. Strata variable name is "Block".
Strata size of 10. The iteration round of 50. The covariates accountable for
the balance diagnostic are sex, age, New York Heart Association (NYHA) functional class,
Canadian Cardiovascular Society (CCS) angina grade, ACEI/ARB, aspirin, clopidogrel,
chronic kidney disease stage V, coronary artery disease type (e.g. single, double, triple vessel disease),
and left main disease. Strata tabulation across the treatment groups is suppressed.

mapsm cabg opcab onbhcab, group(sxtype) seed(1234) name(block) size(10) smd(sex age i.nyfc i.ccs aceiarb asa clopidogrel ckd5esrd i.cadtype lm) iterate(50) notab

After the 50 iterations, the maximum standardized difference is 0.0661, and
the seeding number is 1255. Now, we are matching. Without "notable" option,
pre-match and post-match cohort tabulations will be shown. With replace option, Stata replace the existing strata variable.

mapsm cabg opcab onbhcab, group(sxtype) seed(1255) name(block) size(10) replace

In actual matching, report the diagnostic balance by adding smd and log options.

mapsm cabg opcab onbhcab, group(sxtype) smd(sex age i.nyfc i.ccs aceiarb asa clopidogrel ckd5esrd i.cadtype lm) log

In actual matching, we append the original cohort next to the last observation of matched cohort.
Generate the default name append variable to specify the cohort type. For the next steps of diagnostic balance checking and illustration, use standardized difference command with if condition on the append variable value.

mapsm cabg opcab onbhcab, group(sxtype) append

Stored results

mapsm stores the following in r():

Scalars

r(seed) The best seeding number

r(smallest) The smallest diagnostic balance (Mean/Max Standardized difference)

r(size) Strata size

Macros

r(strata) Strata variable name

r(group) Treatment group variable name

Matrix

r(I) Iteration matrix

Authors

Suppachai Lawanaskol, MD

Chaiprakarn hospital, Chiang Mai, Thailand

Email suppachai.lawanaskol@gmail.com

Phichayut Phinyo, MD, PhD

Center of Clinical Epidemiology and Clinical Statistics, Faculty of Medicine, Chiang Mai University, Chiang Mai, Thailand

Email phichayut.phinyo@gmail.com

Jayanton Patumanond, MD, DSc

Center of Clinical Epidemiology and Clinical Statistics, Faculty of Medicine, Chiang Mai University, Chiang Mai, Thailand

Email jpatumanond@gmail.com