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.
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, ...)x.
GMMx (the default), GMMxv,
GMMz, LINx, LINxv, LINz or QMLxv.
logit and cloglog.
Additional available options for QML and LIN estimators: probit, cauchit and loglog.
TRUE whenever table = TRUE.
robust, the
default, and cluster.
drop, which implies that the boundary observations are dropped.
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: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).
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.
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