R/RESIDT.R

Defines functions RESIDT

RESIDT <-
function(x,b)
{
    x <- as.matrix(x)
    n <- nrow(x)
    p <- length(b)-2
    xmat <- matrix(1,nrow=n-p,ncol=p+2)
    xmat[,p+2] <- (p+1):n
    index <- p:(n-1)
    for(i in 1:p)
    {xmat[,i] <- x[index,1]
    index <- index-1
    }
   
    y <- x[(p+1):n,1]
    e <- y - xmat %*% b
    return(e-mean(e))
}

Try the BootPR package in your browser

Any scripts or data that you put into this service are public.

BootPR documentation built on Aug. 31, 2023, 9:08 a.m.