Skip to contents

apexog 0.22.0

  • firststage = "biprobit" accepts an AIE target: the interaction of the 0/1 treatment with an exogenous moderator, binary or continuous, e.g. endog = d ~ z + z:m, aie = c("d", "m") with m among the controls. The product enters only the outcome equation of the joint fit; the AIE is the interaction contrast of the average structural function under joint normality, with an MLE delta-method SE. The model has one error correlation for all values of the moderator, which can make this AIE much more precise than an instrumental-variable contrast (and different from it). Agrees with Stata apexog 0.22.0, whose implementation is independent of this one.
  • Fix: the standard error of a binary-by-binary AIE with the control-function engine. The Jacobian entries of the two interactors and their product used j - X_i, k - Z_i and jk - X_i Z_i instead of the counterfactual values j, k and jk; point estimates were not affected. In the validation data the corrected SE is 3% to 13% larger. New tests differentiate the full two-step estimator numerically for this case.
  • The print note for a 0/1 treatment with linear first stages inside an interaction now points to the bivariate probit. Mirrors Stata apexog 0.22.0.

apexog 0.21.2

Display and documentation only: no estimate, standard error or interval changes. Mirrors Stata apexog 0.21.2.

  • print() labels the standard error of the control-function estimator “two-step” (the Murphy-Topel parameter covariance plus the direct first-stage term, as computed since 0.21.0). The vce element still holds "Murphy-Topel".
  • A note is printed when a 0/1 endogenous regressor has a linear first stage. A binary treatment cannot have the normal linear first stage the control-function model assumes, so the effect is a descriptive fitted contrast, not a causal estimate; use firststage = "biprobit" or "probit" when a causal reading is intended. The regressors concerned are returned in the new binlin element.
  • gunits = "structural": print() states that the conversion uses the baseline sigma_tilde, which is exact only at gamma = 0. With one continuous endogenous regressor, one instrument and a linear first stage it reports the limit |pi_z| / sigma_v below which a structural value has a unique index-scale counterpart (new element gs_max, NA otherwise), and warns when the UCI box or LTZ prior draws reach it. For a 0/1 regressor with a linear first stage the conversion is not derived, and a warning says so.

apexog 0.21.1

  • Fractional-probit first stage (firststage = "fprobit"): the first-stage weight, minus the derivative of the generalized residual in the first-stage index, now uses the formula for a fractional regressor, chat * (wpi + chat) + d * (1 - d) * (phi / (Phi * (1 - Phi)))^2. Versions through 0.21.0 used the binary-probit identity chat * (wpi + chat), which holds only for a 0/1 regressor. Point estimates are unchanged; the mean standard error with a fractional-probit first stage moves by at most about 3%, in either direction, in the validation design, because the two places the weight enters largely offset each other. All other first stages, and a fractional-probit first stage on a 0/1 regressor, are unchanged. Mirrors Stata apexog 0.21.1.
  • New tests check the fractional-probit and Poisson first stages against a stacked two-step estimator differentiated numerically in every parameter.

apexog 0.21.0

  • The standard error of every two-step effect (APE and AIE, all first stages, cfinteract, cluster-robust) now adds the direct dependence of the effect on the estimated first-stage parameters through the control function: the influence function is J_beta' psi_beta + J_pi' psi_pi, where versions through 0.20.1 used only the first term (as does Stata’s cfprobit followed by margins). Point estimates are unchanged; standard errors move by about 1% in the validation designs, in either direction. The bivariate-probit engine is unaffected. Mirrors Stata apexog 0.21.0.

apexog 0.20.1

First public release of the R package, a port of the Stata command apexog 0.20.1 that gives the same results.

  • apexog() with method = "uci" (union of confidence intervals over a range for the violation) and method = "ltz" (local-to-zero interval under a prior: normal, uniform, chi-squared, t, gamma, Poisson, an empirical donor, a function, or user-supplied draws), with a sweep over prior widths.
  • Control-function probit with a linear, probit, fractional-probit or Poisson first stage and Murphy-Topel two-step standard errors; recursive bivariate probit for one binary treatment.
  • Average partial effects of every endogenous regressor, or an average interaction effect (continuous by continuous, continuous by binary, binary by binary), including an endogenous treatment interacted with a moderator.
  • The violation on the latent index, in probability points or on the structural latent scale, with the exact probability-scale value of every refit.
  • Robust or cluster-robust standard errors; several instruments and several endogenous regressors.
  • Example data promotion and certification, shipped also as Stata files in inst/extdata.
  • Since Stata apexog 0.20.1 the standard error of an average partial effect with cfinteract includes the sampling variance of the control-function product terms; the R package does the same.