This preview shows page 1. Sign up to view the full content.
Unformatted text preview: , "Cultur" , "Xray" , "Beds" , "Census" , "Nurse" , "Facility" ), method = "Cp" ) #Three best models are chosen by 3 lowest Cp criterions #To automatically print models in the increasing order of Cp criterion: ModelSel = leaps ( x = DataX , y = DataY , names = c ( "Age" , "Risk" , "Cultur" , "Xray" , "Beds" , "Census" , "Nurse" , "Facility" ), method = "Cp" ) ModelSel $ which [ order ( ModelSel $ Cp ), ] #To print Cp criterion in increasing order sort ( ModelSel $ Cp ) #To plot Cp against p, and add reference line: Cp=p plot ( ModelSel $ size , ModelSel $ Cp , pch = 19 ) abline ( , 1 ) #Fit the best chosen model Fit = lm ( Stay ~ Age + Xray + Census , data = Data ) Fit #Residual plot plot ( Fit $ fitted.values , Fit $ residuals , main = "Residuals vs. Fitted Values" , xlab = "Fitted Values" , ylab = "Residuals" , pch = 19 ) abline ( h = )...
View
Full
Document
This note was uploaded on 09/01/2011 for the course ISYE 6414 taught by Professor Staff during the Fall '08 term at Georgia Institute of Technology.
 Fall '08
 Staff

Click to edit the document details