Untitled
ASSESSING LINEARITY AND HOMOSCEDASTICITY
- Concept Overview
- Linearity and homoscedasticity are key assumptions in regression diagnostics, fundamental for assessing the validity of the linear regression model.
RESIDUAL PLOT
- Residual Plot: A graphical representation of the residuals against predicted values.
- Types of Residuals: Pure, Standardized, Studentized, Jackknife.
- Jackknife Residuals: Most effective in diminishing the influence of extreme observations.
- Creating a Residual Plot in R:
- Save predictions using:
mlb$pred = predict(model). - Plot residuals against predictions:
plot(mlb$pred, mlb$jackknife, pch = 19, xlab = "Predicted Wins", ylab = "Jackknife Residual"). - Add horizontal line at zero:
abline(h=0).
ASSESSING LINEARITY
- Criteria:
- Satisfied: No pattern in the residual plot; observations randomly scattered around zero.
- Violated: Emergence of a clear nonlinear pattern in the residual plot.
- Types of Relationships:
- Satisfied: Randomly scattered residuals indicate a linear relationship.
- Violated: Shows potential quadratic or cubic relationships or an undefined relationship between response and predictor.
ASSESSING HOMOSCEDASTICITY
- Criteria:
- Satisfied: No distinct pattern in residual spread; random scattering around zero.
- Violated: Increasing spread of residuals as predicted values grow, leading to a funnel shape.
- Examples:
- Satisfied: Residuals remain stable across predicted values.
- Violated: Residuals spread increases with larger predicted values.
EXAMPLE: ASSESSING LINEARITY AND HOMOSCEDASTICITY
- Scenario: Analyzing runs scored and allowed to predict wins. Given residual plot of jackknife residuals vs. predicted values.
- Question: Are linearity and homoscedasticity satisfied?
- Answer: Linearities assessed aside from a few extreme observations.
- Findings:
- Residuals are evenly scattered.
- Spread of residuals remains consistent across predicted win totals.
NORMAL PROBABILITY PLOTS
NORMAL PROBABILITY PLOT
- Definition: A plot of the residuals arranged in increasing order (Y-axis) versus the percentile they would occupy if normally distributed (X-axis).
- Interpretation of Curves:
- Concave down: Indicates left-skewed residuals.
- Straight Line: Suggests normally distributed residuals.
- Concave up: Indicates right-skewed residuals.
- R Code for Creating Normal Probability Plot:
- Generate plot:
qqnorm(mlb$jackknife, pch = 19). - Add diagonal for perfect normality:
qqline(mlb$jackknife).
- Generate plot:
INTERPRETING NORMALITY PROBABILITY PLOT
- Example:
- 2019 Detroit Tigers:
- Location: Circled point represents a notable residual.
- Sample Quantile: Tigers’ jackknife residual deviated significantly from predicted value.
- Theoretical Quantile: Expected residual if perfectly normal would be around a specific calculated z-score.
- Results from R: R calculates the percentile and Z-score of the residual. Similar process applied to 2021 Seattle Mariners, highlighting skewness and its implications on regression assumptions.
ASSESSING NORMALITY
METHODS TO ASSESS NORMALITY
- Visual Method: Normal probability plot insights.
- Straight line signifies normal distribution.
- Deviations may indicate skewness (left or right).
- Statistical Test: Shapiro-Wilk Test for normality.
- Hypotheses:
- Null Hypothesis (H0): Data is normally distributed.
- Alternative Hypothesis (H_A): Data is not normally distributed.
- Test Invocation in R: Execute through
shapiro.test(mlb$jackknife). - Failing to Reject H0: Supports normality condition.
- Example of Assessing Normality:
- Scenario: Analyzing normality with histogram and normal probability plot for jackknife residuals.
- Conclusion drawn from visual inspection and statistical testing.
INFLUENTIAL POINTS
DEFINITION AND SIGNIFICANCE
- Influential Point: An observation strongly affecting the regression model’s predictions due to its presence or absence.
- High leverage and outlying residuals signify potential influence on the model.
- Measures of Influence:
- Cook's Distance: Reflects model prediction changes when an observation is removed.
- Formula:
- Influential if Cook's distance exceeds the threshold of .
- DFBETAS: Measures the change in regression coefficients upon exclusion of an observation.
- Definition:
- Influential when condition holds for coefficients.
COOK’S DISTANCE
COOK’S DISTANCE CALCULATION
- Concept: Identifies observations whose exclusion results in substantial changes to regression model predictions.
- Notably influential if both outlier and high leverage.
- General rule: observations with Cook’s distance greater than are flagged as influential.
EXAMPLE: COOK’S DISTANCE
- Question: Are 2019 Detroit Tigers or 2021 Seattle Mariners influential based on Cook's distance?
- Calculate Cook’s distances for both and compare against established cutoff.
- Outcomes: Identification of influential observation with respect to model behavior using Cook's metric.
DFBETAS
DFBETAS AS A MEASURE OF INFLUENCE
- Provides a standardized perspective of how much each regression coefficient shifts with the exclusion of an observation.
- Criteria for Influence:
- If DFBETAS(-i)_j > 2 \cdot \frac{n}{n}, it is influential.
- Conversely, indicates no significant influence.
EXAMPLE: CALCULATING DFBETAS
- Scenario: Remove a specific observation and compute DFBETAS to evaluate impacts on coefficients.
- Provide calculated values and discuss their implications based on the model adjustments made.
DEALING WITH INFLUENTIAL POINTS
STRATEGIES TO ADDRESS INFLUENTIAL OBSERVATIONS
- Examine the validity and origin of influential points.
- Assess linearity, homoscedasticity, and normality of residuals.
- If any of these are violated, consider that the model may lack appropriateness for the data.
- Explore possible transformations or inclusion of additional predictors.
- Model re-evaluation: Retain or remove influential points based on their performance post-adjustment.
EXAMPLE: REPORTING FINAL RESULTS
- Summarize the scenario involving model adjustments from removing influential observations, and report on the rationale behind the modifications made to enhance model fidelity.
RECONCILING MEASURES OF INFLUENCE
CROSS-EVALUATION OF COOK’S DISTANCE AND DFBETAS
- Observations may show a disconnect between Cook’s distances and DFBETAS.
- Important to ensure both measures align in indicating influence.
- A noticeable change in one coefficient may be countered by changes in others, maintaining overall model predictions.