Rcoefalpha <-
function(x,cov.fun=skipcov,pr=FALSE,...){
# Compute coefficient alpha plus a robust analog)
#
# x is assumed to be a matrix
# output:
# coefficient alpha plus robust version
#
# other possible choices for cov.fun:
# skipcov
# tbscov
# covout
# covogk
# mgvcov
# mvecov
# mcdcov
# wincov
#
x=elimna(x)
x=as.matrix(x)
mcor=winall(x,tr=0)$cov
term=sum(mcor)
diag(mcor)=0
term1=sum(mcor)
k=ncol(x)
lam=k*term1/(k-1)
res1=lam/term
#
mcor=cov.fun(x,...)
term=sum(mcor)
diag(mcor)=0
term1=sum(mcor)
k=ncol(x)
lam=k*term1/(k-1)
lam=lam/term
list(coef.alpha=res1,robust.alpha=lam)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.