Creates a list with a component for each factor in the model. The names of the components are the factor names. Each component contains the observation identifiers of all observations that are "overly influential" with respect to that factor, meaning that c("∣dfbetas∣>\n", "u") for at least one betai associated with that factor, for a given cutoff. The default cutoff is .2. The fit must come from a function that has resid(fit, type="dfbetas")
defined.
show.influence, written by Jens Oehlschlaegel-Akiyoshi, applies the result of which.influence to a data frame, usually the one used to fit the model, to report the results.
#print observations in data frame that are influential,#separately for each factor in the modelx1 <-1:20x2 <- abs(x1-10)x3 <- factor(rep(0:2,length.out=20))y <- c(rep(0:1,8),1,1,1,1)f <- lrm(y ~ rcs(x1,3)+ x2 + x3, x=TRUE,y=TRUE)w <- which.influence(f,.55)nam <- names(w)d <- data.frame(x1,x2,x3,y)for(i in1:length(nam)){ print(paste("Influential observations for effect of ",nam[i]),quote=FALSE) print(d[w[[i]],])}show.influence(w, d)# better way to show results