R/varinf.R

Defines functions varinf

Documented in varinf

varinf <- 
  function(object, newdata = NULL){
    
    fit.terms <- scale(predict(object, newdata = newdata, type = "terms"), scale = FALSE)
    Cmat <- crossprod(fit.terms) / tcrossprod(sqrt(colSums(fit.terms^2)))
    vif <- diag(psolve(Cmat))
    names(vif) <- object$terms
    vif
    
  } # end varinf

Try the npreg package in your browser

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

npreg documentation built on July 21, 2022, 1:06 a.m.