*! version 1 2021-07-01

Title

mfelogit -- Estimation of average marginal effects (AME) and average treatment effects (ATE) in fixed effect logit models.

Syntax

mfelogit varlist [if] [in]
id(string)
time(string)
[,
method(string)
listT(string)
listX(string)
level(string)
eps(string)
ratio(string)]

Description

mfelogit implements the estimators of the sharp bounds on the AME and the related confidence intervals on the AME and ATE from Davezies et al. (DDL hereafter).
It also implements the second method proposed in DDL, which is faster to compute but may result in larger confidence intervals. When the covariate is binary, the command computes the ATE; otherwise it computes the AME.

id specifies the variable used as identifier for the individuals.

time specifies the variable used as identifier for the different periods.

Options

method specifies the method used. Its argument must be one of: "sharp" or "quick" (the default).
Argument "sharp" stands for the first method in DDL.
Argument "quick" stands for the second method in DLL, which is faster.
Note that only the second "quick" method is available for the ATE.

listT specifies at which period the AME/ATE is computed, see Section 5.4 in DDL. It can take the following values:
1) if empty, then the AME/ATE is computed at the last period at which all individuals in the sample are observed. It is indexed by "Tinf" in the final output table. It is the default option; 2)
if a a list with elements in 1 to the maximal number of observed periods is provided, then for each value in this list,
we compute the AME/ATE at the corresponding periods for all the selected covariates. In the final output table the column "T" recalls the values of the periods.
3) if "all": this computes the AME/ATE for all the observed periods similarly to the case above, plus the average over all the periods.
This last case is indexed by "Average" in the final output table.

listX specifies the list of the selected variables for which the AME/ATE is computed. By default, the AME/ATE is computed for all covariates.
Default is to compute it for all.

level sets the value of the level of the confidence intervals (by default, 0.95).

eps specifies the type of confidence interval selected for the first method.
It can be empty, in which case we use CI2, as defined in DDL. If set to a given value different from 0, then CI3 is used with this value for epsilon.
Finally, if set to 0, then CI3 is used with epsilon= ln(ln(n)).

ratio sets the value of the bias/variance ratio in the nonparametric estimator of the first method in DDL (see their Appendix C for more details). The default value is 10.

Table

the command mfelogit returns two tables with the results of the CMLE estimation and the DDL bounds on the AME/ATE.

Saved results

mfelogit saves the following in e():

e(ndiscard), e(n), and e(maxT) refer respectively to the number of observations, discarded observations, and maximal number of observed periods among all the individuals.

The matrices e(mat_results_CMLE) and e(mat_results) refer respectively to the results of the CMLE estimation and the DDL bounds on the AME/ATE.

Finally, the macros e(alpha_rep) and e(vardiscard) save the contents of the footnotes of the tables describing the level used for the confidence intervals and the names of the discarded variables. e(cmd_arguments) contains the mfelogit arguments.

Example: Average marginal effect of age on union membership using panel data.

ssc install mfelogit

use "https://www.stata-press.com/data/r17/union.dta", clear

mfelogit union age black if (year <=78), id("idcode") time("year") method("quick")

References

Davezies L, D’Haultfoeuille X, Laage L (2021).
Identification and Estimation of average marginal effects infixed effect logit models.

Authors

Laurent Davezies, CREST, Palaiseau, France.
laurent.davezies@ensae.fr.

Xavier D'Haultfoeuille, CREST, Palaiseau, France.
xavier.dhaultfoeuille@ensae.fr.

Christophe Gaillac, CREST, Palaiseau, France.
christophe.gaillac@ensae.fr.

Louise Laage, Georgetown University, Washington, USA.
louise.laage@georgetown.edu.