Questions tagged [interaction-plot]

13 questions
5
votes
1 answer

Interaction Plot from statsmodels.formula.api using Python

Taken from here (my website). I wonder how to plot interaction plot from statsmodels.formula.api objects. Consumption = [51, 52, 53, 54, 56, 57, 55, 56, 58, 59, 62, 63] Gender = ["Male", "Male", "Male", "Male", "Male", "Male", "Female", "Female",…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
1
vote
1 answer

Modify color and font of emmip plot (emmeans package) in R

Hello :) I am desperately trying to change the colors and font of my emmip plot (plot from the emmeans package in R) but none of my codes are working. Currently my code for the plot looks like this: emmip(Model, group ~ gend, CIs=TRUE, nuisance =…
phdmeme
  • 13
  • 4
1
vote
0 answers

Applying plot_model() function to plm time fixed effect model

I am trying to generate an interaction plot using the following code: library(plm) FE <- plm(y~a*b+c,data=pdata, effect="time",model="within") summary(FE) plot_model(FE, type = "pred", terms = c("a", "b")) and I receive this error: Error in…
sustainex
  • 31
  • 1
1
vote
0 answers

reghelper package: R graph_model error when model includes categorical covariates

I am using the graph_model function under "reghelper" package to plot interaction plot for my multilevel model. My y and x are both continuous variables, I also have a moderator (m) and a covariate (n) which are categorical variables. Here's my…
1
vote
0 answers

Is there an R function for creating an interaction plot of a panelAR model?

In order to strengthen the interpretation of an interaction term I would like to create an interaction plot. Starting Point: I am analyzing a panel data frame with which I fitted a feasible generalized least squares model by using the panelAR…
Patrick123
  • 11
  • 1
0
votes
0 answers

Merge two interaction plots

Here's the problem: I have two data sets and would like to merge the interaction plots of both into one. The variables are the same, it is just a matter of different methods which are to be compared. With lines() I don't get any further and don't…
0
votes
0 answers

Disparity between sim_slopes, johnson_neyman, and prob_interaction in R

I have a significant interaction and I wanted to look more deeply into this interaction, however, when I use sim_slopes, johnson_neyman, and prob_interaction in R with the same exact inputs I get different results/plots. For…
0
votes
1 answer

How do I add TukeyHSD results from multcompLetters function to an interaction plot in R?

I've ran a single-factor ANOVA on my data set and followed that with a TukeyHSD post-hoc test. I then used multcompLetters() to assign letters to the significant TukeyHSD results. I'm now trying to add the letters to an interaction plot. However, I…
0
votes
1 answer

How to plot only certain values of continuous variables using `sjPlot::plot_model()`

I'm using the plot_model() function in R to visualize an interaction for an OLS regression. The regression is: model <- lm(dv ~ condition + control1 + control2 + variable1 + condition*variable1, data=data) condition is a 4-level factor…
Sgary
  • 1
0
votes
1 answer

Shap interaction plots

I am applying SHAP on XGBoost regressor. I am trying to plot the interaction effects. But the summary plot is displaying only few variables. What to do in case of more than 10 variables? I tried using "shap.summary_plot(shap_interaction_values, X)"…
T_S
  • 3
  • 2
0
votes
0 answers

How to change the order of categorical x-axis in interaction plot in python?

So I am generating the interaction plot by using statsmodels package. Here in the figure below, you can see my current result. I would like to have first "Block" and second "Alternating" in my x-axis. I was wondering how to make this change? Here is…
0
votes
1 answer

Calculating predicted values for interaction plot incl categorial factors

I am trying to predict the presence of a spieces sighted during different moon phases using glm() and family=binomial, incl a couple of other environmental variables such as seastate, wind direction and survey duration. The best model (lowest AIC)…
Cathrin
  • 51
  • 5
-1
votes
1 answer

Combined Boxplots in R

I want to draw the same exact graph in R. However, I want to consider two options: (1) with one x axis for each of the genders & (2) two different xaxes for each of the gender. Here is also the link for where I found the image:…
MK25
  • 11
  • 4