How to fix an error in a moderation model in R with continuous variables?

33 Views Asked by At

I am trying to run a moderation model in R but I don't have a lot of experience working with R and I struggle. I will appreciate any help and advise you can give me! I really want to learn. I am using Hayes model (model 1 / process) because all my variables are continuous. This is my code:

library(psych)
library(interactions)
library(rockchalk)
 process(data = Prac, y = "no_After", x = "no_before", w = "FOMO", model = 1, center = 2, moments = 1, modelbt = 1, boot = 10000, seed = 12345)

And this is the error:

Error in desctmp[(4 + kd), jd] <- value : replacement has length zero

I Don't have any missing values, and I don't have any outliers. I updated and then restarted the R, and all my packages are updated too. I ended up creating another copy of the CSV file I have manually to see if this changes anything (didn't help). This is my data (It's not a lot because it's a beginners'' project in one of my classes):

> str(Prac)
'data.frame':   3 obs. of  4 variables:
 $ Subject  : int  101 103 119
 $ FOMO     : int  35 17 21
 $ no_before: num  3.25 5.3 11.94
 $ no_After : num  1.91 8.07 2.62
0

There are 0 best solutions below