help gpscore2 (http://mpra.ub.uni-muenchen.de/45013/)

Title

gpscore2 -- Estimation of the generalized propensity score through GLM

Syntax

gpscore2
varlist
[if] [in]
[weight],
t(varname)
gpscore(newvar)
predict(newvar)
sigma(newvar)
cutpoints(varname)
index(string)
nq_gps(#)
family(string)
link(string)
[t_transf(transformation)
normal_test(test)
norm_level(#)
test_varlist(varlist)
test(type)
flag_b(#)
opt_nb(string)
opt_b(varname)
detail]

fweights, iweights, and pweights are allowed;
see weight.

Description

gpscore2 estimates the parameters of the conditional distribution
of the treatment given the control variables in varlist by GLM, allowing
six different distribution functions: binomial, gamma, inverse gaussian,
negative binomial, normal, poisson coupled with admissible links; for the normal case
assesses the validity of the assumed normal distribution model by a user-specified
goodness-of-fit test; and estimates the generalized propensity score (GPS).
The estimated GPS is defined as R=r(T,X), where r(.,.) is the conditional
density of the treatment given the covariates, T is the observed treatment, and
X is the vector of the observed covariates. Then gpscore tests the
balancing property by using the algorithm suggested by Hirano and Imbens (2004),
and informs the user whether and at what extent the balancing property is
supported by the data.

Options

Required

t(varname) specifies that varname is the
treatment variable.

gpscore(newvar) specifies the variable name for
the estimated GPS, which is added to the dataset.

predict(newvar) creates a new variable to hold
the fitted values of the treatment variable.

sigma(newvar) creates a new variable to hold
the GLM estimate of the conditional standard error of the
treatment given the covariates, obtained from Pearson residuals.

cutpoints(varname) divides the set of potential
treatment values into intervals according to the sample distribution of the
treatment variable, cutting at varname quantiles.

index(string) specifies the representative
point of the treatment variable at which the GPS has to be evaluated within
each treatment interval. string identifies either the mean (string =
mean) or a percentile (string = p1, ..., p100) of the
treatment.

nq_gps(#) specifies that the values of the GPS
evaluated at the representative point index(string) of
each treatment interval have to be divided into # (1 <= # <= 100)
intervals, defined by the quantiles of the GPS evaluated at the representative
point index(string).

family(string) specifies the distribution family
name of the treated variable. string identifies the distribution family name.

link(string) specifies the link function for the treated
variable. The default is the canonical link for the family specified.

see glm

Optional

t_transf(transformation) specifies the
transformation of the treatment variable used in estimating the GPS. The
default transformation is the identity function. The supported
transformations are the logarithmic transformation, t_transf(ln); the
zero-skewness log transformation, t_transf(lnskew0); the zero-skewness
Box-Cox transformation, t_transf(bcskew0); and the Box-Cox
transformation, t_transf(boxcox).

normal_test(test) specifies the goodness-of-fit
test that gpscore will perform to assess the validity of the assumed
normal distribution model for the treatment conditional on the covariates. By
default, gpscore performs the Kolmogorov-Smirnov test
(normal_test(ksmirnov)). Possible alternatives are the Shapiro-Francia
test, normal_test(sfrancia); the Shapiro-Wilk test,
normal_test(swilk); and the Stata skewness and kurtosis
test for normality, normal_test(sktest).

norm_level(#) sets the significance level of
the goodness-of-fit test for normality. The default is norm_level(0.05).

test_varlist(varlist) specifies that the extent
of covariate balancing has to be inspected for each variable of varlist.
The default varlist consists of the variables used to estimate the GPS.
This option is useful when there are categorical variables among the
covariates to test the balancing property for the omitted group.

test(type) specifies whether the balancing
property has to be tested using a standard two-sided t test (the default) or a
Bayes-factor-based method.

flag_b(#) skips either the balancing or the
normal test or both, takes as argument 0; 1; 2. If not specified in the commands
the program estimates the gpscore performing both the balancing and
the normal test. flag_b(0) skips both the balancing and the
normal test; flag_b(1) skips only the balancing test; flag_b(2)
skips only the normal test.

opt_nb(string) negative binomial dispersion
parameter. In the GLM approach you specify fam(nb #k) where #k
is specified through the option opt_nb. The GLM then searches for
#k that results in the deviance-based dispersion being 1. Instead,
nbreg finds the ML estimate of #k.

opt_b(varname) name of the variable which contains the
number of binomial trials.

detail displays more detailed output showing the results of the
goodness-of-fit test for normality, some summary statistics of the
distribution of the GPS evaluated at the representative point of each
treatment interval, and the results of the balancing test within each
treatment interval.

Remarks

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.
Otherwise, this program may not run properly.

Pay attention to the family-link combination, not all the combinations
are feasible.

Make sure that the variables in varlist do not contain missing
values.

Examples

. egen max_p=max(prize)
. gen fraction= prize/max_p

. qui gen cut1 = 23/max_p if fraction<=23/max_p
. qui replace cut1 = 80/max_p if fraction>23/max_p & fraction<=80/max_p
. qui replace cut1 = 485/max_p if fraction >80/max_p

. #delimit ;
. gpscore2 male ownhs owncoll tixbot workthen yearw yearm1 yearm2,
. t(fraction) gpscore(gpscore)
. predict(y_hat_ns) sigma(sd_ns) cutpoints(cut1) index(mean)
. nq_gps(5) family(binomial) link(logit) det
. ;

. gen edu=owncoll+ownhs

. qui gen cut3 = 3 if edu<=3
. qui replace cut3 = 6 if edu>3 & edu<=6
. qui replace cut3 = 9 if edu >6

. #delimit ;
. gpscore2 male workthen yearw yearm1 yearm2,
. t(edu) gpscore(nostro)
. predict(y_hat_ns) sigma(sd_ns) cutpoints(cut3) index(p50)
. nq_gps(5) family(nb) link(log)
. ;

Reference

Hirano, K., and G. W. Imbens. 2004. The propensity score with continuous
treatments. In
Applied Bayesian Modeling and Causal Inference from Incomplete-Data
Perspectives, ed. A. Gelman and X.-L. Meng, 73-84. West Sussex, England:
Wiley InterScience.

Papke L.E. and J.M. Wooldridge. 1996.
Econometric Methods for fractional response variables with an application to 401(K) plan Partecipation rates.
Journal of Applied Econometrics, 11(6): 619-632.

Rabe-Hesketh S. and B. Everitt. 2000.
A Handbook of Statistical Analyses using Stata.
Second eds, Chapman & Hall/Crc. Boca Raton London New York Washington
D.C..

Acknowledgment

We thank Professor H. Hirano, A. Mattei and J. Wooldridge for their
useful comments and suggestions in an early stage of the work.

Authors

Barbara Guardabascio

ISTAT, Italian National Institute of Statistics

National Accounts and Economic Statistics Department

guardabascio@istat.it

Marco Ventura

ISTAT, Italian National Institute of Statistics

Econometric Studies and Economic Forecasting Division

mventura@istat.it

Also see

Article: Stata Journal, volume 9, number 4: st0150_2,

Stata Journal, volume 8, number 4: st0150_1,

Stata Journal, volume 8, number 3: st0150

Online: gpscore, doseresponse, doseresponse2, doseresponse_model