EupRoutine
Description
Estimation of Panel Data Models with Interactive Fixed Effects.
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13  Eup(formula,
additive.effects = c("none", "individual", "time", "twoways"),
dim.criterion = c("PC1", "PC2", "PC3", "BIC3","IC1", "IC2" , "IC3",
"IPC1", "IPC2", "IPC3"),
d.max = NULL,
sig2.hat = NULL,
factor.dim = NULL,
double.iteration = TRUE,
start.beta = NULL,
max.iteration = 500,
convergence = 1e6,
restrict.mode = c("restrict.factors", "restrict.loadings"),
...)

Arguments
formula 
An object of class 'formula' where the arguments are matrices. The number of rows has to be equal to the temporal dimension and the number of columns has to be equal to the number of individuals. The details of model specification are given under 'Details'. 
additive.effects 
Type of Data Transformations:

dim.criterion 
The dimensionality criterion to be used if 
.
d.max 
Maximal dimension used in the dimensionalitycriteria of Bai
(2009). The default ( 
sig2.hat 
The squared standard deviation of the errorterm required for the computation of some dimensionality criteria. The user can specify it in instead of 
factor.dim 
Dimension of FactorStructure, prespecified
by the user. The default ( 
double.iteration 
logical. If 
start.beta 
allows the user to give a vector of starting values for the slope parameters. 
max.iteration 
controls the maximum number of iterations. The default is '500'. 
convergence 
Convergence condition of the estimators. The default is '1e6'. 
restrict.mode 
Type of Restriction on the FactorStructure:

... 
Additional arguments to be passed to the low level functions. 
Details
'Eup' is a function to estimate equidistant panel data models with unobserved multiple time varying individual effects. The considered model is given by Y_{it}= ∑_{j=1}^Pβ_{j}X_{itj}+v_{it}+ ε_{it}, i=1,...,n; t=1,...,T. Where the individual time trends, v_it, are assumed to come from a finite dimensional factor model: v_{it}=∑_{l=1}^dλ_{il}f_{lt}.
formula
Usual 'formula'object. If you wish to estimate a model without an intercept use '1' in the formulaspecification. Each Variable has to be given as a TxNmatrix. Missing values are not allowed.additive.effects

"none"
: The data is not transformed, except for a subtraction of the overall mean, if the model is estimated with an intercept. The assumed model can be written as Y_{it}=μ+∑_{j=1}^Pβ_{j} X_{itj}+v_{it}+ε_{it}, i=1,...,n; t=1,...,T. The parameter 'mu' is set to zero if '1' is used informula
. 
"individual"
: This is the "within"model, which assumes that there are timeconstant individual effects, alpha_i, besides the individual time trends v_it. The model can be written as Y_{it}=μ + α_{i}+ ∑_{j=1}^Pβ_{j} X_{itj} + v_{it} + ε_{it}, i=1,...,n; t=1,...,T. The parameter 'mu' is set to zero if '1' is used informula
. 
"time"
: This is the "between"model, which assumes that there is a common time trend (for all individuals), theta_t. The model can be written as Y_{it}=μ+ θ_t + ∑_{j=1}^Pβ_{j} X_{itj}+v_i(t)+ε_{it}, i=1,...,n; t=1,...,T. The parameter 'mu' is set to zero if '1' is used informula
. 
"twoways"
: This is the "twoways"model ("within" & "between"), which assumes that there are timeconstant individual effects, alpha_i, and a common time trend, theta_t. The model can be written as Y_{it}=μ+ α_{i} + θ_t +∑_{j=1}^Pβ_{j} X_{itj}+τ_i+v_i(t)+ε_{it}, i=1,...,n; t=1,...,T. The parameter 'mu' is set to zero if '1' is used informula
.

Inferences about the slope parameters can be obtained by using the method summary()
. The type of correlation and heteroskedasticity in the idiosyncratic errors can be specified by
choosing the corresponding number for the argument error.type = c(1, 2, 3, 4, 5, 6, 7, 8)
in summary()
, where

1
: indicates the presence of i.i.d. errors, 
2
: indicates the presence of crosssection heteroskedasticity with n/T \to 0, 
3
: indicates the presence of crosssection correlation and heteroskedasticity with n/T \to 0, 
4
: indicates the presence of heteroskedasticity in the time dimension with T/n \to 0, 
5
: indicates the presence of correlation and heteroskedasticity in the time dimension with T/n \to 0, 
6
: indicates the presence of both time and crosssection dimensions with T/n^2 \to and n/T^2 \to 0, 
7
: indicates the presence of both time and crosssection dimensions with n/T \to c > 0, and 
8
: indicates the presence of correlation and heteroskedasticity in both time and crosssection dimensions with n/T \to c > 0.
The default is 1
. In presence of serial correlations
(cases 5 and 8), the kernel weights required for estimating the
longrun covariance can be externally specified by given a
vector of weights in the argument kernel.weights
. By
default, the function uses internally the linearly decreasing
weights of Newey and West (1987) and a truncation at the lower
integer part of \min(√{n},√{T}). If case 7 or 8 are chosen, the method summary()
calculates the realization of the bias corrected estimators and gives appropriate inference. The bias corrected coefficients can be called by using the method coef()
to the object produced by summary()
.
Value
'Eup' returns an object of 'class' '"Eup"' containing the following components:
dat.matrix: Whole data set stored within a (N*T)x(p+1)Matrix, where P is the number of independent variables without the intercept.
formula: returns the used formula object.
dat.dim: Vector of length 3: c(T,N,p)
slope.para: Betaparameters
names: Names of the dependent and independent variables.
is.intercept: logical.Used an intercept in the formula?: TRUE or FALSE
additive.effects: Additive effect type. One of: "none","individual","time", "twoways".
Intercept: Interceptparameter. Tacks the value 0 if it is not specified in the model.
Add.Ind.Eff: Estimated values of additive individual effects. If additive individual effects are not specified in the model, the function returns a vector of zeros.
Add.Tim.Eff: Estimated values of additive time effects. If this effects are not specified in the model, the function returns a vector of zeros.
unob.factors: Txdmatrix of estimated unobserved common factors, where 'd' is the number of used factors.
ind.loadings: Nxdmatrix of loadings parameters.
unob.fact.stru: TxNmatrix of the estimated factor structure. Each column represents an estimated individual unobserved time trend.
used.dim: Used dimension 'd' to calculate the factor structure.
proposed.dim: Indicates whether the user has specified the factor dimension or not.
optimal.dim: The optimal dimension calculated internally.
factor.dim: The userspecified factor dimension. Default is
NULL
d.max: The maximum number of factors used to estimate the optimal dimension.
dim.criterion: The used dimensionality criterion.
OvMeans: A vector that contains the overall means of the observed variables (Y and X).
ColMean: A matrix that contains the column means of the observed variables (Y and X).
RowMean: A matrix that contains the row means of the observed variables (Y and X).
max.iteration: The maximum number of iterations. The default is '500'.
convergence: The convergence condition. The default is '1e6'.
start.beta: A vector of userspecified starting values for the estimation of the betaparameters. Default is
NULL
.Nbr.iteration: Number of iterations required for the computation.
fitted.values: Fitted values.
orig.Y: Original values of the dependent variable.
residuals: Original values of the dependent variable.
sig2.hat.dim: userspecified variance estimator of the errors. Default is
NULL
.sig2.hat: Estimated variance of the error term.
degrees.of.freedom: Degrees of freedom of the residuals.
call
Author(s)
Oualid Bada
References
Bai, J., 2009 “Panel data models with interactive fixed effects”, Econometrica
Bada, O. and Kneip, A., 2014 “Parameter Cascading for Panel Models with Unknown Number of Unobserved Factors: An Application to the Credit Spread Puzzle”, Computational Statistics \& Data Analysis (forthcoming)
See Also
KSS, OptDim
Examples
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 27 28 29  ## See the example in 'help(Cigar)' in order to take a look at the
## data set 'Cigar'
##########
## DATA ##
##########
data(Cigar)
## PanelDimensions:
N < 46
T < 30
## Dependent variable:
## CigaretteSales per Capita
d.l.Consumption < diff(log(matrix(Cigar$sales, T,N)))
## Independent variables:
## Consumer Price Index
cpi < matrix(Cigar$cpi, T,N)
## Real Price per Pack of Cigarettes
d.l.Price < diff(log(matrix(Cigar$price, T,N)/cpi))
## Real Disposable Income per Capita
d.l.Income < diff(log(matrix(Cigar$ndi, T,N)/cpi))
## Estimation:
Eup.fit < Eup(d.l.Consumption~d.l.Price+d.l.Income)
(Eup.fit.sum < summary(Eup.fit))
## Plot the components of the estimated individual effects
plot(Eup.fit.sum)
