R/wtdSS.R

Defines functions wtdSS

Documented in wtdSS

wtdSS <- function(x) {
    mn   <- wtdMean(x)
    n    <- length(x)
    sqdiff <- vector("list",n)
    for(i in 1:n) {
        sqdiff[[i]] <- (x[[i]] - mn)^2*attr(x[[i]],"weight")
    }
    rslt <- Reduce("+",sqdiff)
    attr(rslt,"n") <- n
    rslt
}

Try the kanova package in your browser

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

kanova documentation built on Aug. 8, 2025, 7:50 p.m.