jacob-long / jacob-long/interactions

Elements of slopes are different

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
R
Stars
135
Forks
19
PR merge metrics
No merged PRs in 30d

Description

The data (a list of possibly) within the `slopes` element of the `sim_slopes()` function, are of different class, the first one is of class "data.frame" and the second one is of classes "matrix" and "array". This is probably to the two moderators or the modx.values.

This prevents the uses of apply() functions.

`out <- sim_slopes(model = reg.res,
pred = X,
modx = W,
mod2 = Z,
modx.values = "plus-minus",
mod2.values = "plus-minus",
jnplot = TRUE`
![image](https://github.com/user-attachments/assets/2d10de46-0a87-46a5-b61b-a65690771409)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the two-moderator `sim_slopes()` call from the issue and inspect how the `slopes` element is assembled. Compare the classes of its entries for the `modx.values` and `mod2.values` settings, then verify that the resulting list has a consistent structure usable with `apply()`.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.