0
$\begingroup$

I have a multilevel model with one significant interaction and several covariates. I understand the results from the summary fairly well, but I'm a bit stumped by the output in the visualization. Here is the output from the model:

enter image description here

I used the cat_plot function in the interactions package in R to create the visualization below. The generated values are not exactly what I would expect. The DV is a continuous variable, and the two variables involved in the interaction are categorical. To plot variables like this, I believe I was taught that I can plug in values for each of the variables in question and add up the coefficients, but I get a much larger value than what is indicated in the plot. For example, if I want to calculate the value of someone who received the intervention and was in middle school, I would add up .025 + .043 -.021. This gives me .047 for when intervention =1 and grade_level=middle. The value for this calculation in the plot is just above .02. I'm obviously missing something here or very misguided. Can anyone give me some insight into how the visualization is generated from the model output? TIA

cat_plot(intensity_lme_math_grade_inter_no_year , pred =Intervention  , modx = grade_level, geom = "line", vary.lty = TRUE, x.label="Intervention", y.label = "Score", legend.main="Grade Band")

Interaction effect generated by cat_plot

$\endgroup$

2 Answers 2

0
$\begingroup$

You would also have to add in the (Intercept) value to your calculation to get the type of estimate that you seek. The (Intercept) value holds the key here, as its value of 0.031 represents a situation in which Intervention = 0 and grade_level = "elementary". Yet the plot presents a value on the order of -0.025.

I suspect that the discrepancy has to do with how the plotting software is handling the data values associated with other predictors (the perc_ coefficients), each of which is a necessarily non-negative value with a negative regression coefficient. The software is presumably using some average over the data in your model or is otherwise centering some aspect of your data. Software-specific questions are off-topic here, so you might enquire of the package author if that's not clear from the manual.

$\endgroup$
1
  • $\begingroup$ Thanks, @EdM! Good point about the intercept; I should have also included that. I suspect you are right that the covariates are included somehow in the calculation. I will reach out the package author for more information. $\endgroup$
    – Mezy
    Mar 23, 2023 at 3:31
0
$\begingroup$

The package documentation did indeed have an explanation for how the plot was calculated: "Centered: A vector of quoted variable names that are to be mean-centered. If "all", all non-focal predictors are centered. You may instead pass a character vector of variables to center. User can also use "none" to base all predictions on variables set at 0. The response variable, pred, modx, and mod2 variables are never centered." (my emphasis) https://interactions.jacob-long.com/reference/cat_plot.html#ref-usage

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.