Description Usage Arguments Details Value Author(s) References See Also Examples
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.
1 2 
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 
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 xvtype estimators. 
start 
a numeric vector containing the initial values for the parameters to be optimized. Optional. 
type 
a description of the estimator to compute: 
link 
a description of the link function to use. Available options for all estimators: 
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

var.type 
a description of the type of variance of the estimated parameters to be calculated. Options are 
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 
... 
Arguments to pass to nlminb. 
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
returns a list with the following elements:
class 
"frmhet". 
formula 
the model formula. 
type 
the name of the estimator computed. 
link 
the name of the specified link. 
adjust 
The value or the type of the adjustment applied to LIN estimators. 
p 
a named vector of coefficients. 
Hy 
the transformed values of the response variable when GMM or LIN estimators are computed or the values of the response variable in the QML case. 
xbhat 
the fitted mean values of the linear predictor (for xvtype estimators, includes the term relative to the firststage residual). 
converged 
logical. Was the algorithm judged to have converged? 
x.names 
a vector containing the names of the covariates. 
In case of an overidentifying model, the following element is also returned:
J 
the result of Hansen's J test of overidentifying moment conditions. 
If variance = TRUE
or table = TRUE
and the algorithm converged successfully, the previous list also contains the following elements:
p.var 
a named covariance matrix. 
var.type 
covariance matrix type. 
If var.type = "cluster"
, the list also contains the following element:
var.cluster 
the variable that specifies to which cluster each observation belongs. 
Joaquim J.S. Ramalho <jsr@uevora.pt>
Ramalho, E.A. and J.J.S. Ramalho (2016), "Momentbased 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).
frmhet.reset
, for the RESET test.
frmhet.pe
, for computing partial effects.
frm
, for fitting standard crosssectional fractional regression models.
frmpd
, for fitting panel data fractional regression models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  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.

*** Fractional logit regression model ***
*** Estimator: GMMx
Estimate Std. Error t value Pr(>t)
INTERCEPT 0.554438 0.079733 6.954 0.000 ***
X1 1.117545 0.075542 14.794 0.000 ***
X2 0.911219 0.085960 10.601 0.000 ***
Note: robust standard errors
Number of observations: 250
*** Fractional logit regression model ***
*** Estimator: GMMz
Estimate Std. Error t value Pr(>t)
INTERCEPT 1.657879 2.103106 0.788 0.431
X1 2.724974 1.492216 1.826 0.068 *
X2 0.850187 0.537686 1.581 0.114
Note: robust standard errors
Number of observations: 250
J test of overidentifying moment conditions: 0.005818133 (pvalue: 0.939199 )
*** Fractional logit regression model ***
*** Estimator: GMMxv
Estimate Std. Error t value Pr(>t)
INTERCEPT 0.608909 0.187904 3.241 0.001 ***
X1 0.704951 3.761500 0.187 0.851
X2 0.911348 0.083615 10.899 0.000 ***
vhat 1.819200 3.771578 0.482 0.630
Reduced form:
Estimate Std. Error t value Pr(>t)
Z_INTERCEPT 0.033065 0.057744 0.573 0.567
Z_Z1 0.029255 0.058260 0.502 0.616
Z_Z2 0.011648 0.059955 0.194 0.846
Z_Z3 0.020201 0.056958 0.355 0.723
Note: robust standard errors
Number of observations: 250
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.