1 / 15

Indicator variable for two categories

Indicator variable for two categories. Two categories, A and B (not A) Define an indicator variable A i = 1 for members of category A A i = 0 otherwise. Regression model with different intercepts for two categories. Consider the regression model

emoran
Download Presentation

Indicator variable for two categories

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Indicator variable for two categories • Two categories, A and B(not A) • Define an indicator variable • Ai = 1 for members of category A • Ai = 0 otherwise

  2. Regression model with different intercepts for two categories • Consider the regression model yi = b0+ b1 xi+ d0 Ai+ ei • For Ai = 0 yi = b0+ b1 xi+ ei • ForAi = 1 yi =(b0+ d0 ) + b1 xi+ ei • Difference between the two intercepts, d0 • Test if the two intercepts are the same • H0: d0 = 0

  3. Regression model with different intercepts and Slopes yi = b0+ b1 xi+ d0 Ai+ d1 Ai xi+ ei • For Ai = 0 yi = b0+ b1 xi+ ei • ForAi = 1 yi =(b0+ d0 ) + (b1 + d1 ) xi+ ei • Difference between the two intercepts, d0 • Difference between the two slopes, d1 • Test if the two regression lines are the same • H0: d0 = d1 = 0 (Partial F)

  4. Indicator variables for three categories • Three categories, A, B, and C • Define two indicator variables • Ai = 1 for members of category A • Ai = 0 otherwise • Bi = 1 for members of category B • Bi = 0 otherwise • Members of category C are coded as • Ai = 0 (not A) and Bi = 0 (not B) • C is the base category

  5. Indicator variables for all categories • Three categories, A, B, and C • Ai = 1 for members of category A • Ai = 0 otherwise • Bi = 1 for members of category B • Bi = 0 otherwise • Ci = 1 for members of category C • Ci = 0 otherwise • Note that A + B = C = 1, hence a linear dependency if there is an intercept

  6. Different intercepts for three categories yi = b0+b1 xi+d10 Ai+ d20 Bi+ ei • For Ai = 0 (not A) and Ai = 0 (not B) yi = b0+b1 xi+ ei • ForAi = 1 (A) and Bi = 0 (not B) yi =(b0+ d10 ) +b1 xi+ ei • Difference between the intercepts for A and C, d10

  7. Different intercepts for three categories yi = b0+ b1 xi+ d01 Ai+ d02 Bi+ ei • For Ai = 0 (not A)andBi = 1 (B) yi =(b0+ d20 ) +b1 xi+ ei • Difference between the intercepts for B and C, d02 • Test if the three intercepts are the same • H0: d01 = d02= 0 • Partial F

  8. Different intercepts and slopes for three categories yi = b0+ b1 xi + d01 Ai +d02 Bi + d11 Ai xi+ d12 Bi xi+ ei • For Ai = 0 (not A) and Bi = 0 (not B) yi = b0+ b1 xi+ ei

  9. Categories A and C yi = b0+ b1 xi + d01 Ai +d02 Bi + d11 Ai xi+ d12 Bi xi+ ei • ForAi = 1 (A) and Bi = 0 (not B) yi =(b0+ d10 ) + (b1 + d11 ) xi+ ei • Difference between the intercepts for A and C, d10 • Difference between the slopes A and C, d11

  10. Group B and C yi = b0+ b1 xi + d01 Ai +d02 Bi + d11 Ai xi+ d12 Bi xi+ ei • ForAi = 0 (not A) and Bi = 1 (B) yi =(b0+d02) + (b1 +d12 ) xi+ ei • Difference between the intercepts for A and C, d0 2 • d12, Difference between the slopes for A and C

  11. Test for the same linear relationship yi = b0+ b1 xi + d01 Ai +d02 Bi + d11 Ai xi+ d12 Bi xi+ ei • For Ai = 0 (not A) and Bi = 0 (not B) yi = b0+ b1 xi+ ei • Test if the three regression lines are the same • H0: d01 = d02=d11 = d12 = 0 • Partial F

  12. Seasonality in time series • Indicator variables for the four seasons • W = 1 if winter, = 0, otherwise • SP = 1 if spring, = 0, otherwise • SU = 1 if summer, = 0, otherwise • Fall is given by W = 0, SP = 0, SU = 0 • Indicator variables for months (11 variables) • Jan = 1 if January, = 0, otherwise • etc.

  13. An alternative coding scheme • Two categories, A and B(not A) • Define a variable • Ai = 1 for members of category A • Ai = -1 otherwise

  14. Regression model with different intercepts and Slopes yi = b0+ b1 xi+ q0 Ai+ q1 Ai xi+ ei • ForAi = 1 yi =(b0+q0 ) + (b1 +q1 ) xi+ ei • For Ai = -1 yi = (b0-q0 ) + (b1 -q1 )xi+ ei • “average” intercept b0 • “average” slope, b1 • Intercept deviation for each category, q0 • Slope deviation for each category, q1

  15. Regression model with different intercepts and Slopes • Hypothesis of equality of slopes for two categories, H0: q1 = 0 • Hypothesis of equality of intercepts for two categories, H0: q0 = 0 • Hypothesis of the same regression line for two categories • H0: q0 = q1 = 0 (Partial F)

More Related