# simple linear regression. 2 simple regression linear regression

Post on 18-Jan-2016

324 views

Category:

## Documents

Tags:

• #### food expenditures

Embed Size (px)

TRANSCRIPT

Slide 1

SIMPLE LINEAR REGRESSION 2SIMPLE LINEAR REGRESSION Simple RegressionLinear Regression3Simple RegressionDefinitionA regression model is a mathematical equation that describes the relationship between two or more variables. A simple regression model includes only two variables: one independent and one dependent. The dependent variable is the one being explained, and the independent variable is the one used to explain the variation in the dependent variable. 4Linear RegressionDefinitionA (simple) regression model that gives a straight-line relationship between two variables is called a linear regression model. 5Figure 1 Relationship between food expenditure and income. (a) Linear relationship. (b) Nonlinear relationship.

Food Expenditure Food Expenditure Income Income (a)(b)Linear Nonlinear 6Figure 2 Plotting a linear equation.

150 10050 5 10 15x y = 50 + 5xx = 0y = 50 x = 10 y = 100y7SIMPLE LINEAR REGRESSION ANALYSISScatter DiagramLeast Square LineInterpretation of a and bAssumptions of the Regression Model8SIMPLE LINEAR REGRESSION ANALYSIS cont.y = A + BxConstant term or y-interceptSlope Independent variableDependent variable9SIMPLE LINEAR REGRESSION ANALYSIS cont.DefinitionIn the regression model y = A + Bx + , A is called the y-intercept or constant term, B is the slope, and is the random error term. The dependent and independent variables are y and x, respectively. 10SIMPLE LINEAR REGRESSION ANALYSIS DefinitionIn the model = a + bx, a and b, which are calculated using sample data, are called the estimates of A and B.11Table 1 Incomes (in hundreds of dollars) and Food Expenditures of Seven HouseholdsIncomeFood Expenditure 35 49 21 39 15 28 25 915 711 5 8 912Scatter Diagram Definition A plot of paired observations is called a scatter diagram.13Figure 4 Scatter diagram.

Income Food expenditure First householdSeventh householdIncomeFood Expenditure 35 49 21 39 15 28 25 915 711 5 8 914Figure 5 Scatter diagram and straight lines.

Income Food expenditure 15Least Squares Line Figure 6 Regression line and random errors.

Income Food expenditure eRegression line16

OUTPUT SPSS17

The Least Squares Linea=1,142b=0,264Thus, = 1.1414 + 0.2642x18

19Figure 7 Error of prediction.

ePredicted = \$1038.84Error = -\$138.84Actual = \$900 = 1.1414 + .2642x Income Food expenditure 20Figure . Errors of prediction when regression model is used.

Food expenditure Income = 1.1414 + .2642x21Interpretation of a and bInterpretation of a Consider the household with zero income = 1.1414 + .2642(0) = \$1.1414 hundredThus, we can state that households with no income is expected to spend \$114.14 per month on food22Interpretation of a and b cont.Interpretation of bThe value of b in the regression model gives the change in y due to change of one unit in xWe can state that, on average, a \$1 increase in income of a household will increase the food expenditure by \$0.264223Figure 8 Positive and negative linear relationships between x and y.

(a) Positive linear relationship. (b) Negative linear relationship. b > 0 b < 0y xy x24Table 4xy = 1.1414 + .2642xe = y 35492139152825 915 711 5 8 910.388414.0872 6.689611.4452 5.1044 8.5390 7.7464-1.3884 .9128 .3104 -.4452 -.1044 -.5390 1.25361.9277 .8332 .0963 .1982 .0109 .29051.5715

25Linearitas Test(Uji Validitas Model)ModelSum of Squares Degrees of Freedom (db)Mean Square Value of the test statistic (F Value )Regression SSreg 1MSregResidualSSres n-2MSresTotalSSTN-1Table. Validity for Simple Regression Model

26

OUTPUT SPSS27Figure Nonlinear relations between x and y.

(a) (b)y xy x28

F table ,dbreg=1 and dbres=n-229SIGNIFICANCE KOEFISIEN REGRESI

30

31

Output SPSS32

Do not reject H0Reject H0Reject H0 ttable = 2.571Significan level = 0.05 -ttable = -2.57133REGRESSION ANALYSIS: COMPLETE EXERCISESExercise 1:The following data give the experience (in years ) and monthly salary (in hundreds of dollars) of nine randomly selected secretaries.34Exercise 1Experience (years)Monthly salary(Hundreds of dollars) 143564918516422433312939473043 35Construct a scatter diagram for these data.Find the regression line with experience as an independent variable and monthly salary as a dependent variable.Give a brief interpretation of the values of a and b calculated in part b.Plot the regression line on the scatter diagram of part a and show the errors by drawing vertical lines between the scatter points and the regression line. Does the regression model show a linear relationship between experience and monthly salary? Use 5 % significant level.Construct a 5 % significant level for b.

36Exercise 2A random sample of eight drivers insured with a company and having similar auto insurance policies was selected. The following table lists their driving experience (in years) and monthly auto insurance premiums.37Example 2Driving Experience (years)Monthly Auto InsurancePremium 5 212 915 62516\$64 87 50 71 44 56 42 6038Scatter diagram and the regression line.