frmpd
is used to fit panel data regression models when the dependent variable has a bounded, fractional nature.
1 2 3 
id 
a numeric vector identifying the crosssectional units. 
time 
a numeric vector identifying the time periods in which the crosssectional units were observed. 
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 external instrumental variables). Only required in case of endogenous explanatory variables. 
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 the 
x.exogenous 
a logical value indicating whether all explanatory variables are assumed to be exogenous or not. 
lags 
a logical value indicating whether the first lags of 
start 
a numeric vector containing the initial values for the parameters to be optimized. Optional. 
type 
a description of the estimator to compute: 
GMMww.cor 
a logical value indicating whether each explanatory variable should be transformed in deviations from its overall
mean before computing the 
link 
a description of the link function to use. Available options for all GMM estimators: 
intercept 
a logical value indicating whether the model should include a constant term or not. Only relevant for the

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 
tdummies 
a logical value indicating whether time dummies should be included among the model explanatory variables. 
bootstrap 
a logical value indicating whether bootstrap should be used in the estimation of the parameter standard errors. 
B 
the number of bootstrap replications. 
... 
Arguments to pass to nlminb. 
frmpd
computes the GMM estimators proposed in Ramalho and Ramalho (2016)
for panel data fractional regression models with both timevariant and timeinvariant
unobserved heterogeneity and endogeneous covariates: GMMww, GMMc, GMMbgw, GMMpfe, GMMcre
and GMMpre. In addition, frmpd
also computes QMLcre, which was proposed by Papke
and Wooldridge (2008) and Wooldridge (2010). For overidentified models, frmpd
calculates Hansen's J statistic.
frmhpd
returns a list with the following elements:
type 
the name of the estimator computed. 
link 
the name of the specified link. 
p 
a named vector of coefficients. 
Hy 
the transformed values of the response variable when GMM estimators are computed or the values of the response variable in the QML case. 
converged 
logical. Was the algorithm judged to have converged? 
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. 
Joaquim J.S. Ramalho <jsr@uevora.pt>
Papke, L. and Wooldridge, J.M. (2008), "Panel data methods for fractional response variables with an application to test pass rates", Journal of Econometrics, 145(12), 121233.
Ramalho, E.A. and J.J.S. Ramalho (2016), "Exponential regression of fractionalresponse fixedefects models with an application to firm capital structure", mimeo.
Wooldridge, J.M. (2010), "Correlated random effects models with unbalanced panels", mimeo.
frm
, for fitting standard crosssectional fractional regression models.
frmhet
, for fitting crosssectional fractional regression models with unobserved heterogeneity.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  id < rep(1:50,each=5)
time < rep(1:5,50)
NT < 250
XBu < rnorm(NT)
y < exp(XBu)/(1+exp(XBu))
X < cbind(rnorm(NT),rnorm(NT))
dimnames(X)[[2]] < c("X1","X2")
Z < cbind(rnorm(NT),rnorm(NT),rnorm(NT))
dimnames(Z)[[2]] < c("Z1","Z2","Z3")
# Exogeneity, no lags, no time dummies, clustered standard errors, GMMbgw estimator
frmpd(id,time,y,X,type="GMMbgw")
# Lagged covariates and instruments, robust standard errors, GMMww estimator
frmpd(id,time,y,X,lags=TRUE,type="GMMww",var.type="robust")
# Endogeneity, time dummies, GMMpfe estimator
frmpd(id,time,y,X,Z,x.exogenous=FALSE,type="GMMpfe",tdummies=TRUE)
# Standard errors based on 100 bootstrap samples, QMLcre estimator (not run)
#frmpd(id,time,y,X,Z,X[,1],x.exogenous=FALSE,type="QMLcre",link="probit",bootstrap=TRUE,B=100)
## See the website http://evunix.uevora.pt/~jsr/FRM.htm for more examples.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.