R/GR2.R

Defines functions GR2

Documented in GR2

GR2 <-
function(object)
{
  if(class(object)[[1]] != "glmssn") return("Not a glmssn object")
  W <- object$sampinfo$X
  Vi <- object$estimates$Vi
  z <- object$sampinfo$z
  betahat <- object$estimates$betahat
  muhat <- sum(Vi %*% z)/sum(Vi)
  ones <- matrix(1, ncol = 1, nrow = length(z))
  1 - t(z - W %*% betahat) %*% Vi %*% (z - W %*% betahat)/
    t(z - ones %*% muhat) %*% Vi %*% (z - ones %*% muhat)
}

Try the SSN package in your browser

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

SSN documentation built on March 7, 2023, 5:30 p.m.