Learn R Programming

frmhet (version 1.1.3)

frmhet: Fitting Fractional Regression Models under Unobserved Heterogeneity

Description

frmhet is used to fit fractional regression models under unobserved heterogeneity, i.e. regression models for proportions, percentages or fractions that suffer from neglected heterogeneity and/or endogeneity issues.

Usage

frmhet(y, x, z = x, var.endog, start, type = "GMMx", link = "logit", intercept = T, table = T, variance = T, var.type = "robust", var.cluster, adjust = 0, ...)

Arguments

y
a numeric vector containing the values of the response variable.
x
a numeric matrix, with column names, containing the values of all covariates (exogenous and endogenous).
z
a numeric matrix, with column names, containing the values of all exogenous variables (covariates and instrumental variables). Defaults to x.
var.endog
a numeric vector containing the values of the endogenous covariate (or of some transformation of it), which will be used as dependent variable in the linear reduced form assumed for application of xv-type estimators.
start
a numeric vector containing the initial values for the parameters to be optimized. Optional.
type
a description of the estimator to compute: GMMx (the default), GMMxv, GMMz, LINx, LINxv, LINz or QMLxv.
link
a description of the link function to use. Available options for all estimators: logit and cloglog. Additional available options for QML and LIN estimators: probit, cauchit and loglog.
intercept
a logical value indicating whether the model should include a constant term or not.
table
a logical value indicating whether a summary table with the regression results should be printed.
variance
a logical value indicating whether the variance of the estimated parameters should be calculated. Defaults to TRUE whenever table = TRUE.
var.type
a description of the type of variance of the estimated parameters to be calculated. Options are robust, the default, and cluster.
var.cluster
a numeric vector containing the values of the variable that specifies to which cluster each observation belongs.
adjust
the numeric value to be added to the response variable in case of boundary observations when the LIN estimators are applied or the string drop, which implies that the boundary observations are dropped.
...
Arguments to pass to nlminb.

Value

frmhet returns a list with the following elements:In case of an overidentifying model, the following element is also returned:If variance = TRUE or table = TRUE and the algorithm converged successfully, the previous list also contains the following elements:If var.type = "cluster", the list also contains the following element:

Details

frmhet computes the GMM estimators proposed in Ramalho and Ramalho (2016) for fractional regression models with unobserved heterogeneity: GMMx, which allows for neglected heterogeneity but not for endogeneity; GMMxv, which allows both issues and assumes a linear reduced form for the endogeneous covariate (or for a transformation of it); and GMMz, which also allows for both issues but does not require the assumption of a reduced form for the endogenous covariate. In addition, frmhet also computes three linearized estimators (LINx, LINxv and LINz) that have similar features to their GMM counterparts as well as a QML estimator that allows for endogeneity but not for neglected heterogeneity (QMLxv); see Ramalho and Ramalho (2016) for details on each estimator. For overidentified models, frmhet calculates Hansen's J statistic. For GMMx and LINx, frmhet stores the information needed to implement the RESET test (frmhet.reset). For all estimators, frmhet stores the information needed to calculate partial effects (frmhet.pe).

References

Ramalho, E.A. and J.J.S. Ramalho (2016), "Moment-based estimation of nonlinear regression models with boundary outcomes and endogeneity, with applications to nonnegative and fractional responses", Econometric Reviews, forthcoming (DOI: 10.1080/07474938.2014.976531).

See Also

frmhet.reset, for the RESET test. frmhet.pe, for computing partial effects. frm, for fitting standard cross-sectional fractional regression models. frmpd, for fitting panel data fractional regression models.

Examples

Run this code
N <- 250
u <- rnorm(N)

X <- cbind(rnorm(N),rnorm(N))
dimnames(X)[[2]] <- c("X1","X2")

Z <- cbind(rnorm(N),rnorm(N),rnorm(N))
dimnames(Z)[[2]] <- c("Z1","Z2","Z3")

y <- exp(X[,1]+X[,2]+u)/(1+exp(X[,1]+X[,2]+u))

#Exogeneity, GMMx estimator
frmhet(y,X,type="GMMx")

#Endogeneity, GMMz estimator
frmhet(y,X,Z,type="GMMz")

#Endogeneity, GMMxv estimator
frmhet(y,X,Z,X[,1],type="GMMxv")

## See the website http://evunix.uevora.pt/~jsr/FRM.htm for more examples.

Run the code above in your browser using DataLab