This repository has been archived by the owner on Sep 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
2018-04-18 Interactions.Rpres
132 lines (92 loc) · 4.33 KB
/
2018-04-18 Interactions.Rpres
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Interactions
========================================================
author: Simone Mueller
date: 2018-18-04
autosize: true
Motivational example
========================================================
A manatee struck by a keel is less likely to live than another grazed by a propeller.
The kind of damage you see is conditional on survival.
Why do we need interactions?
========================================================
>>It is neccessary when the importance of one predictor depends upon another predictor.
Example of an interaction
========================================================
left:40%
![Fig1](Fig1.png)
***
It's **not** a good idea to split the data in this way.
Adding a dummy variable doesn't work
========================================================
left:40%
![Fig2](Fig2.png)
***
It can’t do anything to the **slope** of the line.
Adding a linear interaction does work
========================================================
![Fig3](Fig3.png)
![Fig4](Fig4.png)
***
The linear model is built by replacing the parameter $\mu_{i}$ in the top line.
The new symbol $\gamma_{i}$ is just a placeholder for the linear function that defines the slope between GDP and ruggedness.
Adding a linear interaction does work
========================================================
![Fig5](Fig5.png)
Plotting the interaction
========================================================
![Fig6](Fig6.png)
Interpreting an interaction estimate
========================================================
>> - A "main effect" coefficient in an interaction model does not mean the same thing as a coefficient of the same name in a model without an interaction.
>> - Tables of numbers don't make it easy to fully incorporate uncertainty in our thinking, since covariance among parameters isn't usually shown.
Parameters change meaning
========================================================
meaning **without** interaction
- each coefficient says how much the average outcome, $\mu$, changes when the predictor changes by one unit.
meaning **with** interaction
- now the change in $\mu_{i}$ that results from a unit change in $R_{i}$ is given by $\gamma_{i}$. And since $\gamma_{i}$ is a function of three things - $\beta_{R}$,$\beta_{AR}$, and $A_{i}$ - we have to know all three in order to know the influence of $R_{i}$ on the outcome.
Incorporating uncertainty
========================================================
left:40%
![Fig7](Fig7.png)
***
The distribution of their difference is not the same as the visual overlap of their marginal distributions.
Symmetry of the linear interaction
========================================================
>>- How much does the influence of ruggedness (on GDP) depend upon whether the nation is in Africa?
>>- How much does the influence of being in Africa (on GDP) depend upon ruggedness?
Symmetry of the linear interaction
========================================================
<center>
![Fig8](Fig8.png)
</center>
Africa depends upon ruggedness
========================================================
![Fig9](Fig9.png)
Continuous interaction
========================================================
- Data:
The data are sizes of blooms from beds of tulpis grown in greenhouses, under different soil and light conditions.
The blooms variable will be our outcome – what we wish to predict.
The water and shade variables will be our predictor variables.
Water indicates one of three ordered levels of soil moisture, from low (1) to high (3).
Shade indicates one of three ordered levels of light exposure, from high (1) to low (3).
Centering?
========================================================
- benefits of centering:
>>(1) it’s easier to lean on the coefficients alone in understanding the model
>>(2) can help you to achieve a faster and more reliable set of estimates
***
- disadvantages of uncenterd-models
>>(1) error messages as a result of poor starting values
>>(2) neither of the predictor variables ever takes the value zero within the data intercept estimates are very hard to interpret
Results of the centerd-models
========================================================
![Fig10](Fig10.png)
Plotting implied predictions
========================================================
<center>
![Fig11](Fig11.png)
</center>
Thank you very much!
========================================================