interaction_effects_in_regression_analysis
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
interaction_effects_in_regression_analysis [2023/06/14 08:50] – [Two continuous variables] hkimscil | interaction_effects_in_regression_analysis [2025/06/16 13:00] (current) – [E.g.2] hkimscil | ||
---|---|---|---|
Line 96: | Line 96: | ||
====== Two category variables ====== | ====== Two category variables ====== | ||
- | < | + | < |
+ | > set.seed(12) | ||
> f1< | > f1< | ||
> f2< | > f2< | ||
Line 272: | Line 273: | ||
- f1High:f2C : 질소가 High이고 온도도 High인 상태 -1.16 감소한다. | - f1High:f2C : 질소가 High이고 온도도 High인 상태 -1.16 감소한다. | ||
- | < | + | <code> |
- | {{: | + | > interact_plot(mod2, |
+ | </ | ||
+ | {{: | ||
+ | < | ||
+ | > interact_plot(mod2, | ||
+ | </ | ||
+ | {{: | ||
+ | : | ||
====== Two continuous variables ====== | ====== Two continuous variables ====== | ||
< | < | ||
Line 379: | Line 387: | ||
- (위의 마지막 식에서) x1:x2 = x1*x2 : 질소량이 1씩 증가할 때 마다, 온도의 영향력은 1.5식 증가한다. 예를 들면 질소량이 0일 경우, 온도와 작물 간의 기울기는 약 2인데, 질소의 양이 1 증가하고 온도가 1 증가하면 기울기는 2 + 1.5 = 3.5가 된다. | - (위의 마지막 식에서) x1:x2 = x1*x2 : 질소량이 1씩 증가할 때 마다, 온도의 영향력은 1.5식 증가한다. 예를 들면 질소량이 0일 경우, 온도와 작물 간의 기울기는 약 2인데, 질소의 양이 1 증가하고 온도가 1 증가하면 기울기는 2 + 1.5 = 3.5가 된다. | ||
- <WRAP box>< | - <WRAP box>< | ||
- | x2=1: 0.97 + *3.5 x1 + -1 x2 | + | # 0.97 = 1 로 보면 |
- | x2=2: 0.97 + *5.0 x1 + -1 x2 | + | x2=1: 0.97 + *3.5 x1 + -1 (1=x2) |
- | x2=3: 0.97 + *6.5 x1 + -1 x2 | + | 0 + 3.5 x1 |
- | x2=4: 0.97 + *8.0 x1 + -1 x2 | + | x2=2: 0.97 + *5.0 x1 + -1 (2=x2) |
- | x2=5: 0.97 + *9.5 x1 + -1 x2</ | + | -1 + 5.0 x1 |
+ | x2=3: 0.97 + *6.5 x1 + -1 (3=x2) | ||
+ | -2 + 6.5 x1 | ||
+ | x2=4: 0.97 + *8.0 x1 + -1 (4=x2) | ||
+ | -3 + 8.0 x1 | ||
+ | x2=5: 0.97 + *9.5 x1 + -1 (5=x2) | ||
+ | -4 + 9.5 x1 | ||
+ | </ | ||
< | < | ||
*(1.995115 + 1.499595*x2): | *(1.995115 + 1.499595*x2): | ||
Line 405: | Line 420: | ||
====== E.g.2 ====== | ====== E.g.2 ====== | ||
{{: | {{: | ||
- | Download the data file to c:/ | + | < |
- | do | + | # states.data <- readRDS(" |
- | < | + | states.data <- readRDS(url("http://commres.net/ |
+ | </ | ||
Or, read the above data file directly | Or, read the above data file directly | ||
Line 455: | Line 471: | ||
</ | </ | ||
< | < | ||
- | > data.info <- data.frame(attributes(data)[c(" | + | > data.info <- data.frame(attributes(states.data)[c(" |
> # attributes(data) reveals various attributes of the data file, | > # attributes(data) reveals various attributes of the data file, | ||
> # which contains variable names and labels. | > # which contains variable names and labels. |
interaction_effects_in_regression_analysis.1686700255.txt.gz · Last modified: 2023/06/14 08:50 by hkimscil