*! version 7 02Oct2024

help gpsmdcomsup

Title

gpsmdcomsup -- Detecting observations inside common support when the treatment has multiple continuous dimensions

Syntax

gpsmdcomsup varlist(min=1), exogenous(varlist) index(string) cutpoints(numlist integer max=1) obs_notsup(string) [testing(numlist integer max=1) ln(varlist)]

varlist: the dimensions of the treatment.

Description

gpsmdcomsup detects the observations inside common support when the treatment has multiple continuous dimensions.
According to Flores et al. (2012) and Egger’s et al. (Peter Hannes Egger and Egger 2016; Peter H. Egger, Ehrlich, and Nelson 2020),
the common support can be selected by partitioning the treatment into an arbitrary number of subsets.
Iteratively, every discrete subset d is considered "the treatment group", while the others are considered the "control group".
For each subset d, a representative point is chosen, t_d. There, the propensity score, g(t_d, Z_i), is calculated for each observation in the sample.
The observations inside the common support are those observations whose propensity score is, irrespectively to the discrete subset considered as "treatment group", higher than the maximum of the minimums of “treatment” and “control” groups, as well as lower than the minimum of the maximums of “treatment” and “control” groups.

The command should be used together with gpsmd, gpsmdbal, and gpsmdpolest to estimate the dose-response function.

Note: gpsmdcomsup is an n-class command (see return}. It can be invoked after running gpsmd and before invoking gpsmdbal without incurring an error.

Options

exogenous(varlist): exogenous variables in the same order that in the command gpsmd.

index(string): the point t_d where the user wants to calculate the GPS. It can be "mean" or "p50": "mean" for the mean, and "p50" for the median.

cutpoints(numlist integer max=1): the number of discrete intervals of the dimensions of the treatment.

obs_notsup(string): the name for the dummy variable taking value 1 if the observation is outside the common support and 0 if the observation is inside the common support.

testing(numlist integer max=1): the user may want to inspect the distribution of the GPS calculated at the representative point of the discrete subsets of the treatment, g(t_d, Z_i).
If testing(numlist integer max=1) is set to 1, the program generates one variable for each discrete subset of the treatment.
The variable stores, for all observations, the GPS calculated at the representative point of the corresponding discrete subset of the treatment.
These variables are named obs_notsup# where obs_notsup is the name specified in obs_notsup(string) and # stands for the number of the discrete subset.
The dummy variable indicating whether the observation is inside the common support is named simply as it is specified in obs_notsup(string).

ln(varlist): the treatment dimensions that have to be log-transformed.

Examples

Setup

Setting the dataset:

. clear all

. set obs 1200

Generating independent variables for the propensity score estimation:

. seed 13131

. gen X1 = 1* rnormal(0,1)

. gen X2 = 2* rnormal(0,1)

. gen X3 = 3* rnormal(0,1)

. gen X4 = 4* rnormal(0,1)

. gen X5 = 5* rnormal(0,1)

. gen X6 = 6* rnormal(0,1)

. gen X7 = 7* rnormal(0,1)

Generating the treatment dimensions:

. matrix R = (25, 2 \2, 25)

. drawnorm V1 V2, cov(R)

. gen T1= 1*X1 + .5*X2 + 1*X3 + .5*X4 + 1*X5 + .5*X6 + 1*X7 + V1

. gen T2= .5*X1 + 1*X2 + .5*X3 + 1*X4 + .5*X5 + 1*X6 + .5*X7 + V2

The estimation:

. gpsmdcomsup T1 T2, exogenous(X1 X2 X3 X4 X5 X6 X7) index("p50") cutpoints(2) obs_notsup(Commonsupport)

Stored results

Variables

If testing is different from 1, the gpsmdcomsup generates a variable named as in obs_notsup(Commonsupport) taking value 1 if the observation is outside the common support and value 0 if the observation is within the common support.

If testing(numlist integer max=1) is set to 1, the program generates one variable for each discrete subset of the treatment.
The variable stores, for all observations, the GPS calculated at the representative point of the corresponding discrete subset of the treatment.
These variables are named obs_notsup#, where obs_notsup is the name specified in obs_notsup(string) and # stands for the number of the discrete subset.
The dummy variable indicating whether the observation is inside the common support is named simply as in obs_notsup(string).

gpsmdcomsup stores the following in r() (directly copying gpsmd results):

Macros

r(gpsmdvar) macro with the string in the option gpsmdvar(string)

r(Exogenous) macro with the varlist in the option exogenous(varlist).

r(Dimensions) macro with the varlist of the dimensions of the treatment.

r(cmdline#) macro with the cdmline of the reduced equation for dimension #. The user may want to run again only one of the regressions and focus on those results. This macro enables to do it easily.

r(cmd) macro with the name of the command just invoked (gpsmd)

r(cmdline) macro with the cdmline. This macro reports the command just invoked, including options and specifications

r(chosenpoint) macro with the name of the column vector with the chosen point

r(LNVarCreated) if the ln(varlist) option is specified, the program generates variables named LN_var consisting of the logarithmic transformation of the variables in the varlist. r(LNVarCreated) contains the list of the variable generated

r(DimensionsFS) macro with the name of the dimension used in calculating the propensity score. It differs from r(Dimensions) only if the ln(varlist) option is used

Matrices

r(VarCov) the estimated variance-covariance matrix

Bibliography and Sources

Egger, Peter H., and Maximilian von Ehrlich. 2013. ‘Generalized Propensity Scores for Multiple Continuous Treatment Variables’. Economics Letters 119 (1): 32–34.

Egger, Peter H., and Peter Egger. 2016. ‘Heterogeneous Effects of Tariff and Nontariff Policy Barriers in General Equilibrium’. Beiträge zur Jahrestagung des Vereins für Socialpolitik 2016: Demographischer Wandel - Session: Trade Barriers, No. G18-V3, ZBW - Deutsche Zentralbibliothek für Wirtschaftswissenschaften, Leibniz-Informationszentrum Wirtschaft, Kiel und Hamburg.

Egger, Peter H., Maximilian v. Ehrlich, and Douglas R. Nelson. 2020. ‘The Trade Effects of Skilled versus Unskilled Migration’. Journal of Comparative Economics 48 (2): 448–64.