jacob-long / jacob-long/jtools

Unable to plot interaction of plm output, jtools error message

Open
#97 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
R
Stars
171
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Hello. I'm trying to plot the interaction of a plm output, but it keeps giving me the following error. I've tried uninstalling and reinstalling R and the packages therein, but to no avail. I googled the error and there seems to be another person who has the same issue ([StackOverflow post](https://stackoverflow.com/questions/62035663/how-to-plot-interactions-with-plm-model)). Would you be so kind as to help figure out what is happening? Your help is much appreciated. Thank you!

Model run & error:

> plm(data = data, formula = y ~ x1 + x2 + x1*x2, model = "within", index = c("grp", "year")))
>
> Error: ~does not appear to be a one- or two-sided formula.
> y does not appear to be a one- or two-sided formula.
> x1 + x2 + x1 * x2 does not appear to be a one- or two-sided formula.
> Backtrace:
>
> interactions::interact_plot(...)
> jtools::get_data(model, warn = TRUE, ...)
> jtools:::get_lhs(formula)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `plm` model and interaction plot shown in the issue, then follow the backtrace through `interactions::interact_plot`, `jtools::get_data`, and `jtools:::get_lhs`. Done means the interaction plot works for the shown model without the formula errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.