KSS(formula, additive.effects = c("none", "individual", "time", "twoways"), consult.dim.crit = FALSE, d.max = NULL, sig2.hat = NULL, factor.dim = NULL, level = 0.01, spar = NULL, CV = FALSE, convergence = 1e-6, restrict.mode = c("restrict.factors","restrict.loadings"), ...)
"none"
: for no transformation
"individual"
: for within transformation
"time"
: for between transformation
"twoways"
: for twoways transformation
consult.dim.crit
is FALSE
(default) and
factor.dim
is NULL
:
Only the dimensionality criterion of Kneip, Sickles & Song 2012
is used.
consult.dim.crit
is TRUE
and
factor.dim
is NULL
:
All implemented dimensionality criteria as implemented in the
function OptDim()
are computed and the user
has to select one proposed dimension via a GUI.
OptDim()
. The default (d.max=NULL
) yields to an internal
selection of d.max
.sig2.hat=NULL
) yields to an internal
estimation of sig2.hat
.factor.dim=NULL
) yields to an internal
estimation of factor.dim
.spar=NULL
) (default) and CV=FALSE
spar
is determined via generalized cross validation (GCV).spar
.
CV=FALSE
(default) and spar=NULL
:
The smoothing parameter spar
is determined by GCV.
CV=TRUE
and spar=NULL
:
The smoothing parameter spar
is determined by Leave-one-out
cross validation (CV).
spar
. Default is
convergence=1e-6
."restrict.factors"
: Factors are restricted to have an
euclidean norm of 1.
"restrict.loadings"
: Factor-Loadings are restricted
to have an euclidean norm of 1.
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.
dat.dim
: Vector of length 3: c(T,N,p)
slope.para
: Beta-parameters
beta.V
: Covariance matrix of the beta-parameters.
names
: Names of the dependent and independent variables.
is.intercept
: Used an intercept in the formula?: TRUE or FALSE
additive.effects
: Additive effect type. One of: "none","individual","time", "twoways".
Intercept
: Intercept-parameter
Add.Ind.Eff
: Estimated values of additive individual effects.
Add.Tim.Eff
: Estimated values of additive time effects.
unob.factors
: Txd-matrix of estimated unobserved common
factors, where 'd' is the number of used factors.
ind.loadings
: Nxd-matrix of loadings parameters.
unob.fact.stru
: TxN-matrix of the estimated factor
structure. Each column represents an estimated individual unobserved time trend.
used.dim
: Used dimensionality of the factor structure.
optimal.dim
: List of proposed dimensionalities.
fitted.values
: Fitted values.
orig.Y
: Original values of the dependent variable.
residuals
: Residuals
sig2.hat
: Estimated variance of the error term.
degrees.of.freedom
: Degrees of freedom of the residuals.
call
formula
Usual 'formula'-object. If you wish to
estimate a model without an intercept use '-1' in the
formula-specification. Each Variable has to be given as a
TxN-matrix. Missing values are not allowed.
additive.effects
"none"
: The data is not transformed, except for an
eventually subtraction of the overall mean; if the model is
estimated with an intercept. The assumed model can be written as
$
Y_{it}=\mu+\sum_{j=1}^P\beta_{j}
X_{itj}+v_i(t)+\epsilon_{it}, i=1,...,n; t=1,...,T.$
The parameter 'mu' is set to zero if '-1' is used in formula
.
"individual"
: This is the "within"-model, which
assumes that there are time-constant individual effects,
tau_i, besides the individual time trends v_i(t). The
model can be written as
$
Y_{it}=\mu+\sum_{j=1}^P\beta_{j}
X_{itj}+v_i(t)+\alpha_{i}+\epsilon_{it}, i=1,...,n; t=1,...,T.$
The parameter 'mu' is set to zero if '-1' is used in formula
.
"time"
: This is the "between"-model, which assumes
that there is a common (for all individuals) time trend, beta_0(t). The
model can be written as
$
Y_{it}=\mu+\theta_{t}+\sum_{j=1}^P\beta_{j}
X_{itj}+v_i(t)+\epsilon_{it}, i=1,...,n; t=1,...,T.$
The parameter 'mu' is set to zero if '-1' is used in formula
.
"twoways"
: This is the "twoways"-model ("within" &
"between"), which assumes that there are time-constant
individual effects, tau_i, and a common time trend,
beta_0(t). The model can be written as
$
Y_{it}=\mu+\theta_{t}+\sum_{j=1}^P\beta_{j}
X_{itj}+\alpha_i+v_i(t)+\epsilon_{it}, i=1,...,n; t=1,...,T.$
The parameter 'mu' is set to zero if '-1' is used in formula
.
## See the example in 'help(Cigar)' in order to take a look at the
## data set Cigar
##########
## DATA ##
##########
data(Cigar)
## Panel-Dimensions:
N <- 46
T <- 30
## Dependent variable:
## Cigarette-Sales per Capita
l.Consumption <- log(matrix(Cigar$sales, T,N))
## Independent variables:
## Consumer Price Index
cpi <- matrix(Cigar$cpi, T,N)
## Real Price per Pack of Cigarettes
l.Price <- log(matrix(Cigar$price, T,N)/cpi)
## Real Disposable Income per Capita
l.Income <- log(matrix(Cigar$ndi, T,N)/cpi)
## Estimation:
KSS.fit <- KSS(l.Consumption~l.Price+l.Income, CV=TRUE)
(KSS.fit.sum <- summary(KSS.fit))
plot(KSS.fit.sum)
Run the code above in your browser using DataLab