Learn R Programming

bife (version 0.1)

bife: Binary Choice Models with Fixed Effects

Description

bife is used to fit fixed effects binary choice models (logit and probit) based on an unconditional likelihood approach. It is tailored for the fast estimation of binary choice models with potentially many individual fixed effects. The large dummy variable trap is avoided by a special iteratively reweighted least squares demeaning algorithm (Stammann, Heiss, and McFadden, 2016). The incidental parameter bias occuring in panels with shorter time horizons can be reduced by analytic or jackknife bias-correction (Newey and Hahn, 2004). If no bias-correction is applied, the estimated coefficients will be identical to the ones obtained by glm. However, bife will compute faster than glm, if the model exhibits many fixed effects.

Remark: The term fixed effect is used in econometrician`s sense of having a time-constant dummy for each individual. All other parameters in the model are referred to as structural parameters.

Usage

bife(formula, data = list(), beta.start = NULL, model = "logit", bias.corr = "ana", iter.demeaning = 100, tol.demeaning = 1e-05, iter.offset = 1000, tol.offset = 1e-05)

Arguments

formula
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. formula must be of type $y ~ x | id$ where the id refers to an individual identifier.
data
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.
beta.start
an optional vector of starting values used for the structural parameters in the demeaning algorithm. Default is zero for all structural parameters.
model
the description of the error distribution and link function to be used in the model. For bife this has to be a character string naming the model function. The value should be any of "logit" or "probit". Default is "logit".
bias.corr
an optional string that specifies the type of the bias-correction: no bias-correction, analytical, jackknife. The value should be any of "no", "ana", or "jack". Default is "ana" (analytical).
iter.demeaning
an optional integer value that specifies the maximum number of iterations of the demeaning algorithm. Default is 100. Details are given under Details.
tol.demeaning
an optional number that specifies the tolerance level of the demeaning algorithm. Default is 1e-5. Details are given under Details.
iter.offset
an optional integer value that specifies the maximum number of iterations of the offset algorithm for the computation of bias-adjusted fixed effects. Default is 1000. Details are given under Details.
tol.offset
an optional number that specifies the tolerance level of the offset algorithm for the computation of bias-adjusted fixed effects. Default is 1e-5. Details are given under Details.

Value

An object of class bife is a list containing the following components:

Details

A typical predictor has the form $response ~ terms | id$ where response is the binary response vector (0-1 coded), terms is a series of terms which specifies a linear predictor for the response, and refers to an individual identifier. The linear predictor must not include any constant regressors due to the perfect collinearity with the fixed effects. Since individuals with a non-varying response do not contribute to the log likelihood they are dropped from the estimation procedure (unlike glm). The analytical and jackknife bias-correction follow Newey and Hahn (2004).

Details for iter.demeaning and tol.demeaning: A special iteratively reweighted least squares demeaning algorithm is used following Stammann, A., F. Heiss, and D. McFadden (2016). The stopping criterion is defined as $||b(i) - b(i - 1)|| < tol.demeaning$.

Details for iter.offset and tol.offset: The bias-adjusted fixed effects are computed via an iteratively reweighted least (IWLS) squares algorithm efficiently tailored to sparse data. The algorithm includes the bias-corrected structural parameters in the linear predictor during fitting. The stopping criterion in the IWLS algorithm is defined as $any(|b(i) - b(i - 1)| / |b(i - 1)|) < tol.offset$.

References

Hahn, J., and W. Newey (2004). "Jackknife and analytical bias reduction for nonlinear panel models". Econometrica 72(4), 1295-1319.

Stammann, A., F. Heiss, and D. McFadden (2016). "Estimating Fixed Effects Logit Models with Large Panel Data". Working paper.

Examples

Run this code
library("bife")

# Load 'psid' dataset
data.set <- psid
head(data.set)

# Fixed effects logit model w/o bias-correction
mod.no <- bife(LFP ~ AGE + I(INCH / 1000) + KID1 + KID2 + KID3 | ID, 
 data = data.set, bias.corr = "no")

# Summary of uncorrected structural parameters only        
summary(mod.no)

# Summary plus fixed effects
summary(mod.no, fixed = TRUE)

# Fixed effects logit model with analytical bias-correction
mod.ana <- bife(LFP ~ AGE + I(INCH / 1000) + KID1 + KID2 + KID3 | ID,
 data = data.set)
               
# Summary of bias-corrected structural parameters only
summary(mod.ana)

# Summary of uncorrected structural parameters only
summary(mod.ana, corrected = FALSE)

# Summary of bias-corrected structural parameters plus -adjusted
# fixed effects
summary(mod.ana, fixed = TRUE)

# Extract bias-corrected structural parameters of mod.ana
beta.ana <- coef(mod.ana)
print(beta.ana)

# Extract bias-adjusted fixed effects of mod.ana
alpha.ana <- coef(mod.ana, fixed = TRUE)
print(alpha.ana)

# Extract uncorrected structural parameters of mod.ana
beta.no <- coef(mod.ana, corrected = FALSE)
print(beta.no)

# Extract covariance matrix of bias-corrected structural
# parameters of mod.ana
vcov.ana <- vcov(mod.ana)
print(vcov.ana)

# Extract covariance matrix of uncorrected structural parameters
# of mod.ana
vcov.no <- vcov(mod.ana, corrected = FALSE)
print(vcov.no)

Run the code above in your browser using DataLab