Skip to content

tommykwok722/Residual-Analysis-on-Regression-Models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Residual Analysis on Regression Models

A MATLAB program related to Regression Models.

Background

Regression analysis is a statistical method for examining the relationships between a dependent variable and independent variables.

Objectives

Since it is not possible to find out the exact model which explains the relationships between a dependent variable and independent variables, I would like to simulate several regression models and find out the better model based on residual analysis and influence diagnostics.

Definitions

Definition of residual: Residual is the vertical distance between the value on the true regression model (unknown) and the fitted value on the regression line.

image

To study the residuals, we have to check whether the residuals match the following assumptions:

  1. Constant (Zero) mean
  2. Constant variance

Definition of influence diagnostics: Influence diagnostics are the measures to determine if an observation is an influential point, leverage point or outlier.

  1. Leverage
  2. Cook’s Distance
  3. Difference in Fitted Values (DFFITS)
  4. Studentized Residuals

Idea and Setup

fishdata.txt contains the data of fish based on its length, height, width, species and weight.

  1. Length: Length of a fish (cm)
  2. Height: Height of a fish (cm)
  3. Width: Width of a fish (cm)
  4. Species: Species of a fish (from 1 to 6)
  5. Weight: Weight of a fish (gram)

According to my program, I extract a total of 201 observations (665th-865th) from the data fishdata.txt, then simulate 3 different regression models and perform residual analysis. The regression models are based on the following dependent and independent variables:

  • Dependent (Response) variable: Weight
  • Independent (Explanatory) variables: Length, Height, Width, Species

Releases

No releases published

Packages

No packages published