ccmatch is used to randomly match cases and controls based on specified criteria. For instance, if you wanted to randomly match cases and controls based on age, you can use ccmatch to pair up people with the same age. You can use multiple variables to match cases and controls.
ssc install ccmatch
ccmatch variable_list, cc( ) [id( )]
id is optional
variable_listThe variable list are categorical or discrete variables you want to match on (example: age, sex, weight class, etc.).
cc( )Specify your case control variable here. 0=control; 1=case.
id( )(optional) Specify a variable you use as an ID and the
match_idvariable will be created and list the case/control partner.
ccmatch creates one to two variables:
matchan integer shared by a case and control.
match_idOptional the ID partner of the case control pair (specified in a separate variable).
The table above shows example ccmatch output. The highlighted variables were created by
ccmatch. The original data (name, case_control, age) is unchanged, except that it has been reordered. The command used was:
ccmatch age, id(name) cc(case_control)
Age was specified following ccmatch to indicate that we wanted to match case/controls who are the same age.
The case/control variable is specified as an option using
cc( ), and the id of each individual is specified using