UserGuide BioStat Prime Help

Subject Matching

This Dialog performs nearest neighbor subject matching where a set of cases is matched to 1 or more controls. This is appropriate for case/control studies and matched cohort studies.

Variables for which values have to match exactly and values matching within numerical calipers are supported. Matching is done without replacement (each subject can only be matched once) and the controls among the potential controls will be selected according to the data order for each case.

The output dataset will contain the original data and two additional variables:

  1. subclass: a variable identifying the matched set.

  2. weights: a matching case weight variable that can be used in subsequent analysis, if desired.

To perform matching user needs to follow the steps given bellow.

Steps

Load the dataset -> click on the DATASET tab in main menu -> select MATCHING -> select Subject Matching -> Once, the dialog appears select the functions to be applied to the variables being executed -> Execute the dialog.

subject matching

Arguments

Dataset name to store matched data:

Name of output dataset containing the matched subject sets.

Case/control variable (control=lower value, case=higher value):

Name of variable indicating cases and controls. Can be numeric, factor, or character. If a numeric variable, this must be coded as 0=control, 1=case. If a factor variable, the lower ordered level will be the controls and the higher ordered level will be the cases. If a character variable, the lower ordered value (by alphabetic order) will be the controls, and the higher ordered value (by alphabetic order) will be the cases. So to be safer we recommend coding as 0=control, 1=case.

Variables for exact matching:

Specify the variables for which you want the case/control sets to be exactly matched. This means the cases and controls in a matched set have exactly the same values for these variables. These can be character, date, numeric, factor, or ordinal variables.

Variables for caliper matching:

Specify the variables for which you want the case/control sets to be matched on numerical caliper values. The controls will be within a specified caliper width for each of these variables. These can be numeric or date variables. Each caliper variable must have a caliper value specified.

Specify calipers in order of caliper variables separated by commas:

Specify the numeric caliper values for each of the caliper variables, in order of the caliper variables. For example, if age (in years) was specified with a caliper of 5, that means the controls must be within +/- 5 years of their matched case. Each caliper variable must have a caliper value specified. If there are no caliper variables, this field must be empty.

Number of controls per case:

This is the maximum number of controls that will be matched to each case. Some matched sets may have less than this value if suitable matches cannot be identified.

Last modified: 01 October 2025