*! version 3.1 March 2023
logitjack

Title

Cluster robust inference for logit models.

Syntax

logitjack varlist, cluster(varname) [ options]

varlist the dependent variable, the independent variable of
interest, and other (binary or continuous) independent variables,

cluster the clustering variable.

fevar(varlist) creates fixed effects for the included
variables, similar to i.varname.

jackknife calculates the jackknife variance estimator
CV3 in addition to CV3L.

sample allows for sample restrictions. For instance,
in order to restrict the analysis to individuals 25 years of age or
older based on a variable "age", sample(age>=25) should be added to
the list of options.

BOOTstrap calculates WCL(U/R) p-values. When
nonull is also specified WCLU p-values and confidence
intervals are calculated and displayed. When nonull is not
specified WCLR p-values are calculated and displayed. The default number of
bootstrap replications is 999. This can be changed using the reps option.
The weight distribution used depends on the number of clusters. When there are
13 or more clusters, then Rademacher weights used. When there are 12 or fewer clusters,
then Webb weights are used.

reps(scalar) changes the number of bootstrap replications. When this option
is not used, and bootstrap values are calculated, 999 replications are used.

nonull specifies that the unrestricted versions of
the wild cluster linearized bootstrap be specified. This option can be used with
or without the bootstrap option. The default number of
bootstrap replications is 999. This can be changed using the reps option.

Description

logitjack is a stand-alone command that calculates a linearized
version of the wild cluster bootstrap for logit models. It will calculate
a CV1 variance estimate, with p-values calculated using the t(G-1) distribution
for the t-statistics. Native Stata uses the t(N-k) distribution which usually
results in over-rejection of the null hypothesis. logitjack calculates a jackknife
variance for the linearized model, CV3L, which in practice is very similar to the
computationally demandind CV3 variance. logitjack also optionally
calculates the brute-force cluster jackknife CV3 variance estimator for logit models.
MacKinnon, Nielsen, and Webb (2024) documents it more fully
than this help file.

logitjack assumes that all omit-one-cluster subsamples are
estimatable. However, in practice some of the omit-one-cluster subsamples
may be singular. logitjack calculates standard errors using a generalized
inverse. Conversely, native Stata will drop the singular subsamples
jackknife: reg y x, cluster(group). Accordingly, the jackknife
option within logitjack can give a different standard error than
native Stata will. The generalized inverse is often desirable as things like
cluster level fixed effects will cause all subsamples to be omitted by Stata.

Stored results

All of the matrices displayed on screen are available in memory after logitjack
runs.

matrix list cvtable shows the various CV standard errors, p-values and confidence intervals.

matrix list clustsum shows the various cluster specific statistics.

matrix list bootstuff shows the various bootstrap p-values. Only available when at least one of the options bootstrap, nonull, or reps are used.

matrix list bootci shows the various bootstrap confidence intervals. Only available when the option nonull is used.

Examples

nlswork -- using logit

. webuse nlswork, clear

. gen age2 = age*age

. drop if race==3

. drop if inlist(ind,41,54)

. gen white = race==1

. logit collgrad south msp white union ln_wage age age2 i.ind, cluster(ind)

nlswork -- using logitjack

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind)

adding brute force jackknife (CV3)

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind) jack

restricted bootstraps using bootstrap or reps.

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind) boots

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind) reps(1999)

unrestricted bootstraps using nonull .

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind) nonull

sample restrictions - using sample

. gen rndsample = runiform()

. logitjack collgrad south msp white union ln_wage age age2 , cluster(ind) fevar(ind)sample(rndsample<=0.5)

Author

Matthew D. Webb

matt.webb@carleton.ca

Citation

logitjack is not an official Stata command. It is a
free contribution to the research community.

Please cite:

James G. MacKinnon, Morten Ø. Nielsen, and Matthew D. Webb.
2024. Cluster-Robust Jackknife and Bootstrap Inference for Binary
Response Models.

***************************************************************