Skip to content

ca.po Pz test question

1 message · Pfaff, Bernhard Dr.

#
Hello Victor,

let me answer your questions in turn:
No, probably you should contact R.More, to clarify the issue.
Incidentally, would it be possible to provide a source for 'R.More';
i.e., to which article, monographie are you referring?
Type 'ca.po' at the prompt and you will see function. Here, you will
find pretty at the beginning of the function's body:
.
.
.
zl <- z[2:nobs, ]
zr <- z[1:(nobs - 1), ] 
.
.
.
and further below:
.
.
.
else if (type == "Pz") {
   test.reg <- summary(lm(zl ~ zr))
.
.
.
hence, the levels of the endogenous variables are regressed on their
first lag. See ?lm for how lm behaves if a matrix/data.frame is on the
left hand side.
Well, to be precise: if you call type = "Pz" and demean = "trend" an
error is returned; and here you caught me. The trend 'trd' is not set
properly, you can fix this easily by inserting the line end marked as:
## inserting fix:


    else if (demean == "trend") {
        ari3 <- 3
        model <- "with constant and linear trend"
        trd <- 1:nobs
        res <- residuals(lm(zl ~ zr + trd))
        if (type == "Pu") {
            trd <- 1:(nobs+1) ## inserting fix
            resu <- residuals(lm(z[, 1] ~ z[, -1] + trd))
            test.reg <- summary(lm(z[, 1] ~ z[, -1] + trd))
        }
        else if (type == "Pz") {
            test.reg <- summary(lm(zl ~ zr + trd))
        }
    }


I will send an corrected version of 'urca' to CRAN; thanks for pointing
this out.

Best,
Bernhard
*****************************************************************
Confidentiality Note: The information contained in this mess...{{dropped}}