Table of Contents

A nice example of the R code plus results with the a GUSTO-I sample is presented here.

The R code to calculate shrunk regression coefficients for the GUSTO example is as follows:

# fit a model with 8 predictors full8 <- lrm(DAY30~SHO+A65+HIG+DIA+HYP+HRT+TTR+SEX, data=gustos,x=T,y=T,linear.predictors=T) # validate with 200 bootstraps val.full8 <- validate(full8, B=200) # copy original model fit to shrunk model full8.shrunk <- full8 # use result from bootstrapping to shrink coefficients full8.shrunk$coef <- val.full8[4,5] * full8.shrunk$coef # Estimate new intercept, with shrunk lp as offset variable, i.e. coef fixed at unity full8.shrunk$coef[1] <- lrm.fit(y=full8$y, offset= full8$x %*% full8.shrunk$coef[2:9])$coef[1]