Title: | Two-Way Error Component SUR Systems Estimation on Unbalanced Panel Data |
---|---|
Description: | Generalized Least Squares (GLS) estimation of Seemingly Unrelated Regression (SUR) systems on unbalanced panel in the one/two-way cases also taking into account the possibility of cross equation restrictions. Methodological details can be found in Biørn (2004) <doi:10.1016/j.jeconom.2003.10.023> and Platoni, Sckokai, Moro (2012) <doi:10.1080/07474938.2011.607098>. |
Authors: | Laura Barbieri [aut, cre], Silvia Platoni [aut] |
Maintainer: | Laura Barbieri <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-03-05 03:02:07 UTC |
Source: | https://github.com/cran/panelSUR |
This function aims to obtain the errors' variance-covariance matrices.
obtainSigmas(modelFrame=modelFrame, firstEstimate=firstEstimate, method=method)
obtainSigmas(modelFrame=modelFrame, firstEstimate=firstEstimate, method=method)
modelFrame |
an object of the class |
firstEstimate |
an object of the class |
method |
the estimation method to be used, one of "1wayWB", "2wayWB", or "2wayQUE". |
An object of class obtainSigmas
, which is a list of the following elements:
Sigma_u |
remainder error variance-covariance matrix, |
Sigma_mu |
individual error variance-covariance matrix, |
Sigma_nu |
time error variance-covariance matrix. |
Allows to estimate one-way and two-way error component SUR systems on unbalanced panel by GLS estimator with or without cross-equation restrictions.
Package: | panelSUR |
Type: | Package |
Version: | 0.1.0 |
Date: | 2024-03-03 |
Biørn E (2004). Regression Systems for Unbalanced Panel Data: a Stepwise Maximum Likelihood Procedure. Journal of Econometrics, 122(2), 181-291.
Platoni S, Barbieri L, Moro D, Sckokai P (2020). Heteroscedastic Stratified Two-way EC Models of Single Equations and SUR Systems. Econometrics and Statistics, 15, 46-66.
Platoni S, Sckokai P, Moro D, (2012a). “A Note on Two-way ECM Estimation of SUR Systems on Unbalanced Panel Data. Econometric Reviews, 31(2), 119–141.
This function aims to compute some post estimation indicators.
postEstimation(modelFrame=modelFrame, firstEstimate=firstEstimate, system=system)
postEstimation(modelFrame=modelFrame, firstEstimate=firstEstimate, system=system)
modelFrame |
an object of the class |
firstEstimate |
an object of the class |
system |
an object of the class |
An object of class postEstimation
, which is the list of R-squared obtained for each equation of the estimated system.
This function aims to obtain the preliminary (single within one or two way) estimate of the system equations.
preliminaryEstimate(modelFrame=modelFrame, method=method)
preliminaryEstimate(modelFrame=modelFrame, method=method)
modelFrame |
an object of the class |
method |
the estimation method to be used, one of "1wayWB", "2wayWB", or "2wayQUE". |
An object of class preliminaryEstimate
, which is a list of the following elements:
f1w |
centered residuals of the oneway within estimation obtained for each single equation of the system, |
f2w |
centered residuals of the twoways within estimation obtained for each single equation of the system, |
mi_f1w |
individual means of the centered oneway within residuals, |
mi_f2w |
individual means of the centered twoways within residuals, |
mt_f2w |
time means of the centered twoways within residuals, |
m_f1w |
mean of the centered oneway within residuals, |
reglist |
list of the regressor matrix of each equation, |
reglist2 |
list of the regressors data frame of each equation, |
regnames |
a vector whose elements are the names of all the variables included in each equation of the system, |
final_regnames |
a vector whose elements are the names of the variables considered in the system equations, taking into account only the first appearance of those affected by restrictions on the coefficients. |
This function prepares data that have to be used.
prepareData(data=data, restrictions=NULL, eqlist=eqlist)
prepareData(data=data, restrictions=NULL, eqlist=eqlist)
eqlist |
a |
restrictions |
a vector containing constraints on the equation coefficients, which should be expressed in the form "equation_name$variable_name". Any spaces should be excluded from the restrictions definition. If one of the constraints includes an intercept term, the variable_name will be simply 'const'. Only simple restrictions involving equality between two parameters are considered, and not linear combinations involving more than two parameters, |
data |
a data frame of the class "pdata.frame" (mandatory). |
An object of class prepareData
, which is a list of the following elements:
eqlist |
list of the equations of the system, |
neq |
number of the system equations, |
varlist |
list of the system variables, |
ncoeff |
number of the system coefficients, |
sumreg |
position of the first variable of each equation, including the constant, in the ordered list of the variables of the system, |
nconstr |
number of contraints, |
constr |
a matrix with as many rows as constraints, and whose row elements indicate the position, in the sorted list of model variables, of the variables affected by each constraint, |
nind |
total number of individuals, |
nt |
total number of individuals observed in each period, |
psur |
table reporting the number of times each individual is observed, |
psurmax |
maximum number of times the individuals are observed in the panel, |
tmax |
number of period included in the panel, |
sumTi |
sum of squares of the numbers of times each individual is observed, |
sumNt |
sum of squares of the numbers of individuals observed in each time period, |
vectorTi |
vector containing the number of times each individual is observed, |
sysdata |
subset of the original data frame containing only the variables used in the estimated system, |
infoSample |
information on the |
This function prints a summary of the estimated equation system.
printSUR(object)
printSUR(object)
object |
an object of class |
No values are returned from the printSUR
function. However, when called, it generates a visual output in the console, consisting of a formatted table containing the results of the SUR estimation and other relevant information.
data("SURdata", package="panelSUR") ## Data preparation library(plm) datap <- pdata.frame(data, index=c("IND", "TIME")) ## Equations specification eq1<-Y1~X1+X2 eq2<-Y2~X1+X2+X3 eqlist<-c(eq1,eq2) ## System estimation mod1<-SURest(eqlist=eqlist,method="1wayWB",data=datap) ## Summary of estimation results printSUR(mod1)
data("SURdata", package="panelSUR") ## Data preparation library(plm) datap <- pdata.frame(data, index=c("IND", "TIME")) ## Equations specification eq1<-Y1~X1+X2 eq2<-Y2~X1+X2+X3 eqlist<-c(eq1,eq2) ## System estimation mod1<-SURest(eqlist=eqlist,method="1wayWB",data=datap) ## Summary of estimation results printSUR(mod1)
The SURdata
dataset consists of an unbalanced panel comprising 100 individuals observed across four time periods for a total of 220 observations (n=100, T=4, N=220). In order to construct this unbalanced panel, the procedure currently used for rotating panels, in which there is approximately the same number of individuals every year, has been used: a fixed percentage of individuals (20% in this case) is replaced each year, but they can re-enter the sample in the following years.
data(SURdata)
data(SURdata)
A large unbalanced panel dataset
Simulated data
SURest
is used to estimate one-way and two-way SUR systems on unbalanced panel data by GLS
estimator also allowing cross-equation restrictions.
SURest(data = data, eqlist = eqlist, restrictions = NULL, method="1wayWB")
SURest(data = data, eqlist = eqlist, restrictions = NULL, method="1wayWB")
eqlist |
a |
restrictions |
a vector containing constraints on the equation coefficients, which should be expressed in the form "equation_name$variable_name". Any spaces should be excluded from the restrictions definition. If one of the constraints includes an intercept term, the variable_name will be simply 'const'. Only simple restrictions involving equality between two parameters are considered, and not linear combinations involving more than two parameters, |
method |
the estimation method to be used, one of "1wayWB", "2wayWB", or "2wayQUE" (see details), |
data |
a data frame of the class "pdata.frame" (mandatory). |
SURest
is a function for the GLS estimation of SUR system
models on (unbalanced) panel data. It supports the following estimation methods: one-way error component procedure based on the Biorn (2004)’s procedure (1wayWB
), two-way error component procedure based on the Biorn (2004)’s procedure (2wayWB
), and the two-way QUE estimation procedure by Platoni et al. (2012) (2wayQUE
).
An object of class SURest
, which is a list of the following elements:
Sigma_u |
remainder error variance-covariance matrix, |
Sigma_mu |
individual error variance-covariance matrix, |
Sigma_nu |
time error variance-covariance matrix, |
varnames |
a vector whose elements are the names of the variables considered in the system equations, taking into account only the first appearance of those affected by restrictions on the coefficients, |
Estimate |
vector of the coefficient estimates of the system equations, taking into account only the first appearance of those affected by restrictions, |
std_error |
vector of the standard errors of the coefficient estimates, taking into account only the first appearance of those affected by restrictions, |
tstat |
vector of the t-statistics associated to the coefficient estimates, taking into account only the first appearance of those affected by restrictions, |
pvalue |
vector of the p-values associated to the t-statistics, |
infoSample |
information on the considered dataset obtained trougth the |
neq |
number of the system equations, |
Rsquared |
list of R-squared obtained for each equation of the estimated system, |
method |
method choosen for the system estimation. |
Biorn E, (2004), Regression Systems for Unbalanced Panel Data: a Stepwise Maximum Likelihood Procedure, Journal of Econometrics, 122(2), 181–291.
Platoni S, Sckokai P, Moro D (2012), A Note on Two-way ECM Estimation of SUR Systems on Unbalanced Panel Data, Econometric Reviews, 31(2), 119–141.
data("SURdata", package="panelSUR") ## Data preparation library(plm) datap <- pdata.frame(data, index=c("IND", "TIME")) ## Equations specification eq1<-Y1~X1+X2 eq2<-Y2~X1+X2+X3 eq3<-Y3~X2+X3 eqlist<-c(eq1,eq2,eq3) ## Constraints specification constraints<-c("eq1$X2=eq2$X1","eq2$X3=eq3$X2") ## System estimation mod1<-SURest(eqlist=eqlist,restrictions=constraints,method="2wayQUE",data=datap)
data("SURdata", package="panelSUR") ## Data preparation library(plm) datap <- pdata.frame(data, index=c("IND", "TIME")) ## Equations specification eq1<-Y1~X1+X2 eq2<-Y2~X1+X2+X3 eq3<-Y3~X2+X3 eqlist<-c(eq1,eq2,eq3) ## Constraints specification constraints<-c("eq1$X2=eq2$X1","eq2$X3=eq3$X2") ## System estimation mod1<-SURest(eqlist=eqlist,restrictions=constraints,method="2wayQUE",data=datap)
This function aims to built and solve the system in order to obtain beta coefficient estimates.
system(modelFrame=modelFrame, firstEstimate=firstEstimate, matrices=matrices)
system(modelFrame=modelFrame, firstEstimate=firstEstimate, matrices=matrices)
modelFrame |
an object of the class |
firstEstimate |
an object of the class |
matrices |
an object of the class |
An object of class system
, which is a list of the following elements:
BsurQ |
vector of the coefficient estimates of the system equations, taking into account only the first appearance of those affected by restrictions, |
std_error |
vector of the standard errors of the coefficient estimates, taking into account only the first appearance of those affected by restrictions, |
t_stat |
vector of the t-statistics associated to the coefficient estimates, taking into account only the first appearance of those affected by restrictions, |
p_value |
vector of the p-values associated to the t-statistics. |