*! version 9 02Oct2024

help gpsmdbal

Title

gpsmdbal -- Balancing property test. It is the multidimensional analog to the t-tests for equality of means before and after matching implemented in pstest for binary treatments (Leuven and Sianesi 2003).

Syntax

gpsmdbal varlist(min=1), cutpoints(numlist integer max=1) index(string) nq_gpsmd(numlist max=1) discrtreat(string) [ptile(string) obs_notsup(string) gpsmdtequalt(string) ln(varlist) level(numlist max=1)]

varlist: The variables for which the balancing property has to be assessed.

Description

gpsmdbal tests whether conditioning on the propensity score effectively removes the differences regarding the mean of the exogenous covariates between groups treated with different doses.
The procedure is the multidimensional analog to the t-tests for equality of means before and after matching implemented in pstest for binary treatments (Leuven and Sianesi 2003).
Similarly to gpsmdcomsup relies on partitioning the treatment into an arbitrary number of subsets and iteratively considering one subset as "the treatment group".
The equality of means between the control and treatment groups is then tested before and after adjusting for the propensity score.

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

Note: gpsmd must be invoked before invoking gpsmdbal.

Options

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

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.

nq_gpsmd(numlist max=1): the number of discrete subsets of the GPS.

discrtreat(string): the program discretizes the treatment in a user-defined number of subsets. It also generates a variable storing the information about the discrete subset to which an observation belongs.
In discrtreat(string) the user must specify the name of this variable.

obs_notsup(string): the string with the name of the dummy variable generated by the command gpsmdcomsup. The variable indicates whether the observation is included in the common support or not.
If specified, gpsmdcomsup must have been run before invoking gpsmdbal. If it is not specified, gpsmdbal will perform the analysis using the entire sample.

ptile(string): the program generates the discrete subsets of the treatment by calculating the Cartesian product of the discrete intervals of the dimensions.
In addition, the program generates a variable for each dimension where it stores the discrete subset of the dimension to which an observation belongs.
In ptile(string) the user must specify the first characters for the name of these variables. The default is __ptile .

gpsmdtequalt(string): 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).
When gpsmdtequalt(string) is specified, the program generates one variable for each discrete subset of the treatment storing the GPS calculated at the representative point of that discrete subset.
These variables are named gpsmdtequalt# where gpsmdtequalt is the name specified in gpsmdtequalt(string) and # stands for the number of the discrete subset. By default, the program does not generate these variables.

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

level(numlist max=1): the program prints the table with the adjusted and unadjusted differences in means (r(NofDiscTreat)) both entirely and setting to missing cells whose p-value is higher than a certain threshold (specified in level(numlist)). The default is 0.05.

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:

. gpsmd T1 T2, exogenous(X1 X2 X3 X4 X5 X6 X7) gpsmd(GPS)

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

. gpsmdbal X1 X2 X3 X4 X5 X6 X7, index("p50") cutpoints(2) nq_gpsmd(4) discrtreat(Discretetreat) obs_notsup(Commonsupport)

Stored results

Variables

gpsmdbal generates the following list of variables:

- One variable named as specified in discrtreat. This variable reports, for each observation, the discrete set of the treatment to which the observation is assigned.

- One variable named `ptile’# for every dimension # of the treatment.
The `ptile’# variable stores the number of the discrete subset of the #dimension to which the observation is assigned. The variable `discrtreat' is generated as the Cartesian product of .

gpsmdbal stores the following in r() - Some objects are simply copied from the gpsmd results:

Macros

r(NofDiscTreat) macro with the number of discrete treatments

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

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

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

r(LNVarCreated) if the ln(varlist) option is specified, r(LNVarCreated) contains the list of the variable generated

Matrices

r(Tabmeandiff) matrix having one row for each variable the user wanted to test and two columns for each discrete treatment. In the cells, the program reports the mean differences before and after adjusting for the GPS.

r(Tabmeandiff2) r(Tabmeandiff) where pvalues higher than the threshold specified in level() are set to missing.

r(TableImpRes) matrix having one row for each variable the user wanted to test and two columns for each discrete treatment. In the cells, the program reports the p-value of the test before and after adjusting for the GPS.

r(TableImpRes2) r(TableImpRes) where pvalues higher than the threshold specified in level() are set to missing.

r(ResultAdj#) for each discrete subset of the treatment, the program generates a matrix reporting the results of the t-test for the adjusted mean. The first column reports the t statistic, the second column reports the p-value, and the third column reports the degree of freedom. There is one row for each variable that the user wanted to test.

r(Result#) the program generates a matrix reporting the results of the t-test for discrete subset # before the adjustment. There is one column for every r-class object of ttest plus one for the estimated difference. There is one row for each variable that the user wanted to test. r(ResultAdj#) and r(Result#) are somehow redundant objects. r(TabellaImpRes) already includes the essential information

r(Chosenpoint#) the program reports, for each discrete subset of the treatment #, a matrix storing the representative treatment vector t_d chosen.

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.

Leuven, Edwin, and Barbara Sianesi. 2003. ‘PSMATCH2: Stata Module to Perform Full Mahalanobis and Propensity Score Matching, Common Support Graphing, and Covariate Imbalance Testing’.