Presentation is loading. Please wait.

Presentation is loading. Please wait.

Regression and Categorical Predictors

Similar presentations


Presentation on theme: "Regression and Categorical Predictors"— Presentation transcript:

1

2 Regression and Categorical Predictors
Chapter 13 Multiple Regression Section 13.5 Regression and Categorical Predictors

3 Indicator Variables Regression models can specify categories of a categorical explanatory variable using artificial variables, called indicator variables. The indicator variable for a particular category is binary. It equals 1 if the observation falls into that category and it equals 0 otherwise.

4 Indicator Variables In the house selling prices data set, the condition of the house is a categorical variable. It was measured with categories (good, not good). The indicator variable x for condition is if house is in good condition if house is not in good condition

5 Indicator Variables The regression model is then , with x as just defined. Substituting the possible values 1 and 0 for x , The difference between the mean selling price for houses in good condition and not in good condition is The coefficient of the indicator variable x is the difference between the mean selling prices for homes in good condition and for homes not in good condition.

6 Example: Including Condition in Regression for House Selling Price
Output from the regression model for selling price of home using house size and region. Table Regression Analysis of y = Selling Price Using =House Size and = Indicator Variable for Condition (Good, Not Good)

7 Example: Including Condition in Regression for House Selling Price
Find and plot the lines showing how predicted selling price varies as a function of house size, for homes in good condition or not in good condition. Interpret the coefficient of the indicator variable for condition.

8 Example: Including Condition in Regression for House Selling Price
The regression equation from the MINITAB output is:

9 Example: Including Condition in Regression for House Selling Price
For homes not in good condition, The prediction equation then simplifies to:

10 Example: Including Condition in Regression for House Selling Price
For homes in good condition, The prediction equation then simplifies to:

11 Example: Including Condition in Regression for House Selling Price
Figure 13.7 Plot of Equation Relating =Predicted Selling Price to =House Size, According to =Condition (1=Good, 0=Not Good). Question: Why are the lines parallel?

12 Example: Including Condition in Regression for House Selling Price
Both lines have the same slope, 66.5 The line for homes in good condition is above the other line (not good) because its y-intercept is larger. This means that for any fixed value of house size, the predicted selling price is higher for homes in better condition. The P-value of for the test for the coefficient of the indicator variable suggests that this difference is not statistically significant.

13 Is there Interaction? For two explanatory variables, interaction exists between them in their effects on the response variable when the slope of the relationship between and one of them changes as the value of the other changes.

14 Example: Interaction in effects on House Selling Price
Suppose the actual population relationship between house size and the mean selling price is: Then the slope for the effect of differs for the two conditions. There is then interaction between house size and condition in their effects on selling price. See Figure 13.8 on the next slide.

15 Example: Interaction in effects on House Selling Price
Figure 13.8 An Example of Interaction. There’s a larger slope between selling price and house size for homes in good condition than in other conditions.

16 Example: Interaction in effects on House Selling Price
How can you allow for interaction when you do a regression analysis? To allow for interaction with two explanatory variables, one quantitative and one categorical, you can fit a separate regression line with a different slope between the two quantitative variables for each category of the categorical variable.


Download ppt "Regression and Categorical Predictors"

Similar presentations


Ads by Google