Running examples in 'PSTR-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: LinTest
> ### Title: Conduct the linearity tests.
> ### Aliases: LinTest WCB_LinTest
> ### Keywords: specification
> 
> ### ** Examples
> 
> pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
+     tvars=c('vala'), iT=14) # create a new PSTR object
> 
> pstr = LinTest(pstr)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
PSTR
 --- call from context --- 
LMTEST(iT = iT, iN = iN, vU = vU, mX = mX, mW = mW, mM = mM, 
    s2 = s2, mX2 = mX2, invXX = invXX)
 --- call from argument --- 
if (class(invS1) == "try-error") {
    ttmp = svd(S1)
    invS1 = ttmp$u %*% diag(1/ttmp$d, length(ttmp$d)) %*% t(ttmp$u)
}
 --- R stacktrace ---
where 1: LMTEST(iT = iT, iN = iN, vU = vU, mX = mX, mW = mW, mM = mM, 
    s2 = s2, mX2 = mX2, invXX = invXX)
where 2: LinTest(pstr)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (iT, iN, vU, mX, mW, mM, s2, mX2, invXX) 
{
    df1 = ncol(mW)
    df2 = iT * iN - df1 - iN - ncol(mX)
    mW2 = mM %*% mW
    mXW2 = crossprod(mX2, mW2)
    S1 = (crossprod(mW2) - t(mXW2) %*% invXX %*% mXW2) * s2
    invS1 = try(chol2inv(chol(S1)), silent = T)
    if (class(invS1) == "try-error") {
        ttmp = svd(S1)
        invS1 = ttmp$u %*% diag(1/ttmp$d, length(ttmp$d)) %*% 
            t(ttmp$u)
    }
    vW2U = crossprod(mW2, vU)
    LM1_X = c(t(vW2U) %*% invS1 %*% vW2U)
    PV1_X = 1 - pchisq(LM1_X, df = df1)
    LM1_F = LM1_X * df2/(iT * iN * df1)
    PV1_F = 1 - pf(LM1_F, df1 = df1, df2 = df2)
    mZ = cbind(mX2, mW2)
    Delta = 0
    for (nter in 0:(iN - 1) * iT) {
        itmp = (nter + 1):(nter + iT)
        tmp = t(mZ[itmp, ]) %*% vU[itmp] %*% t(vU[itmp]) %*% 
            mZ[itmp, ]
        Delta = Delta + tmp
    }
    tmp = cbind(-crossprod(mXW2, invXX), diag(1, df1))
    S2 = tmp %*% Delta %*% t(tmp)
    invS2 = try(chol2inv(chol(S2)), silent = T)
    if (class(invS2) == "try-error") {
        ttmp = svd(S2)
        invS2 = ttmp$u %*% diag(1/ttmp$d, length(ttmp$d)) %*% 
            t(ttmp$u)
    }
    LM2_X = c(t(vW2U) %*% invS2 %*% vW2U)
    PV2_X = 1 - pchisq(LM2_X, df = df1)
    LM2_F = LM2_X * df2/(iT * iN * df1)
    PV2_F = 1 - pf(LM2_F, df1 = df1, df2 = df2)
    return(list(LM1_X = LM1_X, PV1_X = PV1_X, LM1_F = LM1_F, 
        PV1_F = PV1_F, LM2_X = LM2_X, PV2_X = PV2_X, LM2_F = LM2_F, 
        PV2_F = PV2_F))
}
<bytecode: 0x56f9fd8>
<environment: namespace:PSTR>
 --- function search by body ---
Function LMTEST in namespace PSTR has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(invS1) == "try-error") { : 
  the condition has length > 1
Calls: LinTest -> LMTEST
Execution halted