Tests to check the model specifications
checkSpecif.Rd
Tests to check the model specifications
Arguments
- obj1
If
obj2
is left unspecified the specification test proposed by Kneip, Sickles, and Song (2012) is computed. In this caseobj1
can be an object of class 'KSS
' or 'Eup
'. The givenKSS
- orEup
-model needs unspecified factor dimensions (factor.dim=NULL
). See also the Details.If
obj2
is specified by an object of class 'Eup
' the Hausman-type test proposed by Bai (2009) is computed, which compares the model inobj1
with the model inobj2
. The Hausman-type test of Bai applies to 'Eup
'-objects only. See also the Details.
- obj2
An object of class '
Eup
'. Ifobj2
is left unspecified the test proposed by Kneip, Sickles, and Song (2012) is computed.- level
The significance level.
Details
This function is equipped with two types of specification-tests:
The first specification-tests is the Hausman-type test proposed by Bai (2009), which is computed if
obj1
as well asobj2
are specified by 'Eup
'-objects. In this case the model given to the argumentsobj1
andobj2
are compared with each other. Note that this test assumes that the (unobserved) true factor dimension is lower or equal to 2; see Section 9 in Bai (2009) for more details. Given the assumption that there is only one unobserved common factor:Null-Hypothesis: 'The unobserved common factor is a classical
individual
ortime
effect'.Alternative-Hypothesis: 'The unobserved common factor is an arbitrary process'.
Null-Hypothesis: 'The two unobserved common factors are classical
twoways
effects'.Alternative-Hypothesis: 'The two unobserved common factors are arbitrary processes'.
The second specification-test tests the existence of an additional factor structure beyond a classical additive effects model; as suggested in Kneip, Sickles, and Song (2012), which is applied if only
obj1
is specified andobj2
is left unspecified. This test can be used for 'Eup
'-objects as well as for 'KSS
'-objects.Null-Hypothesis: 'There are no unobserved common factors beyond the classical
individual
,time
, ortwoways
effects'.Alternative-Hypothesis: 'There are additional unobserved common factors'.
References
Bai, J., 2009 “Panel data models with interactive fixed effects”, Econometrica
Kneip, A., Sickles, R. C., Song, W., 2012 “A New Panel Data Treatment for Heterogeneity in Time Trends”, Econometric Theory
Examples
## 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))
d.l.Consumption <- diff(l.Consumption)
## 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)
d.l.Price <- diff(l.Price)
## Real Disposable Income per Capita
l.Income <- log(matrix(Cigar$ndi, T,N)/cpi)
d.l.Income <- diff(l.Income)
#####################################################################
## Testing the Sufficiency of a classical 'twoways' effects model: ##
## Hausman-type Test of Bai (2009) ##
#####################################################################
## Model under the null Hypothesis:
twoways.obj <- Eup(d.l.Consumption ~ -1 + d.l.Price + d.l.Income,
factor.dim = 0, additive.effects = "twoways")
## Model under the alternative Hypothesis:
not.twoways.obj <- Eup(d.l.Consumption ~ -1 + d.l.Price + d.l.Income,
factor.dim = 2, additive.effects = "none")
###########
## Test: ##
###########
## (This test returns an error message, since the (unobserved) true
## factor dimension is probably greater than 2.)
if (FALSE) {
checkSpecif(obj1 = twoways.obj, obj2 = not.twoways.obj, level = 0.01)
}
#####################################################################
## Testing the Existence of additional (unobserved) common Factors ##
## Specification Test of Kneip, Sickles, and Song (2012) ##
#####################################################################
## For the model of Bai (2009):
Eup.obj <- Eup(d.l.Consumption ~ -1 + d.l.Price + d.l.Income,
additive.effects = "twoways")
## Test:
checkSpecif(Eup.obj, level = 0.01)
#> ----------------------------------------------
#> Testing the Presence of Interactive Effects
#> Test of Kneip, Sickles, and Song (2012)
#> ----------------------------------------------
#> H0: The factor dimension is equal to 0.
#>
#> Test-Statistic p-value crit.-value sig.-level
#> 13.29 0.00 2.33 0.01
## For the model of Kneip, Sickles, and Song (2012):
KSS.obj <- KSS(l.Consumption ~ -1 + l.Price + l.Income,
additive.effects = "twoways")
## Test:
checkSpecif(KSS.obj, level = 0.01)
#> ----------------------------------------------
#> Testing the Presence of Interactive Effects
#> Test of Kneip, Sickles, and Song (2012)
#> ----------------------------------------------
#> H0: The factor dimension is equal to 0.
#>
#> Test-Statistic p-value crit.-value sig.-level
#> 104229.55 0.00 2.33 0.01