Nothing
ki <-
function(X, dummy=F, pos=NULL)
{
if (dummy == T){X = as.matrix(X[,-c(pos)])}
X = as.matrix(X)
if (dim(X)[2] == 1){
salida = "At least 2 quantitative independent variables are needed (excluding the intercept)"
} else {
ki = array(,dim(X)[2])
for (i in 1:dim(X)[2]){
ki[i] = crossprod(X[,i])/(crossprod(X[,i])-t(X[,i])%*%X[,-i]%*%solve(crossprod(X[,-i]))%*%t(X[,-i])%*%X[,i])
}
if (dim(X)[2] == 2){
salida = ki
} else {
porc1 = (VIF(X)/ki[-1])*100
porc2 = 100 - porc1
salida = list(ki, porc1, porc2)
names(salida) = c("Stewart index", "Proportion of essential collinearity in i-th independent variable (without intercept)", "Proportion of non-essential collinearity in i-th independent variable (without intercept)")
}
}
return(salida)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.