Assumptions of regression models

Here, we show the R code for Fig 12.1

  # Main effects for 8 predictors
  full <- lrm(DAY30~AGE+KILLIP+HIG+DIA+HYP+HRT+TTR+SEX,data=gustos)
  # Interactions with age
  fullint <- lrm(DAY30~AGE* (KILLIP+HIG+DIA+HYP+HRT+TTR+SEX),data=gustos)
  # Examine contribution to fit of interactions
  anova(fullint)
  # Select only interaction AGE * HRT
  fullints <- lrm(DAY30~AGE*HRT+KILLIP+HIG+DIA+HYP+TTR+SEX,data=gustos)
  fullints
            			Coef     S.E. Wald Z P     
  AGE        			0.07587 0.024  3.16  0.0016
  HRT=Tachycardia       	-3.6376 2.835 -1.28  0.1995
  AGE * HRT=Tachycardia 	0.06553 0.040  1.64  0.1004
  ...
  
  # plot interaction effect: 
  plot(fullint, AGE=NA, HRT=c("No tachycardia", "Tachycardia"))

Fig 12.1

rcode_and_data/chapter12.txt · Last modified: 2008/10/02 17:08 by ewsteyerberg
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0