regresi least square

14
REGRESI ISI: MODEL RGRESI dengan LEAST SQUARE

Upload: ekoefendi

Post on 14-Apr-2016

277 views

Category:

Documents


4 download

DESCRIPTION

statistika

TRANSCRIPT

REGRESI

• ISI:

MODEL RGRESIdengan

LEAST SQUARE

Least-Squares Regression• Linear relationships

between two variables are defined using a regression line• A mathematical expression

(equation)• Simplest type of

relationship – straight line

Least-Squares Regression

• How many straight lines can you fit through a data set like this?

Least-Squares Regression

• How many straight lines can you fit through a data set like this?

Least-Squares Regression

• How many straight lines can you fit through a data set like this?

Least-Squares Regression• How do we find the best straight

line that relates two variables?• Take a ruler and try to fit it?• How many answers would that

give?

• The most common practice is to find the Least-Squares Line – How?• Find a line that passes through

points such that there is a minimum distance between each value of the response variable and the line.

• These distances are squared and added up for all points in the sample

• For the least-squares line, that sum is smaller than it would be for any other line

Least-Squares RegressionEquation of any straight line

• Response variables on vertical axis – Y• Explanatory variable on horizontal axis

–X• The equation that relates these two

Y=a + bXWhere a and b are numbers

• a: intercept – point where line crosses the y axis, when X=0

• b: slope – how much an increase there is in variable Y when variable X increases by 1 unit• Positive slope• Negative slope

Least-Squares Regression

• Regression line:• Y = a + bX

Where b is the slope calculated by

And the intercept “a”

Where and represent the coordinates of a point on the line

x

y

SSrb

xbya

yx

Least-Squares Regression• It is possible to find a

regression line if we know the slope and one point through which the line passes.

• Example: What is the equation of the least-squares line that has the following characteristics?

4and3,5.0,5,20 yxrSS xy

Least-Squares Regression

• When developing a regression equation, it matters which is the explanatory and which is the response variable.

• When calculating the equation we consider distances from the response variable to the line.

• Reversing the roles will in turn produce different equations.

Correlation coefficient – r• r describes the strength of the

relationshipIn regression• r2 = fraction of variation in

values of Y that is explained by X

Example:• The correlation between IQ

and GPA was found to be • a: r=0.50 • b: r=0.99

• What percent of the observed variation in the students’ GPAs can be explained by IQ alone?

What are the limits of r2?r2 indicates the strength of a relationship just like r

What is r2 when r = 1What is r2 when r = -1What is r2 when r = 0

1r1