14
Lecture 27 • Chapter 20.3: Nominal Variables • HW6 due by 5 p.m. Wednesday • Office hour today after class. Extra office hour Wednesday from 9- 10. • Final Exam: May 1 st , 4-6 p.m., SHDH 351 • Practice Exam will be posted tomorrow.

Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Embed Size (px)

Citation preview

Page 1: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Lecture 27

• Chapter 20.3: Nominal Variables

• HW6 due by 5 p.m. Wednesday

• Office hour today after class. Extra office hour Wednesday from 9-10.

• Final Exam: May 1st, 4-6 p.m., SHDH 351

• Practice Exam will be posted tomorrow.

Page 2: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

20.3 Nominal Independent Variables• In many real-life situations one or more independent

variables are nominal.• Including nominal variables in a regression analysis

model is done via indicator (or dummy) variables.• An indicator variable (I) can assume one out of two

values, “zero” or “one”.

I=

1 if data were collected before 19800 if data were collected after 1980

1 if the temperature was below 50o

0 if the temperature was 50o or more

1 if a degree earned is in Finance0 if a degree earned is not in Finance

Page 3: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Nominal Independent Variables; Example: Auction Car Price (II)

• Example 18.2 - revised (Xm18-02a)– Recall: A car dealer wants to predict the auction

price of a car.– The dealer believes now that odometer reading

and the car color are variables that affect a car’s price.

– Three color categories are considered:• White• Silver• Other colors

Note: Color is a nominal variable.

Page 4: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

• Example 18.2 - revised (Xm18-02b)

I1 =1 if the color is white0 if the color is not white

I2 =1 if the color is silver0 if the color is not silver

The category “Other colors” is defined by:I1 = 0; I2 = 0

Nominal Independent Variables; Example: Auction Car Price (II)

Page 5: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

• Note: To represent the situation of three possible colors we need only two indicator variables.

• Conclusion: To represent a nominal variable with m possible categories, we must create m-1 indicator variables.

How Many Indicator Variables?

Page 6: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

• Solution– the proposed model is

y = 0 + 1(Odometer) + 2I1 + 3I2 + – The data

Price Odometer I-1 I-214636 37388 1 014122 44758 1 014016 45833 0 015590 30862 0 015568 31705 0 114718 34010 0 1

. . . .

. . . .

White car

Other color

Silver color

Nominal Independent Variables; Example: Auction Car Price

Page 7: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Odometer

Price

Price = 16701 - .0555(Odometer) + 90.48(0) + 295.48(1)

Price = 16701 - .0555(Odometer) + 90.48(1) + 295.48(0)

Price = 16701 - .0555(Odometer) + 90.48(0) + 295.48(0)

16701 - .0555(Odometer)

16791.48 - .0555(Odometer)

16996.48 - .0555(Odometer)

The equation for an“other color” car.

The equation for awhite color car.

The equation for asilver color car.

From JMP (Xm18-02b) we get the regression equationPRICE = 16701-.0555(Odometer)+90.48(I-1)+295.48(I-2)

Example: Auction Car Price The Regression Equation

Page 8: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

From JMP we get the regression equationPRICE = 16701-.0555(Odometer)+90.48(I-1)+295.48(I-2)

A white car sells, on the average, for $90.48 more than a car of the “Other color” category

A silver color car sells, on the average, for $295.48 more than a car of the “Other color” category.

For one additional mile the auction price decreases by 5.55 cents.

Example: Auction Car Price The Regression Equation

Page 9: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Comprehension Question

From JMP we get the regression equationPRICE = 16701-.0555(Odometer)+90.48(I-1)+295.48(I-2)

• Consider two cars, one white and one silver, with the same number of miles. How much more on average does the silver car sell for than the white car?

Page 10: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

SUMMARY OUTPUT

Regression StatisticsMultiple R 0.8355R Square 0.6980Adjusted R Square 0.6886Standard Error 284.5Observations 100

ANOVAdf SS MS F Significance F

Regression 3 17966997 5988999 73.97 0.0000Residual 96 7772564 80964Total 99 25739561

Coefficients Standard Error t Stat P-valueIntercept 16701 184.3330576 90.60 0.0000Odometer -0.0555 0.0047 -11.72 0.0000I-1 90.48 68.17 1.33 0.1876I-2 295.48 76.37 3.87 0.0002

There is insufficient evidenceto infer that a white color car anda car of “other color” sell for adifferent auction price.

There is sufficient evidenceto infer that a silver color carsells for a larger price than acar of the “other color” category.

Xm18-02b

Example: Auction Car Price The Regression Equation

Page 11: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

• Recall: The Dean wanted to evaluate applications for the MBA program by predicting future performance of the applicants.

• The following three predictors were suggested:– Undergraduate GPA– GMAT score– Years of work experience

• It is now believed that the type of undergraduate degree should be included in the model.

Nominal Independent Variables; Example: MBA Program Admission (

MBA II)

Note: The undergraduate degree is nominal data.

Page 12: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Nominal Independent Variables; Example: MBA Program Admission

(II)

I1 =1 if B.A.0 otherwise

I2 =1 if B.B.A0 otherwise

The category “Other group” is defined by:I1 = 0; I2 = 0; I3 = 0

I3 =1 if B.Sc. or B.Eng.0 otherwise

Page 13: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

MBA Program Admission (II)

Analysis of Variance Source DF Sum of Squares Mean Square F Ratio

Model 6 54.751842 9.12531 17.1554 Error 82 43.617378 0.53192 Prob > F

C. Total 88 98.369220 <.0001 Parameter Estimates Term Estimate Std Error t Ratio Prob>|t|

Intercept 0.2886998 1.396475 0.21 0.8367 UnderGPA -0.006059 0.113968 -0.05 0.9577 GMAT 0.0127928 0.001356 9.43 <.0001 Work 0.0981817 0.030323 3.24 0.0017 Degree[1] -0.443872 0.146288 -3.03 0.0032 Degree[2] 0.6068391 0.160425 3.78 0.0003 Degree[3] -0.064081 0.138484 -0.46 0.6448

Page 14: Lecture 27 Chapter 20.3: Nominal Variables HW6 due by 5 p.m. Wednesday Office hour today after class. Extra office hour Wednesday from 9-10. Final Exam:

Practice Problems

• 20.6, 20.8, 20.22,20.24