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 [2025/06/16 07:30] – [Two category 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 273: | Line 274: | ||
< | < | ||
- | # install.packages(" | + | > interact_plot(mod2, |
- | # install.packages(" | + | |
- | library(jtools) | + | |
- | library(interactions) | + | |
- | interact_plot(mod2, | + | |
</ | </ | ||
{{: | {{: | ||
< | < | ||
- | > # install.packages(" | ||
- | > # install.packages(" | ||
- | > library(jtools) | ||
- | > library(interactions) | ||
> interact_plot(mod2, | > interact_plot(mod2, | ||
</ | </ | ||
Line 427: | 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 477: | 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.1750026613.txt.gz · Last modified: 2025/06/16 07:30 by hkimscil