kdc207
kdc207

Reputation: 1

mma code error: Must use a vector in `[`, not an object of class matrix

I am using every variation of code I can think of to run a multiple mediation using the mma package in R and I keep getting the same error.

I've used a ton of different variations, but this is the main bit of code I'm trying to run just to identify the mediators vs. covariates.

data.bin<-data.org(x,y,pred=2,mediator=c(1,7:11),alpha=.05,alpha2=.05)

Error: Must use a vector in [, not an object of class matrix. Call rlang::last_error() to see a backtrace

Upvotes: 0

Views: 637

Answers (1)

Q Li
Q Li

Reputation: 21

pred is the data frame of predictor(s). It is separate from x, the data frame of covariates and mediators.

An older version uses pred to indicate the column number of predictor (exposure) in x. This has been changed.

Upvotes: 1

Related Questions