60 likes | 166 Vues
This guide explores linear regression techniques to predict total charges based on the length of stay (LOS) in a healthcare context. We will analyze the effectiveness of two models: a straightforward regression of total charges against LOS and a logarithmic transformation model. Critical assumptions such as normally distributed residuals with constant variance will be examined, along with the creation of residual and fitted value plots. Furthermore, the implication of adjusting for variables like age, complications, mortality, and gender in a multiple regression context is discussed, including the pros and cons of transformations.
E N D
Day 7 Linear Regression
Linear Regression • Can we predict total charges from length of stay? • regress totchg los • regress rtotchg loglos • Which model? • Assumption: Residuals are normally distributed with constant variance
Saving Residuals and Fitted Values • Plotting fitted line • predict fity • graph fity rtotchg loglos, s(io) c(l.) ylab xlab • Making a residual plot • predict resid, res • graph resid loglos, xlab ylab yline(0)
Multiple Linear Regression • Should we adjust for • age? • complications? • mortality? • gender? • regress rtotchg loglos age mortality sept reint • R-squared
Pros and Cons of Transform Violation of linearity assumption versus Ease of interpretation