Matching
Once the user has generated some data. The next step is to select how the matching should take place. The screenshot in Figure 1 shows what the user will see once they have selected the data (or chosen to continue without changing).
![]() |
Settings
As can be seen above, there are five settings that can be changed - Matching Covariates; Matching Distance; Matching Order; Use Replacement; and Outcome Formula. The settings and their purpose are outlined below.
Matching Covariates
The user has the option to select the available covariates that they
would like to match the treated and untreated units on. This will
include X1
and X2
for the simulated data and
age
, height
and sex
for the
fev
data. The matching cannot be completed without having
selected at least one covariate for each method.
Matching Distance
The Matching Distance options include the Mahalanobis
Distance and the Propensity Score. Both methods are implemented using
the optmatch
package however, the propensity score is
calculated apriori using logistic regression between the treatment and
selected covariates.
Matching Order
This settings determines what order the matches are conducted in.
data is the order that the data is in and random is a
randomly generated order. When using smallest and
largest the data is ordered according to each unit’s propensity
score, this is irrespective of the method of matching used. To compare
to the MatchIt
package, Mahalanobis Distance matching is
always conducted using data.
Use Replacement
The Use Replacement option tells the algorithm whether an untreated unit can be matched to more than one treated unit.
Outcome Formula
This is the formula that is used to calculate the treatment effect on
the outcome. It will always be at least
outcome ~ treatment
. This setting gives you the option of
including the other covariates in the estimate.
After the user has selected the settings that they would like to compare, they can simply press the “Use these matching settings” button at the button and the app will begin its calculations.
The output from the decision can take some 10s of seconds to be
realised due to a combination of the extra data that needs to be
generated for the cumulative plots and the processing to render the
plotly
object. Once rendered it will display four plots
with a legend on the right and a slide bar down the bottom.