Instruction: Discuss the methods for diagnosing the fit of a statistical model in R, including residual analysis and goodness-of-fit tests.
Context: This question assesses the candidate's understanding of model evaluation techniques, critical for validating the assumptions and accuracy of statistical models.