jtest.fct: Hansen J-Test.

View source: R/pdynmc_specTestFcst.R

jtest.fctR Documentation

Hansen J-Test.

Description

jtest.fct tests the validity of the overidentifying restrictions.

Usage

jtest.fct(object)

Arguments

object

An object of class 'pdynmc'.

Details

The null hypothesis is that the overidentifying restrictions are valid. The test statistic is computed as proposed by \insertCiteHan1982large;textualpdynmc. As noted by \insertCiteBow2002testing;textualpdynmc and \insertCiteWin2005;textualpdynmc the test statistic is weakened by many instruments.

Value

An object of class 'htest' which contains the Hansen J-test statistic and corresponding p-value for the null hypothesis that the overidentifying restrictions are valid.

References

\insertAllCited

See Also

pdynmc for fitting a linear dynamic panel data model.

Examples

## Load data
data(ABdata, package = "pdynmc")
dat <- ABdata
dat[,c(4:7)] <- log(dat[,c(4:7)])
dat <- dat[c(140:0), ]

## Code example
m1 <- pdynmc(dat = dat, varname.i = "firm", varname.t = "year",
    use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE,
    include.y = TRUE, varname.y = "emp", lagTerms.y = 2,
    fur.con = TRUE, fur.con.diff = TRUE, fur.con.lev = FALSE,
    varname.reg.fur = c("wage", "capital", "output"), lagTerms.reg.fur = c(1,2,2),
    include.dum = TRUE, dum.diff = TRUE, dum.lev = FALSE, varname.dum = "year",
    w.mat = "iid.err", std.err = "corrected", estimation = "onestep",
    opt.meth = "none")
jtest.fct(m1)


## Load data
 data(ABdata, package = "pdynmc")
 dat <- ABdata
 dat[,c(4:7)] <- log(dat[,c(4:7)])

## Further code example
 m1 <- pdynmc(dat = dat, varname.i = "firm", varname.t = "year",
    use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE,
    include.y = TRUE, varname.y = "emp", lagTerms.y = 2,
    fur.con = TRUE, fur.con.diff = TRUE, fur.con.lev = FALSE,
    varname.reg.fur = c("wage", "capital", "output"), lagTerms.reg.fur = c(1,2,2),
    include.dum = TRUE, dum.diff = TRUE, dum.lev = FALSE, varname.dum = "year",
    w.mat = "iid.err", std.err = "corrected", estimation = "onestep",
    opt.meth = "none")
 jtest.fct(m1)




pdynmc documentation built on Nov. 25, 2023, 1:08 a.m.