Title

itpscore - Iterative Propensity Score Logistic Regression Model Search Procedure

Syntax

itpscore, treat(newvar) cand(varlist) [ base(varlist)
thr1(#) thr2(#) rand(int) keepint viewiter ]

Description

The itpscore routine implements the Imbens and Rubin (2015) algorithm that identifies the “best” propensity score model by selecting covariates that lead to the greatest gains in the logit log-likelihood function.
The method executes the following steps:

(1) Estimate a baseline logistic regression model with user-specified baseline covariates and a constant term. Record the baseline log-likelihood as L_0.

(2) For each user-specified candidate covariate, estimate a model that includes all baseline model variables and the candidate covariate. Record the resulting log-likelihood for each model.

(3) Of the models estimated in (2), select the model/candidate covariate with the highest log-likelihood. Record this likelihood value as L_1 and designate the corresponding covariate as the “best” covariate.

(4) If model improvement of the “best” covariate satisfies the inclusion condition 2*(L_1 – L_0})>T_1, add the “best” covariate to the iterative model. Designate the updated iterative model as the new baseline model and repeat steps (1)–(4) until the inequality in (4) is no longer satisfied. (Note: By default, T_1=2.71. See the thr1 option below to alter this value.)

(5) Generate first order interaction and quadratic terms for use as candidate variables. Repeat steps (1)–(4) on a new set of candidate variables using the updated inclusion condition 2*(L_1 – L_0})>T_2. The procedure terminates when no additional candidate variables satisfy the inclusion condition given the updated baseline model.

Required Inputs

Users must define the following arguments specifying a binary outcome and a set of candidate covariates.

treat(newvar) Variable suitable for serving as an outcome in a logit probability model taking values of 0 and 1. This variable will serve as the treatment variable in subsequent estimation.

cand(varlist) A list of variables that are candidates for inclusion in the iterative predictive logit model of the treatment variable. Categorical variables with three or more categories are not permitted. The program accepts two or more candidate covariates. Variable names must be <= 15 characters. Longer variable names may lead to the creation of interaction terms with names that exceed Stata’s 32-character limit for variable names.

Optional Inputs

base(varlist) A list of variables for default inclusion in the predictive logit model of outcome. Categorical variables with three or more categories are not permitted. The program accepts one or more baseline covariates. Variable names must be <= 15 characters. Longer variable names may lead to the creation of interaction terms with names that exceed Stata’s 32-character limit for variable names.

thr1(real) Specifies the log-likelihood improvement threshold that must be satisfied for the inclusion of linear terms into the iterative model according to 2*(L_1 – L_0})> thr1 where L_0 is the log-likelihood of current model and L_1 is the log-likelihood of the “best” model from the current candidate set. The default value of thr1 is 2.71.

thr2(real) Specifies the log-likelihood improvement threshold that must be satisfied for the inclusion of interaction terms into the iterative model according to 2*(L_1 – L_0})> thr2 where L_0 is the log likelihood of current model and L_1 is the log-likelihood of the “best” model from the current candidate set (as explained above). The default value of thr2 is 3.84.

rand(int) Specifies whether to include random normal candidate covariates in the iterative search process. An integer value of 1 or greater generates and includes the specified number of random normal variables as candidate covariates in the search model. This facilitates checking whether selected candidate covariates and interaction terms improve the model more than variables that are known to be randomly generated.

keepint Specifies whether to retain automatically generated interaction terms in the dataset after program execution. By default the program drops automatically generated interaction terms when the program ends. The keepint option overrides this setting to keep all newly generated interactions in the dataset when the program terminates. This is especially helpful when the user wishes to move directly to the next stage of analysis without stopping to manually code interaction terms selected by the itpscore program. See the "Remarks" section below for examples of subsequent analyses.

viewiter Specifies whether the output should print information for each logit model estimated. Activating the option displays the command line call for each logit model, the associated model log likelihood, and the “best” additional covariate from each round of iteration.

Remarks

In the search procedure the program may encounter logit models that converge slowly or do not converge. The authors highly recommend use of Stata’s maximum iteration setting to address such instances. Example code below demonstrates use of this setting. Please see set maxiter.

The authors recommend a default value of 2.71 for thr1 and 3.84 for thr2. These values correspond to t-values of 1.65 and 1.96, respectively. Higher thresholds lead to a fewer selected covariates and shorter program run times.

The itpscore package supports the development of logistic regression models for propensity score and heterogenous treatment effects analysis. The program employs a documented model selection algorithm to identify the set of covariates and interactions that best model a given binary treatment. Upon program completion, the selected model is stored in the global variable covlist. This covlist global variable is suitable for use in the varlist argument of the pscore package, or in the tvar argument of the teffects psmatch program. The itpscore package can also contribute to heterogenous treatment effect analysis with the hte package, which depends upon the pscore package.

When utilizing itpscore before subsequent analyses, consider activating the keepint option to ensure that any interaction terms listed in covlist remain in the data set at program completion.

Use Stata's set seed option to make results using the rand option replicable.

Syntax Template

*-Program Call
itpscore , treat(var1) cand( varlist)

Example

sysuse nlsw88
tab race, gen(race_)

set maxiter 25

itpscore , treat(married) cand(hours tenure south age)

For examples that include output, see our PDF supplement. To access the supplement, type "search itpscore" and click on the itpscore package link. The PDF supplement is posted fow download under ancillary files.

Stored Results

itpscore stores the values and data listed below.

Scalars

r(ll) Log likelihood of the last completed model

r(ll_0) Log likelihood including baseline covariates only

r(max_ll) Log likelihood of “best” model

r(n_regs) Total number of regression models estimated

r(rand_cov) Random covariate parameter setting

r(thresh1) Improvement threshold for linear terms

r(thresh2) Improvement threshold for interactions

Strings

r(base_covs) Baseline covariate variables

r(covlist) Selected model from iterative search procedure

r(treat) Treatment variable

Global Variable

covlist Selected model from iterative search procedure

Data

_iterative.dta Shows information for each model estimated including the full model
specification with the candidate covariate, the resulting model log-likelihood, the current
“best” variable, the number of iterations required for logit model convergence,
and a binary indicator of whether models converge. Data set saves to the default working directory, which can
be altered with the "cd" command.

References

Imbens, G., & Rubin, D. (2015). Estimating the Propensity Score. In Causal
Inference for Statistics, Social, and Biomedical Sciences: An Introduction
(pp. 281-308). Cambridge: Cambridge University Press.
doi:10.1017/CBO9781139025751.014

Authors

Ravaris Moore (Princeton University and Loyola Marymount University, Los Angeles, rlmoore@princeton.edu)

Jennie E. Brand (UCLA, brand@soc.ucla.edu)

Tanvi Shinkre (UCLA, tanvishinkre@ucla.edu)

Thanks for citing this software as follows:

Moore, Ravaris L., Jennie E. Brand, Tanvi Shinkre. 2021. itpscore: Stata module to perform iterative propensity score logistic regression model search procedure.
http://ideas.repec.org/c/boc/bocode/s459018.html

Also see

Online: help for logit; Also see the packages pscore, teffects psmatch and hte.