help mkomega (SJ17-4: st0499)

Title

mkomega -- Similarity matrix generation for use with the community-contributed command ntreatreg

Syntax

mkomega
treatment
varlist
[if] [in],
sim_measure(type)
out(outcome)

treatment is a binary variable taking a value of 1 for treated units and
0 for untreated ones. It is the same treatment variable that the user is
going to specify in ntreatreg.

varlist is a list of numeric variables on which to build the distance
measure. These variables should be of numeric significance, not categorical.
Some of these variables might be specified as confounders in ntreatreg.

Description

mkomega computes a unit's similarity matrix using the variables declared
in varlist to be later used in the command ntreatreg. Two types
of similarity matrices are optionally allowed by this command: the correlation
matrix and the inverse Euclidean distance matrix.

Options

sim_measure(type) specifies the similarity matrix to use.
sim_measure() is required. type may be corr, for the
correlation matrix, or L2, for the inverse Euclidean distance matrix.

out(outcome) specifies the outcome variable one is
going to use in ntreatreg. out() is required.

Remarks

For the sake of full consistency across mkomega and ntreatreg, you
must prepare your data as follows:

1. Only use cross-section datasets.

2. Eliminate common missing values in the variables used in mkomega and
ntreatreg.

3. Sort the treatment in decreasing order (1s first and 0s after).

See example 2.

Please remember to use the update query command before running this
program to make sure you have an up-to-date version of Stata installed.

Examples

Example 1. Use of mkomega

. mkomega w x1 x2 x3, out(y) sim_measure(corr)

Example 2. Use of mkomega and ntreatreg

Preserve the current dataset

. preserve

Generate the nonmissing value indicator sample

. generate sample=missing(y,w,x1,x2,x3)

Eliminate common missing values from the dataset

. keep if sample==0

Sort treatment by decreasing order (treated first)

. gsort - w

Run mkomega to obtain the similarity matrix stored in r(M)

. mkomega w x1 x2 x3, out(y) sim_measure(L2)

Put the similarity matrix into a Stata matrix called omega

. matrix omega = r(M)

Run ntreatreg using omega as similarity matrix

. ntreatreg y w x1 x2, hetero(x1) spill(omega)

Restore the starting dataset

. restore

Stored results

mkomega stores the following in r():

Scalars

r(N1) number of treated units

r(N0) number of untreated units

Matrices

r(M) similarity matrix

Author

Giovanni Cerulli

IRCrES-CNR

National Research Council of Italy

Research Institute for Sustainable Economic Growth

Rome, Italy

giovanni.cerulli@ircres.cnr.it

Also see

Article: Stata Journal, volume 17, number 4: st0499

Help: [P] matrix dissimilarity