Fox Module 14: Modeling interactions HW


Fox Module 14: Modeling interactions HW

Author
Message
mbellis2011
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Posts: 6, Visits: 226
So would that mean that since there are 3 regions and 15 distances that there are (3-1) + (15-1) = 16 dummy variables?

[NEAS: Distance is a continuous variable: it has one parameter and it is not a dummy variable. This model has one intercept and two dummy variables; it has one slope parameter and two interactions of slope and dummy variables; total parameters are six.]
Edited 12 Years Ago by NEAS
NEAS
Supreme Being
Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)Supreme Being (5.9K reputation)

Group: Administrators
Posts: 4.3K, Visits: 1.3K
Jacob: Do we have separate dummy variables for each territory?

Rachel: This homework assignment replicates the scenario in the textbook. It deals with three regions: urban, sub-urban, and rural, not 15 separate territories. The territories within each region just differ by average distance driven.

The solution has three intercepts and three slopes, giving six regression parameters. Look at the slopes first. The exercise says that the stochasticity of the observed values is small. The claim frequency increases about 2.5 percentage points for each five units of mileage in the urban region, about 6 percentage points for each 20 units of mileage in the suburban region, and about 1 percentage point for each 10 units of mileage in the rural region. The intercepts (where mileage = 0) also differ by region; they are about 6 percentage points in the urban region, about 1 percentage point in the suburban region, and about 3 percentage points in the rural region.

Casual observation shows the formulas: claim frequency is 6% + 5% × mileage for urban; 3% + 1% × mileage for rural; 1% + 3% × mileage for suburban. The homework assignment has you solve for the precise figure using Excel (or R or SAS or Mathlab). Rural is the base, so the rural intercept and slope applies to urban and suburban as well. But urban and suburban (the two dummy variables) has different intercepts and slopes. Excel shows the differences are additions or subtractions to the intercept and slopes: +3 and –2 for the intercepts and +4 and +2 for the slopes.

For the homework assignment, set up the equations and solve them in Excel. The answers differ from the round numbers above by small amounts, and the p values are all significant at the 0.1% level.


Edited 12 Years Ago by NEAS
mbellis2011
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Posts: 6, Visits: 226
I think I have B) C) and D) correct, but I am not sure about A). I have:

Urban: 10

Suburban: 01

Rural: 00

B) Y = α + M + U + S + MU + MS (Y=claim frequency, M=mileage,U=urban, S=suburban)

C) α = .02932

M = .001006

U = .02968

S = -.02108

MU = .004038

MS = .002012


I am confused about the # of dummy variables because of the interaction terms. Are there (15-1) + (3-1) = 16? Or are there more?


jgorab17
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Posts: 4, Visits: 6

Hi everyone -

 

Can anyone tell me if I'm looking at this the right way:

 

A. Dummy variables = (15-1)+(3-1) = 16 (doesn't change from mod 13)

B.  Again, this answer doesn't change from mod 13

 

urban D1=1,D2=0

sub-urban D1=0, D2=1

rural D1=D2=0

 

I am not sure how to put this into excel for regression.  I think someone already asked this but CalLady - how did you get 5 columns of X values instead of just 3? I don't know what to put for the other 2!!

 

Thanks!!

 

 


dwscott07
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Posts: 3, Visits: 1
The dummy variables are not any different from Module 13, where Yi = g1D1+g2D2

D1=1 D2=0 for urban territories

D1=0 D2=1 for sub-urban territories

D1=0 D2=0 for rural territories

This module adds in mileage Xi which affects claim frequency differently dependant on the type of territory. Driving 10,000 miles in the country side is going to have a smaller claim frequency than driving 10,000 miles in an high-traffic urban area.

Start on pg. 131 of the text book about Modeling Interactions. On pg 132, he explains Interaction Regressors and even lays the ground work for answering C.

You still need Xi but you need an extra term to change the slopes for urban territories and another term to change the slope for the sub-urban territories. The regression equation for rural territories will still appear as Yi = A+B*Xi because both dummy variables are equal to 0.

When you get Excel to give 6 intercepts for part D, make a separate column of Y-hat values that are fitted to the equation you get in part C. It should come out very close to the original claim frequency entries.

[NEAS: This post is well written; see also the Jacob-Rachel dialogue below, which explains the solution in more detail.]
Edited 12 Years Ago by NEAS
Pandia
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Posts: 1, Visits: 1
The method for doing this in excel is hinted in the second footnote at the bottom of page 132 where they say think of a new variable Z=XD.

To set this up, enter in your X and Y values as given. Create your Dummy variable(s), then create another column Z=DX and set its values equal to X*D.

EG. Given y=a + gD + bX + dDX with 4 data points, you would have

Y X D DX
1 2 1 2
2 5 1 5
3 6 0 0
4 7 0 0

CalLadyQED
Forum Guru
Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)

Group: Forum Members
Posts: 62, Visits: 2
The main idea of this module is interactions, so you can bet that they need to be included in the model.
bubba gump
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Posts: 6, Visits: 1
I got the same answers
rcoffman
Junior Member
Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)

Group: Forum Members
Posts: 10, Visits: 1

CalLadyQED: I got the same answers as you.

[NEAS: This homework assignment asks you to do a multiple regression in Excel using dummy variables. This problem is simple; use the Analysis Tookpak to check your work.]


CalLadyQED
Forum Guru
Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)Forum Guru (66 reputation)

Group: Forum Members
Posts: 62, Visits: 2
Did anyone else get this answer for part (D)? Is this correct?
alpha = 0.02932 (intercept)
gamma1 = 0.02968 (coefficient on urban dummy)
gamma2 = -0.02018 (coefficient on suburban dummy)
beta = 0.001006 (coefficient on mileage)
delta1 = 0.004038 (coefficient on mileage-urban interaction)
delta2 = 0.002012 (coefficient on mileage-suburban interaction)

[NEAS: We normally do not verify solutions to homework assignments. This assignment has confused some candidates, so we provide more guidance in our comments; see the Jacob-Rachel dialogue below. This solution is correct; make sure you can set up the variables so that Excel gives this solution.]
Edited 12 Years Ago by NEAS
GO
Merge Selected
Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

  • Login with twitter
  • Login with twitter
Select a Forum....











































































































































































































































Neas-Seminars

Search