R/adjCov.r

Defines functions adjCov

Documented in adjCov

adjCov <- function(x, id){

scores <- aCov(x)


if( dim(scores)[1] != length(id) ) stop("Your id does not have the same length as that of your data set.")


scores <- aggregate.data.frame(scores,by=list(id),FUN=sum)[,-1]
nclusters <- dim(scores)[1]
meat   <- (nclusters-1)*var(scores)
covsan <- x$Vb %*% meat %*% x$Vb

x$Vb <- covsan

rm(scores, nclusters, meat, covsan)

x

}
KironmoyDas/KD-STAT0035-GMupdate documentation built on Feb. 15, 2021, 12:17 a.m.