*! version 2.0 23jul2021

help ggt

Title

ggt -- Geweke, Gowrisankaran, and Town Model Quality Estimator

Syntax

ggt,
outcomevar(varname)
orgchar(varname)
indID(varname)
orgID(varname)
choicechar(varlist)
[
options]

Description

This program estimates the parameters of the Geweke, Gowrisankaran, and Town (2003), "GGT," model.
The GGT model estimates the posterior distribution of organizational performance where there are
many organizations from which individuals can choose to receive services. In this framework, individuals
may select organizations based, in part, on information that is unobserved to the researcher and is
correlated with the binary outcome. If this is the case, then standard approaches to inferring
organization performance will yield biased estimates. The GGT model corrects for this unobserved selection
allowing for flexible correlation in the error structure across the organizational choice and outcome equations.
The estimation approach is Bayesian. In sum, the model combines an organization choice multinomial probit model
with an individual outcome binary probit model, allowing for correlation across equations for each individual. As noted in GGT,
some possible applications for this model include: hospital quality based on mortality, school performance based on graduation
rates, prison rehabilitation programs based on recidivism rates, and job training programs based on incidence of harassment complaints.

The parameters are estimated using Bayesian inference through Markov chain Monte Carlo techniques to simulate
parameters and latent variables conditional on data to determine the posterior distribution of parameters.
While we present the basics of the model in the associated auxiliary file "ggt_methods.pdf," (accessed via the command: ssc desc ggt),
we encourage all users of this Stata function to read the GGT
paper to fully understand the model, assumptions underneath the model, and parameters used in the estimation.

To speed up the computation process, the program code calls an included C plugin file which estimates the
parameters via MCMC Gibbs Sampling.

Methods and Equations

We include a brief, yet important, explanation of the appropriate GGT model in the auxiliary file "ggt_methods.pdf," which can be obtained
via command ssc desc ggt. This file shows which variables and parameters are references in the calling for the ggt Stata function.

Technical Note: Users may notice some slight differences in the model description of prior
distributions from that in GGT Section 2.2. These do not change the model but do make the Stata
code more tractable. We also describe these changes in the "ggt_methods.pdf" file.

Options

Required Model Variables

outcomevar(varname) is required. It is the name of the variable that indicates the individual outcomes
in the binary probit model. This variable needs to be 0 or 1 for each individual.

orgchoice(varname) is required. It is the name of the variable that indicates the organization
that each individual selects/chooses. This variable should be 0,1 and should sum to 1 for each
individual.

indID(varname) is required. It provides a unique identifier for each individual.

orgID(varname) is required. It provides a unique identifier for each organization.

choicechar(varlist) is required. It specifies the name of the variables that should be
included in the choice equation. These are the Z variables referenced in "ggt_methods.pdf" auxiliary file.

Optional Model Variables

orgchar(varlist) specifies the name of the variables that hold the different organization
characteristics. These are the k and l variables referenced in "ggt_methods.pdf" auxiliary file.
The maximum number of variables in this varlist is 10. The variables must be categorical in nature
and can either be of Stata type string or factor.

indchar(varlist) specifies the name of the variables that should be included in the individual
outcome probit equation. These are the X variables referenced in "ggt_methods.pdf" auxiliary file.
The maximum number of variables in this varlist is 20.

Optional Model Parameters

niter(integer) is the number of iterations for Gibbs sampling. The default is 100000.

alphapriorvar(real) is the diagonal elements of the alpha prior variance-covariance matrix.
The default is 1.

gammapriorvar(real) is the diagonal elements of the gamma prior variance-covariance matrix.
The default is 1.

deltapriorvar(real) is the sigma_gamma^2 term in the prior distribution of delta. See footnote 17 in GGT for information
on choosing this value. The default is 0.038416.

priortau(real, integer) is the hyper-parameters for the organization characteristic variance
hierarchical prior distributions. ggt allows users to specify the s2 and v terms in the hierarchical prior,
s2 / tauo2 ~ chi2(v) for organization characteristic, o. These terms are all referenced in referenced in "ggt_methods.pdf" auxiliary file.
The first and second numbers in priortau() are s2 and v respectively. The default is priortau(1.25,5). Users must specify both elements
if choosing to use this option.

noselection option should be specified if the user does not want to apply the selection
correction. In this case, the program will simply estimate the parameters in GGT equation (1). Note:
The code will also estimate alpha solely for the purpose of comparison.

noconstant option should be specified if the user does not want to include a constant in
the outcome probit equation, i.e. gamma will not include a constant term.

Reporting

savedraws option will save a .csv file in the directory which holds every 100 draws of each parameter
via the MCMC Gibbs Sampling routine.

Examples

In this section, we present the data structure necessary to run ggt along with
3 examples to demonstrate different calls to the program. Please see the auxiliary file "ggt_examples.pdf" for more
detailed explanation of the following data and examples. We provide the sample data, "ggt_test_data.dta"
as an additional auxiliary file as well.

Data Structure

Assume we are interested in hospital quality. The dataset "ggt_test_data.dta" contains data on
300 patients and 8 hospitals. The variables include the individual patient identifier, indnumber, and the hospital identifier,
hospnum. The patient specific variables are mortality and severity.
The individual choice variables are dist and dist2 representing the distance from each patient to each
hospital along with its square (normalized to have similar scales, necessary since the priors are the same). We also have
hospital characteristic variables, hosp_size and hosp_ownership.

In the Stata dataset, there should be an observation for each individual-hospital pair, even if the
individual did not choose that hospital. For example, with 300 patients and 8 hospitals, we have
300*8=2400 observations in the data. Please see the "ggt_test_data.dta" auxiliary file to explore the appropriate dataset format.

. use ggt_test_data.dta

Example 1

Suppose we want to estimate the selection-correction hospital quality measures using all the default settings.

. ggt, outcomevar(mortality) orgchoice(hosp_choice) indID(indnumber) orgID(hospnum) choicechar(dist dist2)

complete

This will apply the selection model using dist and dist2 as the choice characteristics.
Since we did not specify the indchar option, the code will assume only a constant and the hospital choice
for the individual probit model. Additionally, since we did not specify orgchar, the code will assume
no correlation across hospitals via hospital size or ownership. The sampling algorithm will assume the
default prior variance options and number of iterations.

The output on the screen will be the summary statistics for the estimated beta draws via the MCMC Gibbs
sampler. The variable "q_n" respresents the quality for hospital ID, 'n'. The number of observations in
this example is 900- this comes from the default 100000 iterations, saving only every 100th draw, and
deleting the first 10000 draws as burn-in.

Note: The code may take several minutes to complete running due to its computational complexity. Once the
code is complete, the word "complete" will display on the Stata screen.

Example 2

Now, suppose we want to include the severity measure in the morality equation and we also want to allow hospital correlation based on size and ownership.
Additionally, we want to rescale the prior variances based on the structure of the data. Specifically, we want the prior variance of alpha to be 5,
the prior variance of gamma to be 3, selection term for delta to be .1, and the parameters for the hyperpriors to be 1 and 5. Finally, we want to save
the draws for each of the parameters in a csv file to the directory.

. ggt, outcomevar(mortality) orgchoice(hosp_choice) indID(indnumber) orgID(hospnum) choicechar(dist dist2) indchar(severity) orgchar(hosp_size hosp_ownership) alphapriorvar(5) gammapriorvar(3) deltapriorvar(.1) priortau(1,5) savedraws

complete

Example 3

Finally, suppose we wish to compare the results to the case where we do not apply the selection
correction. In this case, the program simply estimates equation (1) in GGT. We can still specify all the
options, but the code will only use those that are necessary. e.g., since the nonselection model assumes
that delta=0, then specifying deltapriorvar is unnecessary.

Note: Even though the equation we wish to estimate does not depend on patient-organization choice
characteristics, the code will still require choice characteristics in its estimation of alpha.

. ggt, outcomevar(mortality) orgchoice(hosp_choice) indID(indnumber) orgID(hospnum) choicechar(dist dist2) indchar(severity) orgchar(hosp_size hosp_ownership) alphapriorvar(5) gammapriorvar(3) priortau(1,5) noselection

complete

References

Geweke, J., Gowrisankaran, G., & Town, R. J. (2003). Bayesian inference for hospital quality in a selection model. Econometrica, 71(4), 1215-1238.