2
$\begingroup$

How can I calculate Cook's distance for lm.ridge objects?

I first created a glmnet object and carried out ridge regression finding suitable shrinkage parameter. After that, I am calculating the beta values:

object<-cv.glmnet(as.matrix(indp_data),response_data,type.measure = "mse")
fit_lm<-MASS:::lm.ridge(formula,data,lambda = seq(object$lambda.min,0.1,len=10),model=TRUE)
  whichIsBest <- which.min(fit_lm$GCV)
  gcv_est<-data.frame(coef(fit_lm)[whichIsBest,])
  row.names(gcv_est)[1]<-"Intrecept"
  colnames(gcv_est)[1] <- "Estimates"

  Beta_Values<-as.matrix(gcv_est)[-1,]

All variables are of class numeric. I have calculated the residual by subtracting fitted values from the observed. But how can I calculate Cook's distance from here?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.