R/mo4.R

mo4 <-
structure(function (data) 
{
    nrows = dim(data)[1]
    xbar = colMeans(data)
    sigma = cov(data)
    mo4 = mean(mahalanobis(data, center = xbar, cov = sigma)^2)
    return(mo4)
}, source = c("function(data) ", "{", "#*****************************************", 
"# This function computes the third momnent.", "# It is required by the mardia function", 
"# Edgar Acuna (2005)", "#********************************************", 
"nrows=dim(data)[1]", "xbar=colMeans(data)", "sigma=cov(data)", 
"mo4=mean(mahalanobis(data,center=xbar,cov=sigma)^2)", "return(mo4)", 
"}"))

Try the dprep package in your browser

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

dprep documentation built on May 29, 2017, 11:01 a.m.