60 likes | 158 Views
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
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