Description Usage Arguments Details Value Author(s) References See Also Examples
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 cross-sectional units. |
time |
a numeric vector identifying the time periods in which the cross-sectional 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 time-variant and time-invariant
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(1-2), 121-233.
Ramalho, E.A. and J.J.S. Ramalho (2016), "Exponential regression of fractional-response fixed-efects 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 cross-sectional fractional regression models.
frmhet
, for fitting cross-sectional 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.
|
*** Fractional logit regression model ***
*** Estimator: GMMbgw
*** Exogeneity: TRUE
*** Use first lag of instruments: FALSE
Estimate Std. Error t value Pr(>|t|)
X1 0.006900 0.070005 0.099 0.921
X2 0.180735 0.056107 3.221 0.001 ***
Note: cluster standard errors
Number of observations (initial): 250
Number of observations (for estimation): 250
Number of cross-sectional units (initial): 50
Number of cross-sectional units (for estimation): 50
Average number of time periods per cross-sectional unit (initial): 5
Average number of time periods per cross-sectional unit (for estimation): 5
*** Fractional logit regression model ***
*** Estimator: GMMww
*** Exogeneity: TRUE
*** Use first lag of instruments: TRUE
Estimate Std. Error t value Pr(>|t|)
X1 0.046964 0.100971 0.465 0.642
X2 0.228841 0.077599 2.949 0.003 ***
Note: robust standard errors
Number of observations (initial): 250
Number of observations (for estimation): 200
Number of cross-sectional units (initial): 50
Number of cross-sectional units (for estimation): 50
Average number of time periods per cross-sectional unit (initial): 5
Average number of time periods per cross-sectional unit (for estimation): 4
*** Fractional logit regression model ***
*** Estimator: GMMpfe
*** Exogeneity: FALSE
*** Use first lag of instruments: FALSE
Estimate Std. Error t value Pr(>|t|)
X1 0.349724 1.119912 0.312 0.755
X2 0.065212 0.520141 0.125 0.900
time.2 0.149044 0.237712 0.627 0.531
time.3 0.158015 0.237236 0.666 0.505
time.4 -0.231380 0.395463 -0.585 0.558
time.5 -0.142335 0.195177 -0.729 0.466
Note: cluster standard errors
Number of observations (initial): 250
Number of observations (for estimation): 250
Number of cross-sectional units (initial): 50
Number of cross-sectional units (for estimation): 50
Average number of time periods per cross-sectional unit (initial): 5
Average number of time periods per cross-sectional unit (for estimation): 5
J test of overidentifying moment conditions: 1.574068 (p-value: 0.2096172 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.